public class CreateRoomSettings
extends java.lang.Object
RoomVariable
allowed in the RoomRoomVariable
that will be added to the RoomModifier and Type | Class and Description |
---|---|
static class |
CreateRoomSettings.RoomExtensionSettings
Define the Extension settings of the Room
Each extension can define 3 parameters
id: the id of the extension (corresponding to the extension folder name)
className: the main extension class file
propertiesFile: (optional) a properties file containing custom configuration data for your extension.
|
Constructor and Description |
---|
CreateRoomSettings() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowOwnerOnlyInvitation()
If false, any User joined in the Room will be able to invite players in the Room.
|
SFSRoomRemoveMode |
getAutoRemoveMode()
Get the Auto-Remove mode of the Room
|
java.lang.Class<? extends IPlayerIdGenerator> |
getCustomPlayerIdGeneratorClass()
Get the PlayerId Generator class.
|
CreateRoomSettings.RoomExtensionSettings |
getExtension()
Get the Extension attached to the Room
|
java.lang.String |
getGroupId()
The name of the Room Group that the new Room will be assigned to.
|
int |
getMaxSpectators()
Get the maximum number of spectators allowed in the Room (game only)
|
int |
getMaxUsers()
Get the maximum number of users allowed in the Room
|
int |
getMaxVariablesAllowed()
Get the maximum number of Room Variables allowed
|
java.lang.String |
getName()
Get the name of the Room.
|
java.lang.String |
getPassword()
Get the Room password.
|
java.util.Map<java.lang.Object,java.lang.Object> |
getRoomProperties()
Get the custom properties attached to the Room object
|
java.util.Set<SFSRoomSettings> |
getRoomSettings()
Get the advanced settings of the Room.
|
java.util.List<RoomVariable> |
getRoomVariables()
Get the list of Room Variables for the new Room
|
boolean |
isDynamic()
A dynamic Room is created at runtime by either a client request or a server side "CreateRoom" command.
|
boolean |
isGame()
Check if the Room is a game.
|
boolean |
isHidden()
The hidden flag allows to conceal one or more Rooms from the Room List.
|
boolean |
isUseWordsFilter()
Check if the word filter is used in this Room (applied to Public Messages)
|
void |
setAllowOwnerOnlyInvitation(boolean allowOwnerInvitation)
If false, any User joined in the Room will be able to invite players in the Room.
|
void |
setAutoRemoveMode(SFSRoomRemoveMode autoRemoveMode)
Set the Auto-Remove mode of the Room for a dynamic Room.
|
void |
setCustomPlayerIdGeneratorClass(java.lang.Class<? extends IPlayerIdGenerator> customPlayerIdGeneratorClass)
All Game Rooms by default use the SFS2X default PlayerId Generator class.
|
void |
setDynamic(boolean isDynamic)
Set the Room as dynamic.
|
void |
setExtension(CreateRoomSettings.RoomExtensionSettings extension)
Set the Extension for the Room
|
void |
setGame(boolean isGame)
Set the Room as a Game Room.
|
void |
setGroupId(java.lang.String groupId)
Set the name of the Room Group that the new Room will be assigned to.
|
void |
setHidden(boolean isHidden)
Set the Room as hidden.
|
void |
setMaxSpectators(int maxSpectators)
Set the maximum number of spectators allowed in the Room (game only)
|
void |
setMaxUsers(int maxUsers)
Set the maximum number of users allowed in the Room
|
void |
setMaxVariablesAllowed(int maxVariablesAllowed)
Set the maximum number of Room Variables allowed
|
void |
setName(java.lang.String name)
Set the name of the Room.
|
void |
setPassword(java.lang.String password)
Set the Room password
|
void |
setRoomProperties(java.util.Map<java.lang.Object,java.lang.Object> roomProperties)
Allows to set a number of custom properties that will be available in the Room Extension
|
void |
setRoomSettings(java.util.Set<SFSRoomSettings> roomSettings)
Set the advanced settings of the Room.
|
void |
setRoomVariables(java.util.List<RoomVariable> roomVariables)
Set one or more Room Variables in the new Room
|
void |
setUseWordsFilter(boolean useWordsFilter)
Toggle the word filter in this Room (applied to Public Messages)
|
java.lang.String |
toString() |
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name of the new Roompublic java.lang.String getGroupId()
public void setGroupId(java.lang.String groupId)
groupId
- public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the password to join the Roompublic int getMaxUsers()
public void setMaxUsers(int maxUsers)
maxUsers
- the maximum number of users allowed in the Roompublic int getMaxSpectators()
public void setMaxSpectators(int maxSpectators)
maxSpectators
- the maximum number of spectators allowed in the Roompublic boolean isDynamic()
NOTE: When the flag is turned off the Room is considered "static" and therefore never removed. In other words the AutoRemoveMode parameter will be ignored.
public void setDynamic(boolean isDynamic)
isDynamic
- public boolean isGame()
public void setGame(boolean isGame)
isGame
- public boolean isHidden()
public void setHidden(boolean isHidden)
isHidden
- public SFSRoomRemoveMode getAutoRemoveMode()
SFSRoomRemoveMode
public void setAutoRemoveMode(SFSRoomRemoveMode autoRemoveMode)
Dynamic rooms can be auto-removed with different rules. Make sure the isDynamic flag is also turned on to activate the Auto-Remove.
autoRemoveMode
- the Auto-Remove mode of the RoomSFSRoomRemoveMode
,
setDynamic(boolean)
public java.util.Set<SFSRoomSettings> getRoomSettings()
SFSRoomSettings
public void setRoomSettings(java.util.Set<SFSRoomSettings> roomSettings)
You can use the EnumSet.of() method to easily concatenate multiple flags in a one line expression.
roomSettings
- a List of settings that are active.EnumSet.of(Enum)
public boolean isUseWordsFilter()
public void setUseWordsFilter(boolean useWordsFilter)
useWordsFilter
- public java.util.List<RoomVariable> getRoomVariables()
SFSRoomVariable
public void setRoomVariables(java.util.List<RoomVariable> roomVariables)
roomVariables
- a list of Room VariablesSFSRoomVariable
public CreateRoomSettings.RoomExtensionSettings getExtension()
BaseSFSExtension
,
SFSExtension
public void setExtension(CreateRoomSettings.RoomExtensionSettings extension)
extension
- the extensionBaseSFSExtension
,
SFSExtension
public int getMaxVariablesAllowed()
public void setMaxVariablesAllowed(int maxVariablesAllowed)
maxVariablesAllowed
- the maximum number of Room Variables allowedpublic java.lang.Class<? extends IPlayerIdGenerator> getCustomPlayerIdGeneratorClass()
IPlayerIdGenerator
public void setCustomPlayerIdGeneratorClass(java.lang.Class<? extends IPlayerIdGenerator> customPlayerIdGeneratorClass)
customPlayerIdGeneratorClass
- the custom PlayerId Generator implementationIPlayerIdGenerator
public java.util.Map<java.lang.Object,java.lang.Object> getRoomProperties()
public void setRoomProperties(java.util.Map<java.lang.Object,java.lang.Object> roomProperties)
roomProperties
- a map of custom propertiespublic boolean allowOwnerOnlyInvitation()
NOTE: Users joined as spectators cannot invite other players
SFSGameApi.sendJoinRoomInvitation(com.smartfoxserver.v2.entities.Room, com.smartfoxserver.v2.entities.User, List, int)
public void setAllowOwnerOnlyInvitation(boolean allowOwnerInvitation)
NOTE: Users joined as spectators cannot invite other players
allowOwnerInvitation
- SFSGameApi.sendJoinRoomInvitation(com.smartfoxserver.v2.entities.Room, com.smartfoxserver.v2.entities.User, List, int)
public java.lang.String toString()
toString
in class java.lang.Object