Constructor
new SFSGameSettings(name)
Pass the instance to the CreateSFSGameRequest class constructor.
| Name | Type | Description |
|---|---|---|
name | string | The name of the Game Room to be created. |
Extends
Members
allowOwnerOnlyInvitation :boolean
- boolean
- Default Value
- true
events :RoomEvents
Room events include: Users entering or leaving the Room, User count change and User Variables update. If set to null, the events configured on the server side are enabled (see the SmartFoxServer Administration Tool documentation).
- Overrides
- Default Value
- null
extension :RoomExtension
- Overrides
- Default Value
- null
groupId :string
If the Group doesn't exist yet, a new one is created before assigning the Room to it.
- string
- Overrides
- Default Value
- "default"
invitationExpiryTime :number
The suggested range is 10 to 40 seconds.
- number
- Default Value
- 15
invitationParams :SFSObject
Custom parameters to be transferred to the invitees can be, for example, a message for the Invitation recipient, the game details (title, type...), the inviter details, etc.
- Default Value
- null
invitedPlayers :Array.<SFSUser>|Array.<SFSBuddy>
If the number of invited Players is less than the minimum number of Players required to start the game (see the SFSGameSettings#minPlayersToStartGame property), the server will send additional Invitations automatically, searching for more Users in the Groups specified in the SFSGameSettings#searchableRooms list and filtering them by means of the SFSGameSettings#playerMatchExpression instance.
The matching criteria expressed by the SFSGameSettings#playerMatchExpression property do not apply to the Users specified in this list.
- Default Value
- null
isGame :boolean
- boolean
- Overrides
- Default Value
- false
isPublic :boolean
A public Game Room can be joined by any Player whose User Variables match the SFSGameSettings#playerMatchExpression assigned to the Game Room. A private Game Room can be joined only by Users invited by the Room creator through the SFSGameSettings#invitedPlayers list.
- boolean
- Default Value
- true
leaveLastJoinedRoom :boolean
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.
- boolean
- Default Value
- true
maxSpectators :number
- number
- Overrides
- Default Value
- 0
maxUsers :number
In case of Game Rooms, this represents the maximum number of Players.
- number
- Overrides
- Default Value
- 10
maxVariables :number
- number
- Overrides
- Default Value
- 5
minPlayersToStartGame :number
If the SFSGameSettings#notifyGameStarted property is set to true, when this number is reached, the game start is notified to all Users in the Game Room.
- number
- Default Value
- 2
name :string
- string
- Overrides
notifyGameStarted :boolean
If set to true, this settings activates a simple game state (started or stopped) handled through the ReservedRoomVariables.RV_GAME_STARTED reserved Room Variable. Listening to the SFSEvent.ROOM_VARIABLES_UPDATE event for this Room Variable allows clients to be notified when the game represented by the Game Room can start due to the 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 Game Rooms.
- boolean
- Default Value
- false
password :string
If the password is set to an empty string, the Room won't be password protected.
- string
- Overrides
- Default Value
- (empty string)
permissions :RoomPermissions
Permissions include: name and password change, maximum Users change and public messaging. If set to null, the permissions configured on the server side are used (see the SmartFoxServer Administration Tool documentation).
- Overrides
- Default Value
- null
playerMatchExpression :MatchExpression
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 invite to join a private Game Room (see the SFSGameSettings#searchableRooms property).
Filtering is not applied to Users directly invited by the Room creator to join the Game Room (if private only); see the SFSGameSettings#invitedPlayers property.
- Default Value
- null
searchableRooms :Array.<string>
If the Users invited to join the Game Room (see the SFSGameSettings#invitedPlayers property) are less than the minimum number of Players required to start the game (see the SFSGameSettings#minPlayersToStartGame property), the server will invite others automatically, searching for them in Rooms belonging to the Groups specified in this list, and filtering them by means of the SFSGameSettings#playerMatchExpression instance.
- Array.<string>
- Default Value
- null
spectatorMatchExpression :MatchExpression
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
variables :Array.<SFSRoomVariable>
- Array.<SFSRoomVariable>
- Overrides
- Default Value
- (empty array)