Class SFS2X.Requests.Game.SFSGameSettings
The settings required to create a Game Room using the CreateSFSGameRequest request.
Constructor Attributes | Constructor Name and Description |
---|---|
Creates a new SFSGameSettings instance.
|
Field Summary
Class Detail
The instance must be passed to the CreateSFSGameRequest class constructor.
On the server-side, a Game Room is represented by the SFSGame Java class which extends the Room class
providing new advanced features such as player matching, game invitations, public and private games, quick game joining, etc.
On the client side Game Rooms are regular Rooms with their isGame property set to true
.
- Parameters:
- {String} name
- The name of the Game Room to be created.
Field Detail
- Default Value:
- 15
Possible custom parameters to be transferred to the invitees are a message for the recipient, the game details (title, type...), the inviter details, etc.
- Default Value:
- null
If the invitations are less than the minimum number of players required to start the game (see the minPlayersToStartGame property), the server will send additional invitations automatically, searching users in the Room Groups specified in the searchableRooms list and filtering them by means of the object passed to the playerMatchExpression property.
The game matching criteria contained in the playerMatchExpression property do not apply to the users specified in this list.
- Default Value:
- null
A public game can be joined by any player whose User Variables match the playerMatchExpression assigned to the Game Room. A private game can be joined by users invited by the game creator by means of invitedPlayers list.
- Default Value:
- true
This setting applies to private games only because users join the Game Room automatically when they accept the invitation to play, while public games require a JoinRoomRequest request to be sent, where this behavior can be determined manually.
- Default Value:
- true
true
, when this number is reached, the game start is notified.
- Default Value:
- 2
If this setting is true
, the game state (started or stopped) is handled by means of the reserved Room Variable
represented by the ReservedRoomVariables.RV_GAME_STARTED constant. Listening to the roomVariablesUpdate event for this variable
allows clients to be notified when the game can start due to minimum number of players being reached.
As the used Room Variable is created as global (see the SFSRoomVariable class description), its update is broadcast outside the Room too: this can be used on the client-side, for example, to show the game state in a list of available games.
- Default Value:
- false
- See also:
- SFS2X.Entities.Variables.ReservedRoomVariables.RV_GAME_STARTED
- SFS2X.SFSEvent.ROOM_VARIABLES_UPDATE
- SFS2X.Entities.Variables.SFSRoomVariable
Filtering is applied when:
- users try to join a public Game Room as players (their User Variables must match the matching criteria)
- the server selects additional users to be invited to join a private game (see the searchableRooms property)
Filtering is not applied to users invited by the creator to join a private game (see the invitedPlayers property).
- Default Value:
- null
- See also:
- SFS2X.Entities.Match.MatchExpression
If the users invited to join the game (specified through the invitedPlayers property) are less than the minimum number of players required to start the game (see the minPlayersToStartGame property), the server will invite others automatically, searching them in Rooms belonging to the Groups specified in this list and filtering them by means of the object passed to the playerMatchExpression property.
- Default Value:
- null
Filtering is applied when users try to join a public Game Room as spectators (their User Variables must match the matching criteria).
- Default Value:
- null
- See also:
- SFS2X.Entities.Match.MatchExpression