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
characterCountintCurrent 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
serverAddressstringPublic address or hostname of the server.
portushortPort number where scene servers accept connections.
characterCountintCurrent number of connected characters to record.
cancellationTokenCancellationTokenCancelled when the server shuts down mid-registration.
Returns
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.