Quantum 3 3.0.4

Public Member Functions | Public Attributes | Properties | List of all members
Photon.Deterministic.Server.DeterministicPluginClient Class Reference

The client representation in the Quantum server plugin. More...

Public Member Functions

bool HasPlayer (PlayerRef player)
 Check if the client has the player index assigned. More...
 

Public Attributes

Boolean Active => Joined && WaitingForSnapshot == false && DisconnectTime.HasValue == false
 Client has joined, is not waiting for snapshots (anymore) and has not been disconnected. More...
 
Int32 ActorNr
 The Photon Realtime client index (Actor) is assigned by the server after the client has joined a room. The room is always ActorNr 0 and client the client numbering start with 1. The server always increments the number over the lifetime of the room. Clients that successfully RejoinAndReconnect() will receive the same ActorNr. More...
 
String DisconnectMessage
 The disconnect reason set from the server when disconnecting this client Photon.Deterministic.Server.ErrorStrings. More...
 
Double? DisconnectTime
 Will be set to DeterministicPluginSession.GetTimerSeconds() + 1 when disconnecting the player. This is also marks the client as disconnected in a few places. More...
 
Boolean Joined => ClientId != null
 Has the player sent the join message and has it been processed and a ClientId was set. More...
 
List< PlayerRefPlayers => _playerMap.Players
 The global players this client controls. More...
 
int PlayerSlotsCount => _playerMap.Count
 Number of player slots this client owns. More...
 
Queue< Protocol.MessageProtocolSendQueue
 Enqueue protocol messages which are sent to the client. More...
 
Int32 Rtt
 Last received round trip time for this client by Photon.Deterministic.Protocol.RttUpdate. More...
 
byte[] RuntimePlayer
 If this is set, it will overwrite the runtime player send by the client. More...
 
bool SnapshotsBlocked
 This client is not selected to send snapshots to other player while there are other choices. Has to be set during OnDeterministicStartRequest(). Will be overwritten during Join webhook response. More...
 
Boolean Spectator => Joined && _playerMap.Count == 0
 Is the client a spectator. Spectators have no player slots and can not send any input or commands. More...
 
Object UserToken
 Attach any data you want to the client. For example something you want to cache while waiting for a HTTP response. More...
 
Boolean WaitingForSnapshot
 This client is connected but is waiting for a snapshot to be send by either other clients or the server. More...
 
Int32 WaitingForSnapshotTimeoutTick
 The tick when waiting for snapshots will time out and the client will be disconnected. More...
 

Properties

String ClientId [get]
 Client id is a secret between the client and the server. The client creates this id and other clients do not know this id. It is used to match reconnecting player so they receive the same player index. More...
 
int MaxPlayerSlots [get, set]
 The maximum number of player slots this client can request. -1 = unlimited. Is initialized by webhook CreateGame and Join responses. More...
 
String UserId [get, set]
 The Photon user Id for this client. More...
 

Detailed Description

The client representation in the Quantum server plugin.

Member Function Documentation

◆ HasPlayer()

bool Photon.Deterministic.Server.DeterministicPluginClient.HasPlayer ( PlayerRef  player)
inline

Check if the client has the player index assigned.

Parameters
playerPlayer index
Returns
true if the client has the player index assigned.

Member Data Documentation

◆ Rtt

Int32 Photon.Deterministic.Server.DeterministicPluginClient.Rtt

Last received round trip time for this client by Photon.Deterministic.Protocol.RttUpdate.

◆ ActorNr

Int32 Photon.Deterministic.Server.DeterministicPluginClient.ActorNr

The Photon Realtime client index (Actor) is assigned by the server after the client has joined a room. The room is always ActorNr 0 and client the client numbering start with 1. The server always increments the number over the lifetime of the room. Clients that successfully RejoinAndReconnect() will receive the same ActorNr.

◆ WaitingForSnapshot

Boolean Photon.Deterministic.Server.DeterministicPluginClient.WaitingForSnapshot

This client is connected but is waiting for a snapshot to be send by either other clients or the server.

◆ WaitingForSnapshotTimeoutTick

Int32 Photon.Deterministic.Server.DeterministicPluginClient.WaitingForSnapshotTimeoutTick

The tick when waiting for snapshots will time out and the client will be disconnected.

◆ UserToken

Object Photon.Deterministic.Server.DeterministicPluginClient.UserToken

Attach any data you want to the client. For example something you want to cache while waiting for a HTTP response.

◆ DisconnectTime

Double? Photon.Deterministic.Server.DeterministicPluginClient.DisconnectTime

Will be set to DeterministicPluginSession.GetTimerSeconds() + 1 when disconnecting the player. This is also marks the client as disconnected in a few places.

◆ DisconnectMessage

String Photon.Deterministic.Server.DeterministicPluginClient.DisconnectMessage

The disconnect reason set from the server when disconnecting this client Photon.Deterministic.Server.ErrorStrings.

◆ Players

List<PlayerRef> Photon.Deterministic.Server.DeterministicPluginClient.Players => _playerMap.Players

The global players this client controls.

◆ PlayerSlotsCount

int Photon.Deterministic.Server.DeterministicPluginClient.PlayerSlotsCount => _playerMap.Count

Number of player slots this client owns.

◆ SnapshotsBlocked

bool Photon.Deterministic.Server.DeterministicPluginClient.SnapshotsBlocked

This client is not selected to send snapshots to other player while there are other choices. Has to be set during OnDeterministicStartRequest(). Will be overwritten during Join webhook response.

◆ ProtocolSendQueue

Queue<Protocol.Message> Photon.Deterministic.Server.DeterministicPluginClient.ProtocolSendQueue

Enqueue protocol messages which are sent to the client.

◆ RuntimePlayer

byte [] Photon.Deterministic.Server.DeterministicPluginClient.RuntimePlayer

If this is set, it will overwrite the runtime player send by the client.

◆ Joined

Boolean Photon.Deterministic.Server.DeterministicPluginClient.Joined => ClientId != null

Has the player sent the join message and has it been processed and a ClientId was set.

◆ Active

Boolean Photon.Deterministic.Server.DeterministicPluginClient.Active => Joined && WaitingForSnapshot == false && DisconnectTime.HasValue == false

Client has joined, is not waiting for snapshots (anymore) and has not been disconnected.

◆ Spectator

Boolean Photon.Deterministic.Server.DeterministicPluginClient.Spectator => Joined && _playerMap.Count == 0

Is the client a spectator. Spectators have no player slots and can not send any input or commands.

Property Documentation

◆ ClientId

String Photon.Deterministic.Server.DeterministicPluginClient.ClientId
get

Client id is a secret between the client and the server. The client creates this id and other clients do not know this id. It is used to match reconnecting player so they receive the same player index.

◆ UserId

String Photon.Deterministic.Server.DeterministicPluginClient.UserId
getset

The Photon user Id for this client.

◆ MaxPlayerSlots

int Photon.Deterministic.Server.DeterministicPluginClient.MaxPlayerSlots
getset

The maximum number of player slots this client can request. -1 = unlimited. Is initialized by webhook CreateGame and Join responses.