Table of Contents

Class ServerBehaviourRegistry

Namespace
FishMMO.Server.Implementation
Assembly
FishMMO.Server.dll

Handles registration, lookup, and initialization of IServerBehaviour instances. Provides global access and lifecycle management for server-side behaviours. Extends the generic ServerComponentRegistry to provide behaviour-specific initialization.

public class ServerBehaviourRegistry : ServerComponentRegistry<INetworkManagerWrapper, NetworkConnection, IServerBehaviour>, IServerBehaviourRegistry<INetworkManagerWrapper, NetworkConnection, IServerBehaviour>, IServerComponentRegistry<INetworkManagerWrapper, NetworkConnection, IServerBehaviour>
Inheritance
ServerBehaviourRegistry
Implements
Inherited Members

Properties

RegistryName

Registry name for logging purposes.

protected override string RegistryName { get; }

Property Value

string

Methods

DeinitializeAll()

Deinitializes all registered behaviours with deduplication.

public override void DeinitializeAll()

InitializeAll(IServer)

Initializes all registered IServerBehaviours with the provided server and server manager.

public override void InitializeAll(IServer server)

Parameters

server IServer

The server instance.

InitializeAllAsync(IServer, CancellationToken)

Initializes all registered behaviours without blocking the Unity main thread. Behaviours are initialized one at a time in registration order, so a behaviour may depend on state published by an earlier one (LoginServerSystem's registered server ID, for example).

public Task<IReadOnlyList<(string Name, ServerComponentInitializationStatus Status)>> InitializeAllAsync(IServer server, CancellationToken cancellationToken)

Parameters

server IServer

The server instance.

cancellationToken CancellationToken

Cancelled when the server shuts down mid-startup.

Returns

Task<IReadOnlyList<(string Name, ServerComponentInitializationStatus Status)>>

The behaviours that failed, with their status. Empty when every behaviour initialized.

Remarks

Runs on the Unity main thread and awaits without ConfigureAwait(false), so each behaviour resumes on the main thread after its I/O completes.