SFS2X Objective-C API  1.7.13
iOS / macOS / tvOS
SFSGameSettings Class Reference

#import <SFSGameSettings.h>

Inherits RoomSettings.

Instance Methods

(id) - initWithName:
 

Class Methods

(id) + settingsWithName:
 

Properties

BOOL isPublic
 
NSInteger minPlayersToStartGame
 
NSArray * invitedPlayers
 
NSArray * searchableRooms
 
MatchExpressionplayerMatchExpression
 
MatchExpressionspectatorMatchExpression
 
NSInteger invitationExpiryTime
 
BOOL leaveJoinedLastRoom
 
BOOL notifyGameStarted
 
id< ISFSObject > invitationParams
 
- Properties inherited from RoomSettings
NSString * name
 
NSString * password
 
NSString * groupId
 
BOOL isGame
 
NSInteger maxUsers
 
NSInteger maxSpectators
 
NSInteger maxVariables
 
NSArray * variables
 
RoomPermissionspermissions
 
RoomEventsevents
 
RoomExtensionextension
 
BOOL allowOwnerOnlyInvitation
 

Detailed Description

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 SFSGame 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 SFSGame

  • 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 also
CreateSFSGameRequest
MatchExpression

Property Documentation

◆ invitationExpiryTime

- (NSInteger) invitationExpiryTime
readwritenonatomicassign

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

◆ invitationParams

- (id<ISFSObject>) invitationParams
readwritenonatomicstrong

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

◆ invitedPlayers

- (NSArray*) invitedPlayers
readwritenonatomicstrong

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

◆ isPublic

- (BOOL) isPublic
readwritenonatomicassign

Check if the Game is public or private

◆ leaveJoinedLastRoom

- (BOOL) leaveJoinedLastRoom
readwritenonatomicassign

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

◆ minPlayersToStartGame

- (NSInteger) minPlayersToStartGame
readwritenonatomicassign

The minimum number of players to start the Game

◆ notifyGameStarted

- (BOOL) notifyGameStarted
readwritenonatomicassign

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
SFSRoomVariable
ReservedRoomVariables

◆ playerMatchExpression

- (MatchExpression*) playerMatchExpression
readwritenonatomicstrong

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

See also
MatchExpression

◆ searchableRooms

- (NSArray*) searchableRooms
readwritenonatomicstrong

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

◆ spectatorMatchExpression

- (MatchExpression*) spectatorMatchExpression
readwritenonatomicstrong

A MatchExpression for filtering Spectators joining the Game.

See also
MatchExpression