Class: CreateSFSGameSettings

CreateSFSGameSettings


The CreateSFSGameSettings class extends the basic CreateRoomSettings class providing all the settings required to create an SFSGame.

The SFSGame is a specialized Room, part of the SmartFoxServer 2X Game API. This provides many advanced features such as player matching, game invitations, public and private games, quick game joining, etc.
For an introduction to the SFSGame features, see the SFSGame class documentation.

SFSGame settings

The following parameters define the special SFSGame features:

  • isGamePublic: a flag indicating if the game is public or private. A public game can be joined by any player whose variables match the SFSGame Player Match Expression; private games are based on invitations sent by the SFSGame creator
  • minPlayersToStartGame: the minimum number of players to start the game
  • invitedPlayers: (private games only) a list of players to be invited to play the game
  • searchableRooms: (private games only) a list of Rooms where the Game API should search for more players to invite. The API will look for more players if the number of people invited is smaller than the minPlayersToStartGame setting. This way friends can be added to the game and the system will find the missing players to start it
  • leaveLastJoinedRoom: auto-remove players from their previous Room/s after successfully joining the new SFSGame
  • playerMatchExpression: an expression to match players willing to play the game (by default no expression is used)
  • spectatorMatchExpression: an expression to match spectators willing to attend to the game (by default no expression is used)
  • invitationExpiryTime: the amount of time allowed for users to accept or refuse an invitation to play a game
  • invitationParameters: optional custom parameters attached to the invitation. For example these could provide details about the inviter, the game, an invitation message, etc
  • notifyGameStartedViaRoomVariable: automatically update a reserved Room Variable to signal that the game is started/stopped. The Room Variable uses the global setting to be broadcast outside of the Room; this can be used on the client side to show the game state in the available games list

Notes

See also


new CreateSFSGameSettings()

Creates a new CreateSFSGameSettings instance.

Extends