SFSUserManager

Manages the client-side User List.


This manager keeps track of all Users that are currently joined in the same Rooms of the current User. It also provides utility methods to look for Users by name and id.

Members

(readonly) userCount :number

Total number of Users in the local User List.
Type:
  • number

(readonly) userList :Array.<SFSUser>

List of SFSUser objects representing the Users in the local User List.
Type:

Methods

containsUser(user) → {boolean}

Indicates whether the specified User exists in the local User List.
Parameters:
NameTypeDescription
userSFSUserThe object representing the User whose presence in the User List should be checked.
Returns:
true if the passed User is found in the User List.
Type: 
boolean

containsUserId(id) → {boolean}

Indicates whether the specified User exists in the local User List.
Parameters:
NameTypeDescription
idnumberThe id of the User whose presence in the User List should be checked.
Returns:
true if a User with the passed id is found in the User List.
Type: 
boolean

containsUserName(name) → {boolean}

Indicates whether the specified User exists in the local User List.
Parameters:
NameTypeDescription
namestringThe name of the User whose presence in the User List should be checked.
Returns:
true if a User with the passed name id found in the User List.
Type: 
boolean

getUserById(id) → {SFSUser}

Retrieves a SFSUser object by its id.
Parameters:
NameTypeDescription
idnumberThe id of the User.
Returns:
The object representing the User, or null if no User with the passed id can be found in the local User List.
Type: 
SFSUser

getUserByName(name) → {SFSUser}

Retrieves a SFS by its name.
Parameters:
NameTypeDescription
namestringThe name of the User.
Returns:
The object representing the User, or null if no User with the passed name can be found in the local User List.
Type: 
SFSUser