Photon Quantum 3.0.0

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

This class implements the IDeterministicSessionContext interface inside the simulation project. It's used on the custom server to access Quantum simulation code like the resource manager and command serialization. A static resource manager is created during Init() that is shared between multiple server simulation instances. More...

Inherits IDeterministicSessionContext.

Public Member Functions

void Init (DeterministicSessionContextInitArguments args)
 Initialized the server simulation. It initializes static classes like FPLut, Native.Utils and instantiates a static resource manager that is shared over multiple server simulations. This method throws exceptions on errors. More...
 
void Shutdown ()
 Disposes the Quantum runner. More...
 
void Start (DeterministicSessionContextStartArguments args)
 Implements the start of the Quantum online session. Instantiates a Quantum runner. More...
 

Public Attributes

DeterministicCommandSerializer CommandSerializer => _commandSerializer
 Returns the command serializer created when the simulation started. More...
 
object ResourceManager => CustomResourceManager ?? _sharedResourceManager
 Return the resource manager assigned to the session context. If no custom resource manager is assigned the static shared resource manager is returned. More...
 
IResourceManager SharedResourceManager => _sharedResourceManager
 Access the shared resource manager that was created from the asset database input during the initial creation of the first server instance. More...
 

Properties

IAssetSerializer AssetSerializer [get, set]
 Get and set the AssetSerializer directly after IDeterministicSessionRunner creation, until it is possible to pass it internally. More...
 
ResourceManagerStatic CustomResourceManager [get, set]
 Assign a custom resource manager which will use the cached static resource manager as ResourceManagerStatic.FallbackResourceManager. Must be set right after creation. More...
 

Detailed Description

This class implements the IDeterministicSessionContext interface inside the simulation project. It's used on the custom server to access Quantum simulation code like the resource manager and command serialization. A static resource manager is created during Init() that is shared between multiple server simulation instances.

Member Function Documentation

◆ Init()

void Quantum.DotNetSessionContext.Init ( DeterministicSessionContextInitArguments  args)
inline

Initialized the server simulation. It initializes static classes like FPLut, Native.Utils and instantiates a static resource manager that is shared over multiple server simulations. This method throws exceptions on errors.

◆ Shutdown()

void Quantum.DotNetSessionContext.Shutdown ( )
inline

Disposes the Quantum runner.

◆ Start()

void Quantum.DotNetSessionContext.Start ( DeterministicSessionContextStartArguments  args)
inline

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

Parameters
argsStart arguments

Member Data Documentation

◆ CommandSerializer

DeterministicCommandSerializer Quantum.DotNetSessionContext.CommandSerializer => _commandSerializer

Returns the command serializer created when the simulation started.

◆ SharedResourceManager

IResourceManager Quantum.DotNetSessionContext.SharedResourceManager => _sharedResourceManager

Access the shared resource manager that was created from the asset database input during the initial creation of the first server instance.

◆ ResourceManager

object Quantum.DotNetSessionContext.ResourceManager => CustomResourceManager ?? _sharedResourceManager

Return the resource manager assigned to the session context. If no custom resource manager is assigned the static shared resource manager is returned.

Property Documentation

◆ AssetSerializer

IAssetSerializer Quantum.DotNetSessionContext.AssetSerializer
getset

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

◆ CustomResourceManager

ResourceManagerStatic Quantum.DotNetSessionContext.CustomResourceManager
getset

Assign a custom resource manager which will use the cached static resource manager as ResourceManagerStatic.FallbackResourceManager. Must be set right after creation.