Modifier and Type | Method and Description |
---|---|
void |
addUser(User user) |
void |
addUser(User user,
boolean asSpectator) |
boolean |
containsProperty(java.lang.Object key)
Checks whether a custom property exists or not
|
boolean |
containsUser(java.lang.String name)
Checks if the specified User is joined in the Room
|
boolean |
containsUser(User user)
Checks if the specified User is joined in the Room
|
boolean |
containsVariable(java.lang.String varName)
Checks if a certain Room Variable name exists
|
void |
destroy() |
SFSRoomRemoveMode |
getAutoRemoveMode()
Return the auto-remove mode of the Room
|
int |
getCapacity()
Return the capacity of the Room (maximum number of clients that can be contained).
|
java.lang.String |
getDump()
Get a dump of all Room attributes/settings.
|
ISFSExtension |
getExtension()
Get the extension connected to this Room, if any
|
java.lang.String |
getGroupId()
Get the Room Group Id.
|
int |
getId()
Return the unique Room Id
|
long |
getLifeTime()
Obtain the time of existence of the Room
|
int |
getMaxRoomVariablesAllowed()
Return the maximum number of Room Variables allowed in the Room.
|
int |
getMaxSpectators()
Return the maximum number of Spectators allowed in the Room.
|
int |
getMaxUsers()
Return the maximum number of Users allowed in the Room.
|
java.lang.String |
getName()
Get the room name
|
User |
getOwner()
Get the owner of the Room (the user that created it)
|
java.lang.String |
getPassword()
Get the Room password.
|
java.lang.String |
getPlayerIdGeneratorClassName() |
java.util.List<User> |
getPlayersList()
For Game Rooms: get all Players in the Room (same as all User without the Spectators)
|
java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> |
getProperties()
Get the map with all Room properties
|
java.lang.Object |
getProperty(java.lang.Object key)
Get any custom property attached to this Room.
|
ISFSArray |
getRoomVariablesData(boolean globalsOnly) |
java.util.List<ISession> |
getSessionList()
Get all the User Sessions in the Room
|
RoomSize |
getSize()
Return the current Room size
|
java.util.List<User> |
getSpectatorsList()
For Game Rooms: get all Spectators in the Room (same as all User without the Players)
|
User |
getUserById(int id) |
User |
getUserByName(java.lang.String name) |
User |
getUserByPlayerId(int playerId)
Get the User currently having the specified playerId (Game Room only)
|
User |
getUserBySession(ISession session) |
java.util.List<User> |
getUserList()
Get all Users in the Room
|
ISFSArray |
getUserListData() |
com.smartfoxserver.v2.entities.managers.IUserManager |
getUserManager() |
RoomVariable |
getVariable(java.lang.String varName)
Get a Room Variable
|
java.util.List<RoomVariable> |
getVariables()
Get the full list of Room Variables in the Room
|
int |
getVariablesCount()
Get the total amount of Room Variables for this Room
|
java.util.List<RoomVariable> |
getVariablesCreatedByUser(User user)
Get a list of Room Variables created by a specific User
|
Zone |
getZone()
Get the Zone managing this Room.
|
boolean |
isActive()
Return true if the Room is active in the Zone.
|
boolean |
isAllowOwnerInvitations()
True if the Room allows only its creator to send JoinRoomInvitations.
|
boolean |
isDynamic()
Checks if the Room was created dynamically (at runtime)
|
boolean |
isEmpty()
Checks whether the Room is empty
|
boolean |
isFlagSet(SFSRoomSettings flag)
Checks whether a certain Room Setting is set
|
boolean |
isFull()
Checks whether the Room is full.
|
boolean |
isGame()
Checks if this is a Game Room
|
boolean |
isHidden()
Checks if the Game is hidden.
|
boolean |
isPasswordProtected()
Checks if the Room requires a password for joining it
|
boolean |
isPublic()
Returns true if the Room has public access, in other words it doesn't require a password.
|
boolean |
isUseWordsFilter()
Check if the word filter is used in this Room (applied to Public Messages)
|
void |
removeProperty(java.lang.Object key)
Removes a custom property
|
void |
removeUser(User user) |
void |
removeVariable(java.lang.String varName) |
java.util.List<RoomVariable> |
removeVariablesCreatedByUser(User user) |
java.util.List<RoomVariable> |
removeVariablesCreatedByUser(User user,
boolean isLeaveRoom) |
void |
setActive(boolean flag) |
void |
setAllowOwnerInvitations(boolean flag)
Set to true if the Room allows only its creator to send JoinRoomInvitations.
|
void |
setAutoRemoveMode(SFSRoomRemoveMode mode) |
void |
setCapacity(int maxUser,
int maxSpectators) |
void |
setDynamic(boolean b) |
void |
setExtension(ISFSExtension extension) |
void |
setFlag(SFSRoomSettings flag,
boolean state) |
void |
setFlags(java.util.Set<SFSRoomSettings> settings) |
void |
setGame(boolean b) |
void |
setGame(boolean b,
java.lang.Class<? extends IPlayerIdGenerator> customPlayerIdGeneratorClass) |
void |
setGroupId(java.lang.String group) |
void |
setHidden(boolean b) |
void |
setMaxRoomVariablesAllowed(int max) |
void |
setMaxSpectators(int max) |
void |
setMaxUsers(int max) |
void |
setName(java.lang.String name) |
void |
setOwner(User user) |
void |
setPassword(java.lang.String password) |
void |
setProperty(java.lang.Object key,
java.lang.Object value)
Attach a custom (server-side only) property to the Room object
|
void |
setUserManager(com.smartfoxserver.v2.entities.managers.IUserManager manager) |
void |
setUseWordsFilter(boolean useWordsFilter)
Toggle the word filter in this Room (applied to Public Messages)
|
void |
setVariable(RoomVariable roomVariable) |
void |
setVariable(RoomVariable roomVariable,
boolean overridOwnership) |
void |
setVariables(java.util.List<RoomVariable> variables) |
void |
setVariables(java.util.List<RoomVariable> variables,
boolean overridOwnership) |
void |
setZone(Zone zone) |
void |
switchPlayerToSpectator(User user) |
void |
switchSpectatorToPlayer(User user) |
ISFSArray |
toSFSArray(boolean globalVarsOnly) |
int getId()
java.lang.String getGroupId()
void setGroupId(java.lang.String group)
java.lang.String getName()
void setName(java.lang.String name)
java.lang.String getPassword()
isPasswordProtected()
void setPassword(java.lang.String password)
boolean isPasswordProtected()
boolean isPublic()
int getCapacity()
void setCapacity(int maxUser, int maxSpectators)
int getMaxUsers()
void setMaxUsers(int max)
int getMaxSpectators()
void setMaxSpectators(int max)
int getMaxRoomVariablesAllowed()
void setMaxRoomVariablesAllowed(int max)
User getOwner()
void setOwner(User user)
RoomSize getSize()
RoomSize
com.smartfoxserver.v2.entities.managers.IUserManager getUserManager()
void setUserManager(com.smartfoxserver.v2.entities.managers.IUserManager manager)
Zone getZone()
void setZone(Zone zone)
boolean isDynamic()
boolean isGame()
boolean isHidden()
void setDynamic(boolean b)
void setGame(boolean b)
void setGame(boolean b, java.lang.Class<? extends IPlayerIdGenerator> customPlayerIdGeneratorClass)
void setHidden(boolean b)
void setFlags(java.util.Set<SFSRoomSettings> settings)
void setFlag(SFSRoomSettings flag, boolean state)
boolean isFlagSet(SFSRoomSettings flag)
flag
- the flagSFSRoomSettings
SFSRoomRemoveMode getAutoRemoveMode()
SFSRoomRemoveMode
void setAutoRemoveMode(SFSRoomRemoveMode mode)
boolean isEmpty()
boolean isFull()
boolean isActive()
void setActive(boolean flag)
ISFSExtension getExtension()
void setExtension(ISFSExtension extension)
RoomVariable getVariable(java.lang.String varName)
varName
- the name of the variableSFSRoomVariable
java.util.List<RoomVariable> getVariables()
void setVariable(RoomVariable roomVariable, boolean overridOwnership) throws SFSVariableException
SFSVariableException
void setVariable(RoomVariable roomVariable) throws SFSVariableException
SFSVariableException
void setVariables(java.util.List<RoomVariable> variables, boolean overridOwnership)
void setVariables(java.util.List<RoomVariable> variables)
java.util.List<RoomVariable> getVariablesCreatedByUser(User user)
user
- the Userjava.util.List<RoomVariable> removeVariablesCreatedByUser(User user)
java.util.List<RoomVariable> removeVariablesCreatedByUser(User user, boolean isLeaveRoom)
void removeVariable(java.lang.String varName)
boolean containsVariable(java.lang.String varName)
varName
- the variable nameint getVariablesCount()
java.lang.Object getProperty(java.lang.Object key)
key
- java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> getProperties()
void setProperty(java.lang.Object key, java.lang.Object value)
key
- the property namevalue
- the property valueboolean containsProperty(java.lang.Object key)
key
- the name of the propertyvoid removeProperty(java.lang.Object key)
key
- the name of the propertyUser getUserById(int id)
id
- the User idUser getUserByName(java.lang.String name)
name
- the User nameUser getUserBySession(ISession session)
session
- the User sessionUser getUserByPlayerId(int playerId)
playerId
- the player idjava.util.List<User> getUserList()
java.util.List<User> getPlayersList()
java.util.List<User> getSpectatorsList()
java.util.List<ISession> getSessionList()
ISFSArray getUserListData()
ISFSArray getRoomVariablesData(boolean globalsOnly)
void addUser(User user, boolean asSpectator) throws SFSJoinRoomException
SFSJoinRoomException
void addUser(User user) throws SFSJoinRoomException
SFSJoinRoomException
void removeUser(User user)
boolean containsUser(User user)
user
- the Userboolean containsUser(java.lang.String name)
name
- the User nameISFSArray toSFSArray(boolean globalVarsOnly)
void switchPlayerToSpectator(User user) throws SFSRoomException
SFSRoomException
void switchSpectatorToPlayer(User user) throws SFSRoomException
SFSRoomException
boolean isUseWordsFilter()
void setUseWordsFilter(boolean useWordsFilter)
useWordsFilter
- long getLifeTime()
java.lang.String getDump()
void destroy()
java.lang.String getPlayerIdGeneratorClassName()
boolean isAllowOwnerInvitations()
void setAllowOwnerInvitations(boolean flag)
flag
- true if the Room allows only its creator to send JoinRoomInvitations. Use false if any non spectator User joined in the Room can invite other people.