SmartFoxServer 2X C++ API
Sfs2X::Requests::Game::SFSGameSettings Class Reference

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

#include <SFSGameSettings.h>

Inheritance diagram for Sfs2X::Requests::Game::SFSGameSettings:
Sfs2X::Requests::RoomSettings

Public Member Functions

bool IsPublic ()
 Check if the Game is public or private More...
 
void IsPublic (bool value)
 Check if the Game is public or private More...
 
long int MinPlayersToStartGame ()
 The minimum number of players to start the Game More...
 
void MinPlayersToStartGame (long int value)
 The minimum number of players to start the Game More...
 
boost::shared_ptr< list< boost::shared_ptr< User > > > InvitedPlayersUser ()
 Private games only: the list of invited Players (an Array of Users) More...
 
void InvitedPlayersUser (boost::shared_ptr< list< boost::shared_ptr< User > > > value)
 Private games only: the list of invited Players (an Array of Users) More...
 
boost::shared_ptr< list< boost::shared_ptr< Buddy > > > InvitedPlayersBuddy ()
 Private games only: the list of invited Players (an Array of Users) More...
 
void InvitedPlayersBuddy (boost::shared_ptr< list< boost::shared_ptr< Buddy > > > value)
 Private games only: the list of invited Players (an Array of Users) More...
 
boost::shared_ptr< list< string > > SearchableRooms ()
 Private games only: An list of room groups (Array of String) where to search for more players More...
 
void SearchableRooms (boost::shared_ptr< list< string > > value)
 Private games only: An list of room groups (Array of String) where to search for more players More...
 
long int InvitationExpiryTime ()
 The amount of time (in seconds) available for the User to reply to the invitation. More...
 
void InvitationExpiryTime (long int value)
 The amount of time (in seconds) available for the User to reply to the invitation. More...
 
bool LeaveLastJoinedRoom ()
 Determines if the Players will leave their previous Room when joining the Game More...
 
void LeaveLastJoinedRoom (bool value)
 Determines if the Players will leave their previous Room when joining the Game More...
 
bool NotifyGameStarted ()
 Uses a "reserved" global Room Variable to notify the started/stopped status of the game. More...
 
void NotifyGameStarted (bool value)
 Uses a "reserved" global Room Variable to notify the started/stopped status of the game. More...
 
boost::shared_ptr< MatchExpressionPlayerMatchExpression ()
 A MatchExpression for filtering Users joining the Game. More...
 
void PlayerMatchExpression (boost::shared_ptr< MatchExpression > value)
 A MatchExpression for filtering Users joining the Game. More...
 
boost::shared_ptr< MatchExpressionSpectatorMatchExpression ()
 A MatchExpression for filtering Spectators joining the Game. More...
 
void SpectatorMatchExpression (boost::shared_ptr< MatchExpression > value)
 A MatchExpression for filtering Spectators joining the Game. More...
 
boost::shared_ptr< ISFSObjectInvitationParams ()
 An optional custom object with parameters (e.g. a message, game details etc...) More...
 
void InvitationParams (boost::shared_ptr< ISFSObject > value)
 An optional custom object with parameters (e.g. a message, game details etc...) More...
 
- Public Member Functions inherited from Sfs2X::Requests::RoomSettings
 RoomSettings (string name)
 Constructor More...
 
boost::shared_ptr< string > Name ()
 The name of the new Room More...
 
void Name (string value)
 The name of the new Room More...
 
boost::shared_ptr< string > Password ()
 The password of the Room. If empty the Room will not be password protected More...
 
void Password (string value)
 The password of the Room. If empty the Room will not be password protected More...
 
bool IsGame ()
 Indicates if this is a Game Room More...
 
void IsGame (bool value)
 Indicates if this is a Game Room More...
 
short int MaxUsers ()
 The maximum number of users/players allowed in the Room More...
 
void MaxUsers (short int value)
 The maximum number of users/players allowed in the Room More...
 
short int MaxVariables ()
 The maximum number of Room Variables allowed for this Room More...
 
void MaxVariables (short int value)
 The maximum number of Room Variables allowed for this Room More...
 
short int MaxSpectators ()
 The maximum number of spectators allowed for this Room (only for Game Rooms) More...
 
void MaxSpectators (short int value)
 The maximum number of spectators allowed for this Room (only for Game Rooms) More...
 
boost::shared_ptr< vector< boost::shared_ptr< RoomVariable > > > Variables ()
 A list of Room Variables that should be attached to the newly created Room More...
 
void Variables (boost::shared_ptr< vector< boost::shared_ptr< RoomVariable > > > value)
 A list of Room Variables that should be attached to the newly created Room More...
 
boost::shared_ptr< RoomPermissionsPermissions ()
 The Room Permission settings of the new Room More...
 
void Permissions (boost::shared_ptr< RoomPermissions > value)
 The Room Permission settings of the new Room More...
 
boost::shared_ptr< RoomEventsEvents ()
 The Room Event settings of the new Room More...
 
void Events (boost::shared_ptr< RoomEvents > value)
 The Room Event settings of the new Room More...
 
boost::shared_ptr< RoomExtensionExtension ()
 The Extension settings for the new Room More...
 
void Extension (boost::shared_ptr< RoomExtension > value)
 The Extension settings for the new Room More...
 
boost::shared_ptr< string > GroupId ()
 The id of the Room Group in which the new Room should be created More...
 
void GroupId (string value)
 The id of the Room Group in which the new Room should be created More...
 
bool AllowOwnerOnlyInvitation ()
 Specifies if the Room allows "Join Room" invitations to be sent by any user or just by its owner. More...
 
void AllowOwnerOnlyInvitation (bool value)
 Specifies if the Room allows "Join Room" invitations to be sent by any user or just by its owner. More...
 

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.

Overview

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

Member Function Documentation

◆ InvitationExpiryTime() [1/2]

long int Sfs2X::Requests::Game::SFSGameSettings::InvitationExpiryTime ( )

The amount of time (in seconds) available for the User to reply to the invitation.

Suggested range 10-40 seconds

◆ InvitationExpiryTime() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::InvitationExpiryTime ( long int  value)

The amount of time (in seconds) available for the User to reply to the invitation.

Suggested range 10-40 seconds

◆ InvitationParams() [1/2]

boost::shared_ptr< ISFSObject > Sfs2X::Requests::Game::SFSGameSettings::InvitationParams ( )

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

◆ InvitationParams() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::InvitationParams ( boost::shared_ptr< ISFSObject value)

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

◆ InvitedPlayersBuddy() [1/2]

boost::shared_ptr< list< boost::shared_ptr< Buddy > > > Sfs2X::Requests::Game::SFSGameSettings::InvitedPlayersBuddy ( )

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

◆ InvitedPlayersBuddy() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::InvitedPlayersBuddy ( boost::shared_ptr< list< boost::shared_ptr< Buddy > > >  value)

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

◆ InvitedPlayersUser() [1/2]

boost::shared_ptr< list< boost::shared_ptr< User > > > Sfs2X::Requests::Game::SFSGameSettings::InvitedPlayersUser ( )

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

◆ InvitedPlayersUser() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::InvitedPlayersUser ( boost::shared_ptr< list< boost::shared_ptr< User > > >  value)

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

◆ IsPublic() [1/2]

bool Sfs2X::Requests::Game::SFSGameSettings::IsPublic ( )

Check if the Game is public or private

◆ IsPublic() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::IsPublic ( bool  value)

Check if the Game is public or private

◆ LeaveLastJoinedRoom() [1/2]

bool Sfs2X::Requests::Game::SFSGameSettings::LeaveLastJoinedRoom ( )

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

◆ LeaveLastJoinedRoom() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::LeaveLastJoinedRoom ( bool  value)

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

◆ MinPlayersToStartGame() [1/2]

long int Sfs2X::Requests::Game::SFSGameSettings::MinPlayersToStartGame ( )

The minimum number of players to start the Game

◆ MinPlayersToStartGame() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::MinPlayersToStartGame ( long int  value)

The minimum number of players to start the Game

◆ NotifyGameStarted() [1/2]

bool Sfs2X::Requests::Game::SFSGameSettings::NotifyGameStarted ( )

Uses a "reserved" global Room Variable to notify the started/stopped status of the game.

This depends on the number of Users inside the Room.

See also
Entities.Variables.SFSRoomVariable, Entities.Variables.ReservedRoomVariables

◆ NotifyGameStarted() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::NotifyGameStarted ( bool  value)

Uses a "reserved" global Room Variable to notify the started/stopped status of the game.

This depends on the number of Users inside the Room.

See also
Entities.Variables.SFSRoomVariable, Entities.Variables.ReservedRoomVariables

◆ PlayerMatchExpression() [1/2]

boost::shared_ptr< MatchExpression > Sfs2X::Requests::Game::SFSGameSettings::PlayerMatchExpression ( )

A MatchExpression for filtering Users joining the Game.

Recommended for public Games only

See also
MatchExpression

◆ PlayerMatchExpression() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::PlayerMatchExpression ( boost::shared_ptr< MatchExpression value)

A MatchExpression for filtering Users joining the Game.

Recommended for public Games only

See also
MatchExpression

◆ SearchableRooms() [1/2]

boost::shared_ptr< list< string > > Sfs2X::Requests::Game::SFSGameSettings::SearchableRooms ( )

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

◆ SearchableRooms() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::SearchableRooms ( boost::shared_ptr< list< string > >  value)

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

◆ SpectatorMatchExpression() [1/2]

boost::shared_ptr< MatchExpression > Sfs2X::Requests::Game::SFSGameSettings::SpectatorMatchExpression ( )

A MatchExpression for filtering Spectators joining the Game.

See also
MatchExpression

◆ SpectatorMatchExpression() [2/2]

void Sfs2X::Requests::Game::SFSGameSettings::SpectatorMatchExpression ( boost::shared_ptr< MatchExpression value)

A MatchExpression for filtering Spectators joining the Game.

See also
MatchExpression