Photon Server API Documentation v5.0RC1

Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Properties | List of all members
Photon.LoadBalancing.MasterServer.Lobby.GameState Class Reference

Classes

class  ExpiryInfo
 

Public Member Functions

 GameState (AppLobby lobby, string id, byte maxPlayer, GameServerContext gsContext)
 Initializes a new instance of the GameState class. More...
 
 GameState (AppLobby lobby, Hashtable data)
 
void AddPeer (ILobbyPeer peer)
 
void CheckJoinTimeOuts (DateTime minDateTime)
 
string GetUserListsAsString ()
 
void ResetGameServer ()
 
string GetServerAddress (ILobbyPeer peer)
 
bool MatchGameProperties (Hashtable matchProperties)
 
Hashtable ToHashTable ()
 
bool TrySetProperties (Hashtable gameProperties, out bool changed, out string debugMessage)
 
bool SupportsProtocol (NetworkProtocolType networkProtocol)
 
bool Update (UpdateGameEvent updateEvent)
 
void AddPlayerToWaitList (MasterClientPeer peer, JoinGameRequest operation)
 
void OnRemoved ()
 
override string ToString ()
 
string GetDebugData ()
 
bool ContainsUser (string userId)
 
bool IsUserInExcludeList (string userId)
 
bool IsUserExpected (string userId)
 
bool CheckSlots (string userId, string[] expectedUsers)
 
bool CheckSlots (string userId, string[] expectedUsers, out string errMsg)
 
void AddSlots (JoinGameRequest request)
 

Public Attributes

readonly AppLobby Lobby
 
bool ShouldBePreservedInList => this.IsPersistent && this.InactivePlayerCount > 0 && this.Lobby.LobbyType == AppLobbyType.AsyncRandomLobby
 

Static Public Attributes

const byte GameId = 0
 
const byte InactiveCountId = 1
 
const byte CreateDateId = 2
 
const byte UserListId = 3
 
const byte PropertiesId = 4
 
const byte IsVisibleId = 5
 
const byte IsOpenId = 6
 
const byte MaxPlayerId = 7
 
const byte LobbyNameId = 8
 
const byte LobbyTypeId = 9
 
const byte InactiveUsersId = 10
 
const byte ExcludedUsersId = 11
 
const byte ExpectedUsersId = 12
 

Protected Attributes

readonly DateTime createDateUtc = DateTime.UtcNow
 

Properties

DateTime CreateDateUtc [get]
 
GameServerContext GameServer [get]
 Gets the context of the game server on which the game is or should be created. More...
 
int GameServerPlayerCount [get]
 Gets the number of players who joined the game on the game server. More...
 
string Id [get]
 Gets the game id. More...
 
List< DeferredUserWaitList = new List<DeferredUser>() [get]
 
int InactivePlayerCount [get]
 
bool HasBeenCreatedOnGameServer [get, set]
 Gets or sets a value indicating whether the game is created on a game server instance. More...
 
bool IsOpen [get, set]
 Gets or sets a value indicating whether the game is open for players to join the game. More...
 
bool IsPersistent [get, set]
 
bool IsVisbleInLobby [get]
 Gets a value indicating whether this instance is visble in the lobby. More...
 
bool IsVisible [get, set]
 Gets or sets a value indicating whether the game should be visible to other players. More...
 
int JoiningPlayerCount [get]
 Gets the number of players currently joining the game. More...
 
byte MaxPlayer [get, set]
 Gets or sets the maximum number of player for the game. More...
 
int PlayerCount [get]
 Gets the number of players joined the game. More...
 
int YetExpectedUsersCount [get]
 
Dictionary< object, object > Properties = new Dictionary<object, object>() [get]
 
bool IsJoinable [get]
 
bool CheckUserIdOnJoin [get]
 
List< ExcludedActorInfoExcludedActors [get]
 
DataContract CreateRequest [get, set]
 
bool ExpectsReplication [get, set]
 

Constructor & Destructor Documentation

◆ GameState() [1/2]

Photon.LoadBalancing.MasterServer.Lobby.GameState.GameState ( AppLobby  lobby,
string  id,
byte  maxPlayer,
GameServerContext  gsContext 
)
inline

Initializes a new instance of the GameState class.

Parameters
lobbyThe lobby to which the game belongs.
idThe game id.
maxPlayerThe maximum number of player who can join the game.
gsContextThe game server peer.

◆ GameState() [2/2]

Photon.LoadBalancing.MasterServer.Lobby.GameState.GameState ( AppLobby  lobby,
Hashtable  data 
)
inline

Member Function Documentation

◆ AddPeer()

void Photon.LoadBalancing.MasterServer.Lobby.GameState.AddPeer ( ILobbyPeer  peer)
inline

◆ AddPlayerToWaitList()

void Photon.LoadBalancing.MasterServer.Lobby.GameState.AddPlayerToWaitList ( MasterClientPeer  peer,
JoinGameRequest  operation 
)
inline

◆ AddSlots()

void Photon.LoadBalancing.MasterServer.Lobby.GameState.AddSlots ( JoinGameRequest  request)
inline

◆ CheckJoinTimeOuts()

void Photon.LoadBalancing.MasterServer.Lobby.GameState.CheckJoinTimeOuts ( DateTime  minDateTime)
inline

◆ CheckSlots() [1/2]

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.CheckSlots ( string  userId,
string[]  expectedUsers 
)
inline

◆ CheckSlots() [2/2]

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.CheckSlots ( string  userId,
string[]  expectedUsers,
out string  errMsg 
)
inline

◆ ContainsUser()

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.ContainsUser ( string  userId)
inline

◆ GetDebugData()

string Photon.LoadBalancing.MasterServer.Lobby.GameState.GetDebugData ( )
inline

◆ GetServerAddress()

string Photon.LoadBalancing.MasterServer.Lobby.GameState.GetServerAddress ( ILobbyPeer  peer)
inline

◆ GetUserListsAsString()

string Photon.LoadBalancing.MasterServer.Lobby.GameState.GetUserListsAsString ( )
inline

◆ IsUserExpected()

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.IsUserExpected ( string  userId)
inline

◆ IsUserInExcludeList()

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.IsUserInExcludeList ( string  userId)
inline

◆ MatchGameProperties()

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.MatchGameProperties ( Hashtable  matchProperties)
inline

◆ OnRemoved()

void Photon.LoadBalancing.MasterServer.Lobby.GameState.OnRemoved ( )
inline

◆ ResetGameServer()

void Photon.LoadBalancing.MasterServer.Lobby.GameState.ResetGameServer ( )
inline

◆ SupportsProtocol()

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.SupportsProtocol ( NetworkProtocolType  networkProtocol)
inline

◆ ToHashTable()

Hashtable Photon.LoadBalancing.MasterServer.Lobby.GameState.ToHashTable ( )
inline

◆ ToString()

override string Photon.LoadBalancing.MasterServer.Lobby.GameState.ToString ( )
inline

◆ TrySetProperties()

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.TrySetProperties ( Hashtable  gameProperties,
out bool  changed,
out string  debugMessage 
)
inline

◆ Update()

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.Update ( UpdateGameEvent  updateEvent)
inline

Member Data Documentation

◆ CreateDateId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.CreateDateId = 2
static

◆ createDateUtc

readonly DateTime Photon.LoadBalancing.MasterServer.Lobby.GameState.createDateUtc = DateTime.UtcNow
protected

◆ ExcludedUsersId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.ExcludedUsersId = 11
static

◆ ExpectedUsersId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.ExpectedUsersId = 12
static

◆ GameId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.GameId = 0
static

◆ InactiveCountId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.InactiveCountId = 1
static

◆ InactiveUsersId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.InactiveUsersId = 10
static

◆ IsOpenId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.IsOpenId = 6
static

◆ IsVisibleId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.IsVisibleId = 5
static

◆ Lobby

readonly AppLobby Photon.LoadBalancing.MasterServer.Lobby.GameState.Lobby

◆ LobbyNameId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.LobbyNameId = 8
static

◆ LobbyTypeId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.LobbyTypeId = 9
static

◆ MaxPlayerId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.MaxPlayerId = 7
static

◆ PropertiesId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.PropertiesId = 4
static

◆ ShouldBePreservedInList

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.ShouldBePreservedInList => this.IsPersistent && this.InactivePlayerCount > 0 && this.Lobby.LobbyType == AppLobbyType.AsyncRandomLobby

◆ UserListId

const byte Photon.LoadBalancing.MasterServer.Lobby.GameState.UserListId = 3
static

Property Documentation

◆ CheckUserIdOnJoin

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.CheckUserIdOnJoin
get

◆ CreateDateUtc

DateTime Photon.LoadBalancing.MasterServer.Lobby.GameState.CreateDateUtc
get

◆ CreateRequest

DataContract Photon.LoadBalancing.MasterServer.Lobby.GameState.CreateRequest
getset

◆ ExcludedActors

List<ExcludedActorInfo> Photon.LoadBalancing.MasterServer.Lobby.GameState.ExcludedActors
get

◆ ExpectsReplication

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.ExpectsReplication
getset

◆ GameServer

GameServerContext Photon.LoadBalancing.MasterServer.Lobby.GameState.GameServer
get

Gets the context of the game server on which the game is or should be created.

◆ GameServerPlayerCount

int Photon.LoadBalancing.MasterServer.Lobby.GameState.GameServerPlayerCount
get

Gets the number of players who joined the game on the game server.

◆ HasBeenCreatedOnGameServer

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.HasBeenCreatedOnGameServer
getset

Gets or sets a value indicating whether the game is created on a game server instance.

true if this instance is created on game server; otherwise, false.

◆ Id

string Photon.LoadBalancing.MasterServer.Lobby.GameState.Id
get

Gets the game id.

◆ InactivePlayerCount

int Photon.LoadBalancing.MasterServer.Lobby.GameState.InactivePlayerCount
get

◆ IsJoinable

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.IsJoinable
get

◆ IsOpen

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.IsOpen
getset

Gets or sets a value indicating whether the game is open for players to join the game.

true if the game is open; otherwise, false.

◆ IsPersistent

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.IsPersistent
getset

◆ IsVisbleInLobby

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.IsVisbleInLobby
get

Gets a value indicating whether this instance is visble in the lobby.

true if this instance is visble in lobby; otherwise, false.

◆ IsVisible

bool Photon.LoadBalancing.MasterServer.Lobby.GameState.IsVisible
getset

Gets or sets a value indicating whether the game should be visible to other players.

true if the game is visible; otherwise, false.

◆ JoiningPlayerCount

int Photon.LoadBalancing.MasterServer.Lobby.GameState.JoiningPlayerCount
get

Gets the number of players currently joining the game.

◆ MaxPlayer

byte Photon.LoadBalancing.MasterServer.Lobby.GameState.MaxPlayer
getset

Gets or sets the maximum number of player for the game.

◆ PlayerCount

int Photon.LoadBalancing.MasterServer.Lobby.GameState.PlayerCount
get

Gets the number of players joined the game.

◆ Properties

Dictionary<object, object> Photon.LoadBalancing.MasterServer.Lobby.GameState.Properties = new Dictionary<object, object>()
get

◆ WaitList

List<DeferredUser> Photon.LoadBalancing.MasterServer.Lobby.GameState.WaitList = new List<DeferredUser>()
get

◆ YetExpectedUsersCount

int Photon.LoadBalancing.MasterServer.Lobby.GameState.YetExpectedUsersCount
get