Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Quantum.SessionRunner.Arguments Struct Reference

Arguments to start an online or offline Quantum simulation. More...

Public Member Functions

void Validate ()
 Validate, log warnings and throw exceptions on errors. More...
 

Static Public Member Functions

static Arguments CreateDefault ()
 Initializes struct with default values. More...
 

Public Attributes

CancellationToken CancellationToken
 A cancellation token to stop all async tasks (only used during StartAsync()). More...
 
string ClientId
 The Quantum ClientId is a secret between the client and the server and is used when reconnecting into a running simulation to preserve the player index. More...
 
ICommunicator Communicator
 Quantum communicator which encapsulates the connection object (from Photon Realtime). More...
 
SimulationUpdateTime DeltaTimeType
 Will be used by the Unity runner to update the Quantum simulation with different delta time settings. More...
 
Byte[] FrameData
 Serialized frame to start the simulation from. Requires InitialFrame to be set as well. This can be a reconnect or an instant replay where we already have a frame snapshot locally (QuantumInstantReplay). More...
 
DeterministicGameMode GameMode
 The game mode (default is Multiplayer). Local mode is for testing only, the simulation is not connected online. It does not go into prediction nor does it perform rollbacks. Replay mode will also run offline and requires the ReplayProvider to be set to process the input. Spectating mode will run the simulation without a player and without the ability to input. More...
 
QuantumGameStartParameters GameParameters
 Encapsulated QuantumGameStartParameters. More...
 
Int32 InitialTick
 The initial tick to start the simulation from as set in FrameData (only set this when FrameData is set as well). The initial frame is also encoded in the data, but required deserialization first. More...
 
Action< ShutdownCause, SessionRunnerOnShutdown
 The LoadBalancingClient object needs to be connected to game sever (joined a room) when handed to Quantum. Is not required for Replay or Local game modes. More...
 
Int32 PlayerCount
 Setting a player count here will overwrite the SessionConfig.PlayerCount during runner creation. Either SessionConfig.Player or this PlayerCount needs to be > 0. More...
 
RecordingFlags RecordingFlags
 The recording flags will enable the recording of input and checksums (requires memory and allocations). When enabled QuantumGame.GetRecordedReplay can be used access the replay data. More...
 
IDeterministicReplayProvider ReplayProvider
 The replay provider injects recorded inputs and rpcs into the game which is required to run the game as a replay. InputProvider is an implementation of the replay provider. See usages of QuantumGame.RecordedInputs and QuantumRunnerLocalReplay.InputProvider. More...
 
IRunnerFactory RunnerFactory
 Runner factory to create platform dependent objects. More...
 
string RunnerId
 Optionally name the runner to access it from by id. This is useful when multiple runners are active on the client (for example an instant replay). More...
 
IRuntimeConfig RuntimeConfig
 The runtime config the Quantum game should use. Every client needs to set it, the server selects the first one send to it. More...
 
DeterministicSessionConfig SessionConfig
 The deterministic config the Quantum game should use. Every client needs to set it, the server selects the first one send to it. More...
 
float? StartGameTimeoutInSeconds
 If set it defines the timeout in seconds to wait for StartGame() to commence the online game. This includes for example sending configurations and waiting for a snapshot. If not set the default timeout is used defined by DefaultStartGameTimeoutInSeconds. This value is not related to DeterministicSessionConfig.SessionStartTimeout, but it's affected by it. The SessionStartTimeout should not be larger than this value. Use WaitForGameStart() to manually wait for the start. Be sure to Shutdown() the runner in case of exceptions. More...
 
InactiveTaskRunner TaskRunner
 The Quantum internal task runner. More...
 

Static Public Attributes

const float DefaultStartGameTimeoutInSeconds = 10.0f
 The default start game timeout. Overwrite by setting explicit StartGameTimeoutInSeconds. More...
 

Properties

IAssetSerializer AssetSerializer [get, set]
 Will set QuantumGameStartParameters.AssetSerializer More...
 
ICallbackDispatcher CallbackDispatcher [get, set]
 Will set QuantumGameStartParameters.CallbackDispatcher More...
 
IEventDispatcher EventDispatcher [get, set]
 Will set QuantumGameStartParameters.EventDispatcher More...
 
int GameFlags [get, set]
 GameFlags from QuantumGameFlags. Will set QuantumGameStartParameters.GameFlags. More...
 
int HeapExtraCount [get, set]
 Extra heaps to allocate for a session in case you need to create 'auxiliary' frames than actually required for the simulation itself. Will set QuantumGameStartParameters.HeapExtraCount More...
 
DynamicAssetDB InitialDynamicAssets [get, set]
 Optionally provide assets to be added to the dynamic asset db. This can be used to introduce procedurally generated assets into the simulation from the start. Will set QuantumGameStartParameters.InitialDynamicAssets More...
 
Int32 InitialFrame [get, set]
 Obsolete: use InitialTick More...
 
InstantReplaySettings InstantReplaySettings [get, set]
 The instant replay feature requires this setup data for snapshot recording. More...
 
IResourceManager ResourceManager [get, set]
 Optionally override the resource manager for example from deserialized Quantum assets (as showcased in QuantumRunnerLocalReplay). Will set QuantumGameStartParameters.ResourceManager More...
 

Detailed Description

Arguments to start an online or offline Quantum simulation.

Member Function Documentation

◆ CreateDefault()

static Arguments Quantum.SessionRunner.Arguments.CreateDefault ( )
inlinestatic

Initializes struct with default values.

◆ Validate()

void Quantum.SessionRunner.Arguments.Validate ( )
inline

Validate, log warnings and throw exceptions on errors.

Exceptions
SessionRunnerExceptionCommunicator object invalid.

Member Data Documentation

◆ DefaultStartGameTimeoutInSeconds

const float Quantum.SessionRunner.Arguments.DefaultStartGameTimeoutInSeconds = 10.0f
static

The default start game timeout. Overwrite by setting explicit StartGameTimeoutInSeconds.

◆ ClientId

string Quantum.SessionRunner.Arguments.ClientId

The Quantum ClientId is a secret between the client and the server and is used when reconnecting into a running simulation to preserve the player index.

◆ RuntimeConfig

IRuntimeConfig Quantum.SessionRunner.Arguments.RuntimeConfig

The runtime config the Quantum game should use. Every client needs to set it, the server selects the first one send to it.

◆ SessionConfig

DeterministicSessionConfig Quantum.SessionRunner.Arguments.SessionConfig

The deterministic config the Quantum game should use. Every client needs to set it, the server selects the first one send to it.

◆ ReplayProvider

IDeterministicReplayProvider Quantum.SessionRunner.Arguments.ReplayProvider

The replay provider injects recorded inputs and rpcs into the game which is required to run the game as a replay. InputProvider is an implementation of the replay provider. See usages of QuantumGame.RecordedInputs and QuantumRunnerLocalReplay.InputProvider.

◆ GameMode

DeterministicGameMode Quantum.SessionRunner.Arguments.GameMode

The game mode (default is Multiplayer). Local mode is for testing only, the simulation is not connected online. It does not go into prediction nor does it perform rollbacks. Replay mode will also run offline and requires the ReplayProvider to be set to process the input. Spectating mode will run the simulation without a player and without the ability to input.

◆ InitialTick

Int32 Quantum.SessionRunner.Arguments.InitialTick

The initial tick to start the simulation from as set in FrameData (only set this when FrameData is set as well). The initial frame is also encoded in the data, but required deserialization first.

◆ FrameData

Byte [] Quantum.SessionRunner.Arguments.FrameData

Serialized frame to start the simulation from. Requires InitialFrame to be set as well. This can be a reconnect or an instant replay where we already have a frame snapshot locally (QuantumInstantReplay).

◆ RunnerId

string Quantum.SessionRunner.Arguments.RunnerId

Optionally name the runner to access it from by id. This is useful when multiple runners are active on the client (for example an instant replay).

◆ PlayerCount

Int32 Quantum.SessionRunner.Arguments.PlayerCount

Setting a player count here will overwrite the SessionConfig.PlayerCount during runner creation. Either SessionConfig.Player or this PlayerCount needs to be > 0.

◆ StartGameTimeoutInSeconds

float? Quantum.SessionRunner.Arguments.StartGameTimeoutInSeconds

If set it defines the timeout in seconds to wait for StartGame() to commence the online game. This includes for example sending configurations and waiting for a snapshot. If not set the default timeout is used defined by DefaultStartGameTimeoutInSeconds. This value is not related to DeterministicSessionConfig.SessionStartTimeout, but it's affected by it. The SessionStartTimeout should not be larger than this value. Use WaitForGameStart() to manually wait for the start. Be sure to Shutdown() the runner in case of exceptions.

◆ OnShutdown

Action<ShutdownCause, SessionRunner> Quantum.SessionRunner.Arguments.OnShutdown

The LoadBalancingClient object needs to be connected to game sever (joined a room) when handed to Quantum. Is not required for Replay or Local game modes.

◆ Communicator

ICommunicator Quantum.SessionRunner.Arguments.Communicator

Quantum communicator which encapsulates the connection object (from Photon Realtime).

◆ RunnerFactory

IRunnerFactory Quantum.SessionRunner.Arguments.RunnerFactory

Runner factory to create platform dependent objects.

◆ TaskRunner

InactiveTaskRunner Quantum.SessionRunner.Arguments.TaskRunner

The Quantum internal task runner.

◆ CancellationToken

CancellationToken Quantum.SessionRunner.Arguments.CancellationToken

A cancellation token to stop all async tasks (only used during StartAsync()).

◆ GameParameters

QuantumGameStartParameters Quantum.SessionRunner.Arguments.GameParameters

Encapsulated QuantumGameStartParameters.

◆ DeltaTimeType

SimulationUpdateTime Quantum.SessionRunner.Arguments.DeltaTimeType

Will be used by the Unity runner to update the Quantum simulation with different delta time settings.

◆ RecordingFlags

RecordingFlags Quantum.SessionRunner.Arguments.RecordingFlags

The recording flags will enable the recording of input and checksums (requires memory and allocations). When enabled QuantumGame.GetRecordedReplay can be used access the replay data.

Property Documentation

◆ InitialFrame

Int32 Quantum.SessionRunner.Arguments.InitialFrame
getset

Obsolete: use InitialTick

◆ ResourceManager

IResourceManager Quantum.SessionRunner.Arguments.ResourceManager
getset

Optionally override the resource manager for example from deserialized Quantum assets (as showcased in QuantumRunnerLocalReplay). Will set QuantumGameStartParameters.ResourceManager

◆ AssetSerializer

IAssetSerializer Quantum.SessionRunner.Arguments.AssetSerializer
getset

◆ CallbackDispatcher

ICallbackDispatcher Quantum.SessionRunner.Arguments.CallbackDispatcher
getset

◆ EventDispatcher

IEventDispatcher Quantum.SessionRunner.Arguments.EventDispatcher
getset

◆ InstantReplaySettings

InstantReplaySettings Quantum.SessionRunner.Arguments.InstantReplaySettings
getset

The instant replay feature requires this setup data for snapshot recording.

◆ HeapExtraCount

int Quantum.SessionRunner.Arguments.HeapExtraCount
getset

Extra heaps to allocate for a session in case you need to create 'auxiliary' frames than actually required for the simulation itself. Will set QuantumGameStartParameters.HeapExtraCount

◆ InitialDynamicAssets

DynamicAssetDB Quantum.SessionRunner.Arguments.InitialDynamicAssets
getset

Optionally provide assets to be added to the dynamic asset db. This can be used to introduce procedurally generated assets into the simulation from the start. Will set QuantumGameStartParameters.InitialDynamicAssets

◆ GameFlags

int Quantum.SessionRunner.Arguments.GameFlags
getset