Photon Quantum 3.0.0

Public Member Functions | Properties | List of all members
Photon.Deterministic.IDeterministicGame Interface Reference

The deterministic game interface is the main hub that holds information about the simulation on the Quantum.Deterministic level. More...

Inheritance diagram for Photon.Deterministic.IDeterministicGame:
Quantum.QuantumGame

Public Member Functions

void AssignSession (DeterministicSession session)
 The DeterministicSession creates this reference during its initialization. More...
 
DeterministicFrame CreateFrame (IDisposable context)
 Creates a new frame object using the context. More...
 
DeterministicFrame CreateFrame (IDisposable context, Byte[] data)
 Creates a new frame object using the context and external frame data. More...
 
IDisposable CreateFrameContext ()
 Creates a frame context in the beginning of the simulation. More...
 
void DeserializeInputInto (int player, byte[] data, byte *buffer, bool verified)
 Asks the game to de-serialize input into the buffers, because it's game specific it cannot be done from here. More...
 
byte[] GetExtraErrorFrameDumpData (DeterministicFrame frame)
 Creates information send to the server when detecting a checksum error. More...
 
Int32 GetInputInMemorySize ()
 Return the in memory input size. More...
 
Int32 GetInputSerializedFixedSize ()
 Returns the serialized input size. More...
 
DeterministicFrame GetVerifiedFrame (int tick)
 Try to get the verified frame for a given tick from the snapshot buffer. More...
 
void OnChecksumComputed (Int32 frame, ulong checksum)
 The callback is called when the local checksum was computed. More...
 
void OnChecksumError (DeterministicTickChecksumError error, DeterministicFrame[] frames)
 The callback is called when a checksum error was detected. More...
 
void OnChecksumErrorFrameDump (Int32 actorId, Int32 frameNumber, DeterministicSessionConfig sessionConfig, byte[] runtimeConfig, byte[] frameData, byte[] extraData)
 The callback is called when the clients receives a frame dump of another client from the server. More...
 
void OnDestroy ()
 The callback is called when the simulation is destroyed. More...
 
void OnGameEnded ()
 Not implemented. More...
 
void OnGameResync ()
 The callback is called when the game is starting from a snapshot after the snapshot has been received. More...
 
void OnGameStart (DeterministicFrame state)
 The callback is called when the actual simulation starts after the online protocol start sequence was successful. More...
 
void OnInputConfirmed (DeterministicFrameInputTemp input)
 The callback is called when an input object was confirmed by the server. More...
 
void OnInputSetConfirmed (Int32 tick, Int32 length, byte[] data)
 The callback is called when an input set (all clients) was confirmed by the server. More...
 
DeterministicFrameInputTemp OnLocalInput (Int32 frame, Int32 playerSlot)
 Polls the game for local input. More...
 
void OnLocalPlayerAddConfirmed (DeterministicFrame frame, int playerSlot, PlayerRef player)
 The callback is called when the server confirmed the addition of a (local) player. More...
 
void OnLocalPlayerAddFailed (int playerSlot, string message)
 The callback is called when the server failed to process the add player request. More...
 
void OnLocalPlayerRemoveConfirmed (DeterministicFrame frame, int playerSlot, PlayerRef player)
 The callback is called when the server confirmed the removal of a (local) player. More...
 
void OnLocalPlayerRemoveFailed (int playerSlot, string message)
 The callback is called when the server failed to process the remove player request. More...
 
void OnPluginDisconnect (string reason)
 The callback is called when the server plugin disconnected the client. More...
 
void OnSerializedInput (byte *encoded, Array dst)
 Asks the game to serialize the input, because it's game specific it cannot be done from here. More...
 
void OnSimulate (DeterministicFrame state)
 The callback is called when any simulation step was executed. More...
 
void OnSimulateFinished (DeterministicFrame state)
 The callback is called after any simulation step was executed and after the OnSimulate(DeterministicFrame) callback. More...
 
void OnSimulationBegin ()
 The callback is called before the session computes multiple simulation steps (frames). More...
 
void OnSimulationEnd ()
 The callback is called when multiple simulation steps (frames) were executed. More...
 
void OnUpdateDone ()
 The callback is called when when the session completed its DeterministicSession.Update loop. More...
 

Properties

DeterministicSession Session [get]
 Get the deterministic session. More...
 

Detailed Description

The deterministic game interface is the main hub that holds information about the simulation on the Quantum.Deterministic level.

Member Function Documentation

◆ GetInputSerializedFixedSize()

Int32 Photon.Deterministic.IDeterministicGame.GetInputSerializedFixedSize ( )

Returns the serialized input size.

Returns
Serialized input size

Implemented in Quantum.QuantumGame.

◆ GetInputInMemorySize()

Int32 Photon.Deterministic.IDeterministicGame.GetInputInMemorySize ( )

Return the in memory input size.

Returns
Input object size

Implemented in Quantum.QuantumGame.

◆ DeserializeInputInto()

void Photon.Deterministic.IDeterministicGame.DeserializeInputInto ( int  player,
byte[]  data,
byte *  buffer,
bool  verified 
)

Asks the game to de-serialize input into the buffers, because it's game specific it cannot be done from here.

Parameters
playerThe player the input is for
dataThe input data
bufferThe destination buffer
verifiedIs the input verified

Implemented in Quantum.QuantumGame.

◆ OnLocalInput()

DeterministicFrameInputTemp Photon.Deterministic.IDeterministicGame.OnLocalInput ( Int32  frame,
Int32  playerSlot 
)

Polls the game for local input.

Parameters
frameThe frame that the input is for
playerSlotThe player slot that is polling
Returns
The polled input

Implemented in Quantum.QuantumGame.

◆ OnSerializedInput()

void Photon.Deterministic.IDeterministicGame.OnSerializedInput ( byte *  encoded,
Array  dst 
)

Asks the game to serialize the input, because it's game specific it cannot be done from here.

Parameters
encoded
dst

Implemented in Quantum.QuantumGame.

◆ CreateFrameContext()

IDisposable Photon.Deterministic.IDeterministicGame.CreateFrameContext ( )

Creates a frame context in the beginning of the simulation.

Returns
Frame context.

Implemented in Quantum.QuantumGame.

◆ CreateFrame() [1/2]

DeterministicFrame Photon.Deterministic.IDeterministicGame.CreateFrame ( IDisposable  context)

Creates a new frame object using the context.

Parameters
contextFrame context
Returns
Frame object

◆ CreateFrame() [2/2]

DeterministicFrame Photon.Deterministic.IDeterministicGame.CreateFrame ( IDisposable  context,
Byte[]  data 
)

Creates a new frame object using the context and external frame data.

Parameters
contextFrame context
data
Returns

◆ GetVerifiedFrame()

DeterministicFrame Photon.Deterministic.IDeterministicGame.GetVerifiedFrame ( int  tick)

Try to get the verified frame for a given tick from the snapshot buffer.

Parameters
tickRequested tick
Returns
The frame object or null

Implemented in Quantum.QuantumGame.

◆ GetExtraErrorFrameDumpData()

byte [] Photon.Deterministic.IDeterministicGame.GetExtraErrorFrameDumpData ( DeterministicFrame  frame)

Creates information send to the server when detecting a checksum error.

Parameters
frameFrame
Returns
Serialized frame dump context

Implemented in Quantum.QuantumGame.

◆ OnDestroy()

void Photon.Deterministic.IDeterministicGame.OnDestroy ( )

The callback is called when the simulation is destroyed.

Implemented in Quantum.QuantumGame.

◆ AssignSession()

void Photon.Deterministic.IDeterministicGame.AssignSession ( DeterministicSession  session)

The DeterministicSession creates this reference during its initialization.

Parameters
sessionDeterministic session that this game uses

Implemented in Quantum.QuantumGame.

◆ OnGameStart()

void Photon.Deterministic.IDeterministicGame.OnGameStart ( DeterministicFrame  state)

The callback is called when the actual simulation starts after the online protocol start sequence was successful.

Parameters
stateIntitial deterministic frame

Implemented in Quantum.QuantumGame.

◆ OnGameResync()

void Photon.Deterministic.IDeterministicGame.OnGameResync ( )

The callback is called when the game is starting from a snapshot after the snapshot has been received.

Implemented in Quantum.QuantumGame.

◆ OnGameEnded()

void Photon.Deterministic.IDeterministicGame.OnGameEnded ( )

Not implemented.

Implemented in Quantum.QuantumGame.

◆ OnSimulate()

void Photon.Deterministic.IDeterministicGame.OnSimulate ( DeterministicFrame  state)

The callback is called when any simulation step was executed.

Parameters
stateFrame that was simulated

Implemented in Quantum.QuantumGame.

◆ OnSimulateFinished()

void Photon.Deterministic.IDeterministicGame.OnSimulateFinished ( DeterministicFrame  state)

The callback is called after any simulation step was executed and after the OnSimulate(DeterministicFrame) callback.

Parameters
stateFrame that was simulated

Implemented in Quantum.QuantumGame.

◆ OnUpdateDone()

void Photon.Deterministic.IDeterministicGame.OnUpdateDone ( )

The callback is called when when the session completed its DeterministicSession.Update loop.

Implemented in Quantum.QuantumGame.

◆ OnChecksumError()

void Photon.Deterministic.IDeterministicGame.OnChecksumError ( DeterministicTickChecksumError  error,
DeterministicFrame[]  frames 
)

The callback is called when a checksum error was detected.

Parameters
errorChecksum error information
framesContains the verified frame that was failed to validate

Implemented in Quantum.QuantumGame.

◆ OnChecksumErrorFrameDump()

void Photon.Deterministic.IDeterministicGame.OnChecksumErrorFrameDump ( Int32  actorId,
Int32  frameNumber,
DeterministicSessionConfig  sessionConfig,
byte[]  runtimeConfig,
byte[]  frameData,
byte[]  extraData 
)

The callback is called when the clients receives a frame dump of another client from the server.

Parameters
actorIdThe Photon actor id that the dump belongs to
frameNumberThe frame number of the dump
sessionConfigThe session config
runtimeConfigThe runtime config
frameDataThe frame data
extraDataExtra dump meta information

◆ OnInputConfirmed()

void Photon.Deterministic.IDeterministicGame.OnInputConfirmed ( DeterministicFrameInputTemp  input)

The callback is called when an input object was confirmed by the server.

Parameters
inputInput object

Implemented in Quantum.QuantumGame.

◆ OnInputSetConfirmed()

void Photon.Deterministic.IDeterministicGame.OnInputSetConfirmed ( Int32  tick,
Int32  length,
byte[]  data 
)

The callback is called when an input set (all clients) was confirmed by the server.

Parameters
tickTick
lengthLength of input object array
dataInput objects

◆ OnChecksumComputed()

void Photon.Deterministic.IDeterministicGame.OnChecksumComputed ( Int32  frame,
ulong  checksum 
)

The callback is called when the local checksum was computed.

Parameters
frameThe frame the checksum belongs to
checksumThe checksum that will be send to the server

Implemented in Quantum.QuantumGame.

◆ OnSimulationBegin()

void Photon.Deterministic.IDeterministicGame.OnSimulationBegin ( )

The callback is called before the session computes multiple simulation steps (frames).

Implemented in Quantum.QuantumGame.

◆ OnSimulationEnd()

void Photon.Deterministic.IDeterministicGame.OnSimulationEnd ( )

The callback is called when multiple simulation steps (frames) were executed.

Implemented in Quantum.QuantumGame.

◆ OnPluginDisconnect()

void Photon.Deterministic.IDeterministicGame.OnPluginDisconnect ( string  reason)

The callback is called when the server plugin disconnected the client.

Parameters
reasonDebug string

Implemented in Quantum.QuantumGame.

◆ OnLocalPlayerAddConfirmed()

void Photon.Deterministic.IDeterministicGame.OnLocalPlayerAddConfirmed ( DeterministicFrame  frame,
int  playerSlot,
PlayerRef  player 
)

The callback is called when the server confirmed the addition of a (local) player.

Parameters
frameThe frame the player has been added
playerSlotThe player slot that was used to assign the player
playerThe player

Implemented in Quantum.QuantumGame.

◆ OnLocalPlayerRemoveConfirmed()

void Photon.Deterministic.IDeterministicGame.OnLocalPlayerRemoveConfirmed ( DeterministicFrame  frame,
int  playerSlot,
PlayerRef  player 
)

The callback is called when the server confirmed the removal of a (local) player.

Parameters
frameThe frame when the request was confirmed
playerSlotThe player slot of the removed player
playerThe player that was removed

Implemented in Quantum.QuantumGame.

◆ OnLocalPlayerAddFailed()

void Photon.Deterministic.IDeterministicGame.OnLocalPlayerAddFailed ( int  playerSlot,
string  message 
)

The callback is called when the server failed to process the add player request.

Parameters
playerSlotThe player slot that was requested
messageDebug message

Implemented in Quantum.QuantumGame.

◆ OnLocalPlayerRemoveFailed()

void Photon.Deterministic.IDeterministicGame.OnLocalPlayerRemoveFailed ( int  playerSlot,
string  message 
)

The callback is called when the server failed to process the remove player request.

Parameters
playerSlotThe player slot that was tried to remove
messageDebug message

Implemented in Quantum.QuantumGame.

Property Documentation

◆ Session

DeterministicSession Photon.Deterministic.IDeterministicGame.Session
get

Get the deterministic session.