Table of Contents

Interface IWorldServerSystem

Namespace
FishMMO.Server.Core.World.WorldServer
Assembly
FishMMO.Server.dll

Core-facing abstraction representing a world server process that manages scenes and player population for an MMO world. The implementation layer provides concrete behavior (for example WorldServerSystem).

public interface IWorldServerSystem : IServerBehaviour, IServerComponent

Methods

Pulse(int)

Sends a periodic heartbeat (pulse) to the database or monitoring systems with the current character count. Implementations should use this to keep the server liveness and population metrics up-to-date.

void Pulse(int characterCount)

Parameters

characterCount int

Current number of connected characters.

RegisterAsync(string, ushort, int, CancellationToken)

Registers or updates the server record in the central database. This call should create the record the first time the server comes online and update connection info on subsequent calls.

Task<bool> RegisterAsync(string serverAddress, ushort port, int characterCount, CancellationToken cancellationToken = default)

Parameters

serverAddress string

Public address or hostname of the server.

port ushort

Port number where scene servers accept connections.

characterCount int

Current number of connected characters to record.

cancellationToken CancellationToken

Cancelled when the server shuts down mid-registration.

Returns

Task<bool>

true when the server record was written.

Remarks

Asynchronous by contract: registration is database I/O, and the Unity main thread must never block on it. The main thread is what drains async continuations, so blocking it stalls the very work being waited on.