Inherits from RoomSettings : NSObject
Declared in SFSGameSettings.h
SFSGameSettings.m

Overview

This class provides all the settings required to create an SFSGame(*).

The SFSGame(*) object extends the Room object providing new advanced features such as Player matching, Game invitations, public and private Games, quick game joining etc.

(*) = the class exists only on the server side as extension of the SFSRoom class. On the client side it’s seen as a regular Room.

This is a quick overview of the settings that you can use to setup an

  • isGamePublic: 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 Game creator.
  • minPlayersToStartGame: the minimum number of players to start the game.
  • invitedPlayers: (private games only) a list of players invited in the Game
  • searchableRooms: (private games only) a list of Rooms where the Game API can search for more players to invite. The API will look for more players if the number of people invited is smaller than the minPlayersToStartGame. This way you can add your friends to the game and let the system find more players to start it.
  • leaveLastJoinedRoom: auto-remove players from their previous Room after successful join
  • 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 play the game, by default no expression is used
  • invitationExpiryTime: the amount of time allowed for invited players to accept / refuse
  • invitationParameters: optional custom invitation parameters.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 your game list.

See CreateSFSGameRequest, MatchExpression

Properties

invitationExpiryTime

The amount of time (in seconds) available for the User to reply to the invitation. Suggested range 10-40 seconds

@property (nonatomic, assign) NSInteger invitationExpiryTime

Discussion

The amount of time (in seconds) available for the User to reply to the invitation. Suggested range 10-40 seconds

Declared In

SFSGameSettings.h

invitationParams

An optional custom object with parameters (e.g. a message, game details etc…)

@property (nonatomic, strong) id<ISFSObject> invitationParams

Discussion

An optional custom object with parameters (e.g. a message, game details etc…)

Declared In

SFSGameSettings.h

invitedPlayers

Private games only: a list of invited Players (an Array of Users)

@property (nonatomic, strong) NSArray *invitedPlayers

Discussion

Private games only: a list of invited Players (an Array of Users)

Declared In

SFSGameSettings.h

isPublic

Check if the Game is public or private

@property (nonatomic, assign) BOOL isPublic

Discussion

Check if the Game is public or private

Declared In

SFSGameSettings.h

leaveJoinedLastRoom

Determines if the Players will leave their previous Room when joining the Game

@property (nonatomic, assign) BOOL leaveJoinedLastRoom

Discussion

Determines if the Players will leave their previous Room when joining the Game

Declared In

SFSGameSettings.h

minPlayersToStartGame

The minimum number of players to start the Game

@property (nonatomic, assign) NSInteger minPlayersToStartGame

Discussion

The minimum number of players to start the Game

Declared In

SFSGameSettings.h

notifyGameStarted

Uses a “reserved” global Room Variable to notify the started/stopped status of the game. This depends on the numer of Users inside the Room.

@property (nonatomic, assign) BOOL notifyGameStarted

Discussion

Uses a “reserved” global Room Variable to notify the started/stopped status of the game. This depends on the numer of Users inside the Room.

See Also

Declared In

SFSGameSettings.h

playerMatchExpression

(Recommended for public Games only) A MatchExpression for filtering Users joining the Game.

@property (nonatomic, strong) MatchExpression *playerMatchExpression

Discussion

(Recommended for public Games only) A MatchExpression for filtering Users joining the Game.

See Also

Declared In

SFSGameSettings.h

searchableRooms

Private games only: a list of room groups (Array of String) where to search for more players

@property (nonatomic, strong) NSArray *searchableRooms

Discussion

Private games only: a list of room groups (Array of String) where to search for more players

Declared In

SFSGameSettings.h

spectatorMatchExpression

A MatchExpression for filtering Spectators joining the Game.

@property (nonatomic, strong) MatchExpression *spectatorMatchExpression

Discussion

A MatchExpression for filtering Spectators joining the Game.

See Also

Declared In

SFSGameSettings.h