Interface IServerBehaviourRegistry<TNetworkManager, TConnection, TBehaviour>
Engine-agnostic interface for the server behaviour registry. Defines the contract for registering, retrieving, and managing server-side behaviours. Extends IServerComponentRegistry for unified component management.
public interface IServerBehaviourRegistry<TNetworkManager, TConnection, TBehaviour> : IServerComponentRegistry<TNetworkManager, TConnection, TBehaviour> where TBehaviour : IServerBehaviour
Type Parameters
TNetworkManagerThe network manager type.
TConnectionThe connection type.
TBehaviourThe base type of server behaviour to be managed.
- Inherited Members
Methods
InitializeAllAsync(IServer, CancellationToken)
Initializes all registered behaviours without blocking the caller's thread, one at a time in registration order so a behaviour may depend on state published by an earlier one. This is the entry point the server startup chain uses: behaviour initialization performs I/O, and the Unity main thread must stay free to drain the continuations that I/O depends on.
Task<IReadOnlyList<(string Name, ServerComponentInitializationStatus Status)>> InitializeAllAsync(IServer server, CancellationToken cancellationToken)
Parameters
serverIServerThe server instance.
cancellationTokenCancellationTokenCancelled 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.