Add timestamps to various peer parameters.
parent
69a988200d
commit
f70ed01e7e
|
|
@ -23,10 +23,14 @@ class Peer extends EventEmitter
|
|||
|
||||
this._joined = false;
|
||||
|
||||
this._joinedTimestamp = null;
|
||||
|
||||
this._inLobby = false;
|
||||
|
||||
this._authenticated = false;
|
||||
|
||||
this._authenticatedTimestamp = null;
|
||||
|
||||
this._roles = [ userRoles.NORMAL ];
|
||||
|
||||
this._displayName = false;
|
||||
|
|
@ -39,6 +43,8 @@ class Peer extends EventEmitter
|
|||
|
||||
this._raisedHand = false;
|
||||
|
||||
this._raisedHandTimestamp = null;
|
||||
|
||||
this._transports = new Map();
|
||||
|
||||
this._producers = new Map();
|
||||
|
|
@ -135,9 +141,18 @@ class Peer extends EventEmitter
|
|||
|
||||
set joined(joined)
|
||||
{
|
||||
joined ?
|
||||
this._joinedTimestamp = Date.now() :
|
||||
this._joinedTimestamp = null;
|
||||
|
||||
this._joined = joined;
|
||||
}
|
||||
|
||||
get joinedTimestamp()
|
||||
{
|
||||
return this._joinedTimestamp;
|
||||
}
|
||||
|
||||
get inLobby()
|
||||
{
|
||||
return this._inLobby;
|
||||
|
|
@ -157,6 +172,10 @@ class Peer extends EventEmitter
|
|||
{
|
||||
if (authenticated !== this._authenticated)
|
||||
{
|
||||
authenticated ?
|
||||
this._authenticatedTimestamp = Date.now() :
|
||||
this._authenticatedTimestamp = null;
|
||||
|
||||
const oldAuthenticated = this._authenticated;
|
||||
|
||||
this._authenticated = authenticated;
|
||||
|
|
@ -165,6 +184,11 @@ class Peer extends EventEmitter
|
|||
}
|
||||
}
|
||||
|
||||
get authenticatedTimestamp()
|
||||
{
|
||||
return this._authenticatedTimestamp;
|
||||
}
|
||||
|
||||
get roles()
|
||||
{
|
||||
return this._roles;
|
||||
|
|
@ -231,9 +255,18 @@ class Peer extends EventEmitter
|
|||
|
||||
set raisedHand(raisedHand)
|
||||
{
|
||||
raisedHand ?
|
||||
this._raisedHandTimestamp = Date.now() :
|
||||
this._raisedHandTimestamp = null;
|
||||
|
||||
this._raisedHand = raisedHand;
|
||||
}
|
||||
|
||||
get raisedHandTimestamp()
|
||||
{
|
||||
return this._raisedHandTimestamp;
|
||||
}
|
||||
|
||||
get transports()
|
||||
{
|
||||
return this._transports;
|
||||
|
|
@ -337,7 +370,8 @@ class Peer extends EventEmitter
|
|||
displayName : this.displayName,
|
||||
picture : this.picture,
|
||||
roles : this.roles,
|
||||
raisedHand : this.raisedHand
|
||||
raisedHand : this.raisedHand,
|
||||
raisedHandTimestamp : this.raisedHandTimestamp
|
||||
};
|
||||
|
||||
return peerInfo;
|
||||
|
|
|
|||
Loading…
Reference in New Issue