Packagecom.smartfoxserver.v2.entities.managers
Interfacepublic interface IRoomManager
Implementors SFSRoomManager

The IRoomManager interface defines all the methods and properties exposed by the client-side manager of the SmartFoxServer Room entities.

In the SmartFoxServer 2X client API this interface is implemented by the SFSRoomManager class. Read the class description for additional informations.

See also

SFSRoomManager


Public Methods
 MethodDefined By
  
containsGroup(groupId:String):Boolean
Indicates whether the specified Group has been subscribed by the client or not.
IRoomManager
  
containsRoom(idOrName:*):Boolean
Indicates whether a Room exists in the Rooms list or not.
IRoomManager
  
containsRoomInGroup(idOrName:*, groupId:String):Boolean
Indicates whether the Rooms list contains a Room belonging to the specified Group or not.
IRoomManager
  
Returns a list of Rooms currently joined by the client.
IRoomManager
  
Retrieves a Room object from its id.
IRoomManager
  
getRoomByName(name:String):Room
Retrieves a Room object from its name.
IRoomManager
  
Returns the current number of Rooms in the Rooms list.
IRoomManager
  
Returns the names of Room Groups currently subscribed by the client.
IRoomManager
  
getRoomList():Array
Returns a list of Rooms currently "known" by the client.
IRoomManager
  
getRoomListFromGroup(groupId:String):Array
Retrieves the list of Rooms which are part of the specified Room Group.
IRoomManager
  
getUserRooms(user:User):Array
Retrieves a list of Rooms joined by the specified user.
IRoomManager
Method Detail
containsGroup()method
public function containsGroup(groupId:String):Boolean

Indicates whether the specified Group has been subscribed by the client or not.

Parameters

groupId:String — The name of the Group.

Returns
Booleantrue if the client subscribed the passed Group.
containsRoom()method 
public function containsRoom(idOrName:*):Boolean

Indicates whether a Room exists in the Rooms list or not.

Parameters

idOrName:* — The id or name of the Room object whose presence in the Rooms list is to be tested.

Returns
Booleantrue if the passed Room exists in the Rooms list.

See also

containsRoomInGroup()method 
public function containsRoomInGroup(idOrName:*, groupId:String):Boolean

Indicates whether the Rooms list contains a Room belonging to the specified Group or not.

Parameters

idOrName:* — The id or name of the Room object whose presence in the Rooms list is to be tested.
 
groupId:String — The name of the Group to which the specified Room must belong.

Returns
Booleantrue if the Rooms list contains the passed Room and it belongs to the specified Group.

See also

getJoinedRooms()method 
public function getJoinedRooms():Array

Returns a list of Rooms currently joined by the client.

Returns
Array — The list of Room objects representing the Rooms currently joined by the client.

See also

getRoomById()method 
public function getRoomById(id:int):Room

Retrieves a Room object from its id.

Parameters

id:int — The id of the Room.

Returns
Room — An object representing the requested Room; null if no Room object with the passed id exists in the Rooms list.

See also


Example
The following example retrieves a Room object and traces its name:
         
         var roomId:int = 3;
         var room:Room = sfs.getRoomById(roomId);
         trace("The name of Room", roomId, "is", room.name);
         
getRoomByName()method 
public function getRoomByName(name:String):Room

Retrieves a Room object from its name.

Parameters

name:String — The name of the Room.

Returns
Room — An object representing the requested Room; null if no Room object with the passed name exists in the Rooms list.

See also


Example
The following example retrieves a Room object and traces its id:
         
         var roomName:String = "The Lobby";
         var room:Room = sfs.getRoomByName(roomName);
         trace("The ID of Room '", roomName, "' is", room.id);
         
getRoomCount()method 
public function getRoomCount():int

Returns the current number of Rooms in the Rooms list.

Returns
int — The number of Rooms in the Rooms list.
getRoomGroups()method 
public function getRoomGroups():Array

Returns the names of Room Groups currently subscribed by the client.

NOTE: at login time, the client automatically subscribes all the Room Groups specified in the Zone's Default Room Groups setting.

Returns
Array — A list of Room Group names.

See also

getRoomList()method 
public function getRoomList():Array

Returns a list of Rooms currently "known" by the client. The list contains all the Rooms that are currently joined and all the Rooms belonging to the Room Groups that have been subscribed.

NOTE: at login time, the client automatically subscribes all the Room Groups specified in the Zone's Default Room Groups setting.

Returns
Array — The list of the available Room objects.

See also

getRoomListFromGroup()method 
public function getRoomListFromGroup(groupId:String):Array

Retrieves the list of Rooms which are part of the specified Room Group.

Parameters

groupId:String — The name of the Group.

Returns
Array — The list of Room objects belonging to the passed Group.

See also

getUserRooms()method 
public function getUserRooms(user:User):Array

Retrieves a list of Rooms joined by the specified user. The list contains only those Rooms "known" by the Room Manager; the user might have joined others the client is not aware of.

Parameters

user:User — A User object representing the user to look for in the current Rooms list.

Returns
Array — The list of Rooms joined by the passed user.