Photon Quantum 3.0.0

Public Member Functions | Public Attributes | Properties | List of all members
Quantum.DotNetSessionRunner Class Reference

This class implements the IDeterministicSessionRunner interface and contains code to glue together the Quantum server and Quantum session runner. This was formerly part of the Quantum Server SDK. The class will also work without running the server simulation only as wrapper for access to custom simulation code as resource manager and command serialization for example. More...

Inherits IDeterministicSessionRunner.

Public Member Functions

AssetGuid AddInitialDynamicAsset (AssetObject asset)
 Add an initial dynamic asset. Needs to be performed before the simulation starts. Use DeterministicServer.OnDeterministicSessionCanStart(). More...
 
void Service (double gameTime)
 Implements the server update callback. More...
 
void Shutdown ()
 Disposes the Quantum runner. More...
 
void Start (DeterministicSessionRunnerStartArguments args)
 Implements the start of the Quantum online session. Instantiates a Quantum runner. More...
 
bool TryCreateSnapshot (ref int tick, ref byte[] data)
 Implements the server snapshot requested callback. This will use the most recent simulated frame on the server to use as a snapshot for late-joining clients. Which will bypass requesting buddy snapshots from other clients. More...
 

Public Attributes

object CallbackDispatcher => _callbackDispatcher
 Access Quantum callbacks. More...
 
object EventDispatcher => _eventDispatcher
 Access Quantum events. More...
 
DynamicAssetDB InitialDynamicAssetDB => _dynamicAssetDB
 Access the initial dynamic asset db, gets created after AddInitialDynamicAsset(AssetObject) was used. Will be disposed and nulled after Start(DeterministicSessionRunnerStartArguments). More...
 
SessionRunner Runner => _runner
 Grants access to the Quantum session runner. More...
 

Properties

IAssetSerializer AssetSerializer [get, set]
 Get and set the AssetSerializer directly after IDeterministicSessionRunner creation, until it is possible to pass it internally. More...
 
Action< byte[]> OnGameResult [get, set]
 Callback raised on game result events from the simulation. More...
 

Detailed Description

This class implements the IDeterministicSessionRunner interface and contains code to glue together the Quantum server and Quantum session runner. This was formerly part of the Quantum Server SDK. The class will also work without running the server simulation only as wrapper for access to custom simulation code as resource manager and command serialization for example.

Member Function Documentation

◆ AddInitialDynamicAsset()

AssetGuid Quantum.DotNetSessionRunner.AddInitialDynamicAsset ( AssetObject  asset)
inline

Add an initial dynamic asset. Needs to be performed before the simulation starts. Use DeterministicServer.OnDeterministicSessionCanStart().

Parameters
assetAsset to add to initial dynamic asset db.
Returns
Guid of the asset or invalid guid when the simulation has already been started.

◆ Shutdown()

void Quantum.DotNetSessionRunner.Shutdown ( )
inline

Disposes the Quantum runner.

◆ Start()

void Quantum.DotNetSessionRunner.Start ( DeterministicSessionRunnerStartArguments  args)
inline

Implements the start of the Quantum online session. Instantiates a Quantum runner.

Parameters
argsStart arguments

◆ Service()

void Quantum.DotNetSessionRunner.Service ( double  gameTime)
inline

Implements the server update callback.

Parameters
gameTimeGame time in seconds

◆ TryCreateSnapshot()

bool Quantum.DotNetSessionRunner.TryCreateSnapshot ( ref int  tick,
ref byte[]  data 
)
inline

Implements the server snapshot requested callback. This will use the most recent simulated frame on the server to use as a snapshot for late-joining clients. Which will bypass requesting buddy snapshots from other clients.

Parameters
tickThe tick of the snapshot.
dataDeterministicFrame object serialized.
Returns
True, if the snapshot was set.

Member Data Documentation

◆ InitialDynamicAssetDB

DynamicAssetDB Quantum.DotNetSessionRunner.InitialDynamicAssetDB => _dynamicAssetDB

Access the initial dynamic asset db, gets created after AddInitialDynamicAsset(AssetObject) was used. Will be disposed and nulled after Start(DeterministicSessionRunnerStartArguments).

◆ Runner

SessionRunner Quantum.DotNetSessionRunner.Runner => _runner

Grants access to the Quantum session runner.

◆ EventDispatcher

object Quantum.DotNetSessionRunner.EventDispatcher => _eventDispatcher

Access Quantum events.

◆ CallbackDispatcher

object Quantum.DotNetSessionRunner.CallbackDispatcher => _callbackDispatcher

Access Quantum callbacks.

Property Documentation

◆ AssetSerializer

IAssetSerializer Quantum.DotNetSessionRunner.AssetSerializer
getset

Get and set the AssetSerializer directly after IDeterministicSessionRunner creation, until it is possible to pass it internally.

◆ OnGameResult

Action<byte[]> Quantum.DotNetSessionRunner.OnGameResult
getset

Callback raised on game result events from the simulation.