Quantum 3 3.1.0

Public Member Functions | Public Attributes | Properties | List of all members
Quantum.ServerSessionContext 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. It uses the resource manager of the shared resources that is shared between multiple server simulation instances. More...

Inherits IDeterministicSessionContext.

Inherited by Quantum.DotNetSessionContext.

Public Member Functions

 ServerSessionContext (ResourceManagerStatic shared, ResourceManagerStatic custom)
 Create context and supply a custom resource manager. More...
 
void Shutdown ()
 Releases the command serializer and the custom resource manager. The custom resource manager is not disposed. More...
 
void Start (DeterministicSessionContextStartArguments args)
 Implements the start of the Quantum online session. Creates the command serializer from the runtime config. More...
 

Public Attributes

DeterministicCommandSerializer CommandSerializer => _commandSerializer
 Returns the command serializer created when the simulation started. More...
 
ResourceManagerStatic 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...
 
ResourceManagerStatic 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

ResourceManagerStatic CustomResourceManager [get]
 Assign a custom resource manager which will use the cached static resource manager as ResourceManagerStatic.FallbackResourceManager. Resources must be disposed by hand. 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. It uses the resource manager of the shared resources that is shared between multiple server simulation instances.

Constructor & Destructor Documentation

◆ ServerSessionContext()

Quantum.ServerSessionContext.ServerSessionContext ( ResourceManagerStatic  shared,
ResourceManagerStatic  custom 
)
inline

Create context and supply a custom resource manager.

Parameters
sharedShared global resource manager
customCustom resource manager for this session

Member Function Documentation

◆ Shutdown()

void Quantum.ServerSessionContext.Shutdown ( )
inline

Releases the command serializer and the custom resource manager. The custom resource manager is not disposed.

◆ Start()

void Quantum.ServerSessionContext.Start ( DeterministicSessionContextStartArguments  args)
inline

Implements the start of the Quantum online session. Creates the command serializer from the runtime config.

Parameters
argsStart arguments

Member Data Documentation

◆ CommandSerializer

DeterministicCommandSerializer Quantum.ServerSessionContext.CommandSerializer => _commandSerializer

Returns the command serializer created when the simulation started.

◆ SharedResourceManager

ResourceManagerStatic Quantum.ServerSessionContext.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

ResourceManagerStatic Quantum.ServerSessionContext.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

◆ CustomResourceManager

ResourceManagerStatic Quantum.ServerSessionContext.CustomResourceManager
get

Assign a custom resource manager which will use the cached static resource manager as ResourceManagerStatic.FallbackResourceManager. Resources must be disposed by hand.