|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Room
The Room interface defines all the methods and properties that an object representing a SmartFoxServer Room entity exposes.
In the SmartFoxServer 2X client API this interface is implemented by the SFSRoom class. Read the class description for additional informations.
SFSRoom| Method Summary | |
|---|---|
void |
addUser(User user)
*Private* |
boolean |
containsUser(User user)
Indicates whether the specified user is currently inside this Room or not. |
boolean |
containsVariable(java.lang.String name)
Indicates whether this Room has the specified Room Variable set or not. |
int |
getCapacity()
Returns the maximum amount of users, including spectators, that can be contained in this Room. |
java.lang.String |
getGroupId()
Returns the Room Group name. |
int |
getId()
Indicates the id of this Room. |
int |
getMaxSpectators()
Returns the maximum number of spectators allowed in this Room (Game Rooms only). |
int |
getMaxUsers()
Returns the maximum number of users allowed in this Room. |
java.lang.String |
getName()
Indicates the name of this Room. |
java.util.List<User> |
getPlayerList()
Returns a list of User objects representing the players currently inside this Room (Game Rooms only). |
java.util.Map<?,?> |
getProperties()
Defines a generic utility object that can be used to store custom Room data. |
IRoomManager |
getRoomManager()
A reference to the RoomManager, managing this Room |
int |
getSpectatorCount()
Returns the current number of spectators in this Room (Game Rooms only). |
java.util.List<User> |
getSpectatorList()
Returns a list of User objects representing the spectators currently inside this Room (Game Rooms only). |
User |
getUserById(int id)
Retrieves a User object from its id property. |
User |
getUserByName(java.lang.String name)
Retrieves a User object from its name property. |
int |
getUserCount()
Returns the current number of users in this Room. |
java.util.List<User> |
getUserList()
Returns a list of User objects representing all the users currently inside this Room. |
RoomVariable |
getVariable(java.lang.String name)
Retrieves a Room Variable from its name. |
java.util.List<RoomVariable> |
getVariables()
Retrieves all the Room Variables of this Room. |
boolean |
isGame()
Indicates whether this is a Game Room or not. |
boolean |
isHidden()
Indicates whether this Room is hidden or not. |
boolean |
isJoined()
Indicates whether the client joined this Room or not. |
boolean |
isManaged()
*Private* |
boolean |
isPasswordProtected()
Indicates whether this Room requires a password to be joined or not. |
void |
merge(Room anotherRoom)
*Private* |
void |
removeUser(User user)
*Private* |
void |
setGame(boolean game)
*Private* |
void |
setHidden(boolean hidden)
*Private* |
void |
setJoined(boolean joined)
*Private* |
void |
setManaged(boolean managed)
*Private* |
void |
setMaxSpectators(int maxSpectators)
*Private* |
void |
setMaxUsers(int maxUsers)
*Private* |
void |
setName(java.lang.String name)
*Private* |
void |
setPasswordProtected(boolean passwordProtected)
*Private* |
void |
setProperties(java.util.Map<?,?> properties)
|
void |
setRoomManager(IRoomManager manager)
*Private* |
void |
setSpectatorCount(int spectatorCount)
*Private* |
void |
setUserCount(int userCount)
*Private* |
void |
setVariable(RoomVariable roomVariable)
*Private* |
void |
setVariables(java.util.List<? extends RoomVariable> roomVariables)
*Private* |
| Method Detail |
|---|
int getId()
java.lang.String getName()
NOTE: setting the name property manually has no effect on the server and can disrupt the API functioning. Use the ChangeRoomNameRequest request instead.
ChangeRoomNameRequestvoid setName(java.lang.String name)
java.lang.String getGroupId()
Room Groups enable developers to organize Rooms under different types or categories and let clients select only those Groups they are interested in, in order to receive their events only. This is done via the SubscribeRoomGroupRequest and UnsubscribeRoomGroupRequest requests.
Default: default
SubscribeRoomGroupRequest,
UnsubscribeRoomGroupRequestboolean isJoined()
NOTE: setting the isJoined property manually has no effect on the server and can disrupt the API functioning. Use the JoinRoomRequest request to join a new Room instead.
JoinRoomRequestboolean isGame()
NOTE: setting the isGame property manually has no effect on the server and can disrupt the API functioning. This flag must be set when creating the Room.
boolean isHidden()
NOTE: setting the isHidden property manually has no effect on the server and can disrupt the API functioning. This flag must be set when creating the Room.
boolean isPasswordProtected()
NOTE: setting the isPasswordProtected property manually has no effect on the server and can disrupt the API functioning. This flag depends on the Room's password set when the Room is created or by means of the ChangeRoomPasswordStateRequest request.
ChangeRoomPasswordStateRequestvoid setPasswordProtected(boolean passwordProtected)
boolean isManaged()
int getUserCount()
NOTE: setting the userCount property manually has no effect on the server and can disrupt the API functioning. This flag depends on the Room state.
int getMaxUsers()
NOTE: setting the maxUsers property manually has no effect on the server and can disrupt the API functioning. This flag must be set when creating the Room.
int getSpectatorCount()
NOTE: setting the spectatorCount property manually has no effect on the server and can disrupt the API functioning. This flag depends on the Room state.
int getMaxSpectators()
NOTE: setting the maxSpectators property manually has no effect on the server and can disrupt the API functioning. This flag must be set when creating the Game Room.
int getCapacity()
void setJoined(boolean joined)
void setGame(boolean game)
void setHidden(boolean hidden)
void setManaged(boolean managed)
void setUserCount(int userCount)
void setMaxUsers(int maxUsers)
void setSpectatorCount(int spectatorCount)
void setMaxSpectators(int maxSpectators)
void addUser(User user)
void removeUser(User user)
boolean containsUser(User user)
user - The User object representing the user whose presence in this Room must be checked.
true if the user is inside this Room; false otherwise.User getUserByName(java.lang.String name)
name - The name of the user to be found.
null if no user with the passed name exists in this Room.getUserById(int)User getUserById(int id)
id - The id of the user to be found.
null if no user with the passed id exists in this Room.getUserByName(String)java.util.List<User> getUserList()
java.util.List<User> getPlayerList()
java.util.List<User> getSpectatorList()
RoomVariable getVariable(java.lang.String name)
name - The name of the Room Variable to be retrieved.
null if no Room Variable with the passed name exists in this Room.getVariables(),
SetRoomVariablesRequestjava.util.List<RoomVariable> getVariables()
RoomVariable,
getVariable(String)void setVariable(RoomVariable roomVariable)
void setVariables(java.util.List<? extends RoomVariable> roomVariables)
boolean containsVariable(java.lang.String name)
name - The name of the Room Variable whose existance in this Room must be checked.
true if a Room Variable with the passed name exists in this Room.java.util.Map<?,?> getProperties()
void setProperties(java.util.Map<?,?> properties)
IRoomManager getRoomManager()
void setRoomManager(IRoomManager manager)
throws com.smartfoxserver.v2.exceptions.SFSException
com.smartfoxserver.v2.exceptions.SFSExceptionvoid merge(Room anotherRoom)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||