Override this class and implement its virtual methods to hook into the Quantum server callbacks. More...
Public Member Functions | |
bool | CanSendInput (Int32 player, int tick) |
Prevent sending input for slots that just disconnected (previous player) More... | |
void | DisconnectClient (DeterministicPluginClient client, String message) |
Disconnect a client. More... | |
ICollection< Int32 > | GetActorIds () |
Retrieve a collection of all actor ids. More... | |
Int32 | GetClientActorId (int playerIndex) |
Map a player index to an actor id. More... | |
Int32 | GetClientActorId (String clientId) |
Map a client id to an Photon actor id. More... | |
DeterministicPluginClient | GetClientForActor (Int32 actorNr) |
Retrieve the client object by actor number. More... | |
void | GetClientIds (List< string > clientIds) |
Retrieve a list of all client ids. More... | |
Boolean | IsRealPlayer (Int32 index) |
Check if the player index is valid and has or ever had a client connected. More... | |
Int32 | MaxPing () |
Get the largest ping (Rtt) of all players. More... | |
virtual void | OnDeterministicClientJoinedSession (DeterministicPluginClient client) |
Is called after the client joined the session and player slots have been assigned. This callback subsequentially follows OnDeterministicClientJoinRequestSession(DeterministicPluginClient, Join). More... | |
virtual Boolean | OnDeterministicClientJoinRequestSession (DeterministicPluginClient client, Join joinData) |
Is called before a client is permitted to join the session. More... | |
virtual Boolean | OnDeterministicCommand (DeterministicPluginClient client, Command cmd) |
Is called before a player command is fed to the simulation. More... | |
virtual void | OnDeterministicInputConfirmed (DeterministicPluginClient client, Int32 tick, Int32 playerIndex, DeterministicTickInput input) |
Is called when input for a client and tick is confirmed. More... | |
virtual void | OnDeterministicInputReceived (DeterministicPluginClient client, DeterministicTickInput input) |
Is called then input is received from a client (input is still acceptable based on the time) and also when the server generated the input. More... | |
virtual ? int | OnDeterministicLateStart (DeterministicPluginClient client, SimulationStart startData) |
Is called when the late-joining or reconnecting client is about to receive the simulation start event. More... | |
virtual Boolean | OnDeterministicPlayerDataSet (DeterministicPluginClient client, SetPlayerData playerData) |
Is called before runtime player data for a client is processed. The serialized runtime player data can be changed this way: More... | |
virtual void | OnDeterministicRuntimeConfig (DeterministicPluginClient client, RuntimeConfig configData) |
The RuntimeConfig is sent by the clients. First come, first serve. This method is called (once per session) before the runtime config is applied. Check of modify values here. Deserialize and serialize the modified data to RuntimeConfig.Config. More... | |
virtual Boolean | OnDeterministicServerInput (DeterministicTickInput input) |
Override to set the input data for a server controlled player. Tick and player index have already been set on the input object. DeterministicInputFlags.PlayerNotPresent is always applied to to the input.Flags after this callback. More... | |
virtual void | OnDeterministicServerReplacedInput (DeterministicTickInput input) |
Is called when the input for a real player has been replaced by the server. More... | |
virtual void | OnDeterministicSessionConfig (DeterministicPluginClient client, SessionConfig configData) |
Is called before a DeterministicSessionConfig that was sent by a client is applied to the simulation. Deserialize and serialize SessionConfig.Config to modify the content. More... | |
virtual Boolean | OnDeterministicSnapshotRequested (ref Int32 tick, ref byte[] data) |
When client request a shapshots this method is called before the request is forwarded to other clients. This gives the opportunity, if the server runs the simulation itself, to send the snapshot directly to the client. More... | |
virtual void | OnDeterministicStartSession () |
Is called when the simulation has been started. More... | |
virtual void | OnDeterministicUpdate () |
Is called during each update tick after the input has been processed. More... | |
void | SendDeterministicCommand (Command command) |
Call this method to inject a command into the simulation from the server. More... | |
void | SetDeterministicPlayerData (SetPlayerData playerData) |
Call this method to continue the interupted flow of OnDeterministicPlayerDataSet(DeterministicPluginClient, SetPlayerData). The original client sender is encoded playerData.Index. More... | |
void | SetDeterministicRuntimeConfig (Byte[] configData) |
Usually the RuntimeConfig object (from the simulation code project) is sent by the clients. First come, first serve. Use this method to set if from the server for modifications or more protection. Session need to be in DeterministicPluginSessionState.Idle state. More... | |
void | SetDeterministicSessionConfig (DeterministicSessionConfig config) |
Usually the DeterministicSessionConfig is sent by the clients. First come, first serve. Call this method to set it from the server for more protection. Session need to be in DeterministicPluginSessionState.Idle state. More... | |
void | SetGameConfigs (byte[] runtimeConfig, object sessionConfig, bool sessionConfigPlayerCountIsVariable=false) |
Sets the game configs used for the session. This method is used to set the SessionConfig from the dashboard. Will not overwrite configs that were set by other means before. OnDeterministicSessionConfig(DeterministicPluginClient, Protocol.SessionConfig) will not be called once the SessionConfig has been set by this. More... | |
Properties | |
Int32 | ClientCount [get] |
Corresponds to the room size. More... | |
Int32 | PlayerCount [get] |
Quantum player count as set in DeterministicSessionConfig.PlayerCount More... | |
IHost | PluginHost [get] |
Access the plugin host object More... | |
DeterministicPluginSession | Session [get] |
Access the current running session. More... | |
bool | SkipFixedInputSizeValidation [get, set] |
If fixed input is used the server normally validates input send by clients and disconnects them on errors. This can disabled by setting this bool. More... | |
Override this class and implement its virtual methods to hook into the Quantum server callbacks.
|
inlinevirtual |
Is called before runtime player data for a client is processed. The serialized runtime player data can be changed this way:
It is possible to return false to stop the processing, send an asynchronous HTTP request (USE PHOTON HTTP API) to another backend and continue the player data processing later by calling SetDeterministicPlayerData(SetPlayerData). Cache the playerData while waiting for the request answer. The sender is encoded inside the message itself, so no need to cache the client object.
client | Client object |
playerData | Player data message |
|
inlinevirtual |
When client request a shapshots this method is called before the request is forwarded to other clients. This gives the opportunity, if the server runs the simulation itself, to send the snapshot directly to the client.
tick | The tick of the snapshot |
data | The serialized snapshot |
|
inlinevirtual |
Is called before a player command is fed to the simulation.
client | Client that sent the command |
cmd | Command object |
|
inline |
Call this method to continue the interupted flow of OnDeterministicPlayerDataSet(DeterministicPluginClient, SetPlayerData). The original client sender is encoded playerData.Index.
playerData | SetPlayerData message with a serialized RuntimePlayer object |
|
inline |
Call this method to inject a command into the simulation from the server.
command | Command object |
|
inlinevirtual |
Is called before a client is permitted to join the session.
client | Client object |
joinData | Join message data |
|
inlinevirtual |
Is called after the client joined the session and player slots have been assigned. This callback subsequentially follows OnDeterministicClientJoinRequestSession(DeterministicPluginClient, Join).
client | Client object |
|
inlinevirtual |
Is called before a DeterministicSessionConfig that was sent by a client is applied to the simulation. Deserialize and serialize SessionConfig.Config to modify the content.
client | Client object |
configData | Protocol message with encoded DeterministicSessionConfig |
|
inlinevirtual |
The RuntimeConfig is sent by the clients. First come, first serve. This method is called (once per session) before the runtime config is applied. Check of modify values here. Deserialize and serialize the modified data to RuntimeConfig.Config.
client | Client object |
configData | Serialized runtime config |
|
inlinevirtual |
Is called when the late-joining or reconnecting client is about to receive the simulation start event.
client | Client object |
startData | SimulationStart message include serialized runtime config |
|
inline |
Usually the DeterministicSessionConfig is sent by the clients. First come, first serve. Call this method to set it from the server for more protection. Session need to be in DeterministicPluginSessionState.Idle state.
config | Deterministic config |
|
inline |
Usually the RuntimeConfig object (from the simulation code project) is sent by the clients. First come, first serve. Use this method to set if from the server for modifications or more protection. Session need to be in DeterministicPluginSessionState.Idle state.
configData |
|
inlinevirtual |
Is called then input is received from a client (input is still acceptable based on the time) and also when the server generated the input.
client | Client object |
input | Input object |
|
inlinevirtual |
Is called when input for a client and tick is confirmed.
client | Client object |
tick | The input tick |
playerIndex | Player index |
input | Input object |
|
inlinevirtual |
Override to set the input data for a server controlled player. Tick and player index have already been set on the input object. DeterministicInputFlags.PlayerNotPresent is always applied to to the input.Flags after this callback.
input | Input data |
|
inlinevirtual |
Is called when the simulation has been started.
|
inlinevirtual |
Is called when the input for a real player has been replaced by the server.
input | Input object |
|
inlinevirtual |
Is called during each update tick after the input has been processed.
|
inline |
Get the largest ping (Rtt) of all players.
|
inline |
Disconnect a client.
client | Client object |
message | Disconnect message |
|
inline |
Retrieve a list of all client ids.
clientIds | List that is filled with DeterministicPluginClient.ClientId |
|
inline |
Retrieve a collection of all actor ids.
|
inline |
Map a client id to an Photon actor id.
clientId | Client id |
|
inline |
Map a player index to an actor id.
playerIndex |
|
inline |
Check if the player index is valid and has or ever had a client connected.
index | Player index |
|
inline |
Prevent sending input for slots that just disconnected (previous player)
|
inline |
Retrieve the client object by actor number.
actorNr | Actor id |
|
inline |
Sets the game configs used for the session. This method is used to set the SessionConfig from the dashboard. Will not overwrite configs that were set by other means before. OnDeterministicSessionConfig(DeterministicPluginClient, Protocol.SessionConfig) will not be called once the SessionConfig has been set by this.
runtimeConfig | Binary RuntimePlayer |
sessionConfig | SessionConfig as object (original type has to be DeterministicSessionConfig) |
sessionConfigPlayerCountIsVariable | PlayerCount from SessionConfig is considered to me the min possible and clients can set higher values. |
|
get |
Corresponds to the room size.
|
get |
Quantum player count as set in DeterministicSessionConfig.PlayerCount
|
get |
Access the current running session.
|
getset |
If fixed input is used the server normally validates input send by clients and disconnects them on errors. This can disabled by setting this bool.
|
get |
Access the plugin host object