Table of Contents

Interface IServerBoardService

Namespace
FishMMO.Database.Npgsql.Services.Interfaces
Assembly
FishMMO-DB.dll

The operator's read of every server process and live scene instance.

public interface IServerBoardService

Remarks

A read-only service spanning four tables, separate from the three per-tier services that the servers themselves use to register and pulse. Those exist to serve one process talking about itself; this exists to answer "what is the shard doing", which is a different question with a different shape, and folding it into them would give a login server a method for enumerating scene servers it has no business calling.

Nothing here filters by pulse age. Every per-tier service has a "fetch active" that hides a process which has stopped pulsing, which is right for the game — a dead server should not receive work. It is exactly wrong for an operator: the server that has stopped pulsing is the one they opened the page to find.

Methods

FetchBoardAsync(CancellationToken)

Every login, world and scene server, plus the live instance count.

Task<DatabaseResult<ServerBoardData>> FetchBoardAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<DatabaseResult<ServerBoardData>>

FetchPulseAgeAsync(string, string, CancellationToken)

How long ago one registered server last pulsed, in seconds by the database clock, for a health check.

Task<DatabaseResult<double?>> FetchPulseAgeAsync(string kind, string serverName, CancellationToken cancellationToken = default)

Parameters

kind string

Which tier: login, world or scene.

serverName string

The name the server registered under, from its own configuration.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<DatabaseResult<double?>>

Remarks

The pulse is a far better liveness signal than any socket probe: it proves the server is running its loop, doing work, and can still reach the database. A port probe proves a socket is bound. It is also the only signal available now that the transport is WebTransport over QUIC, which has no "is the port open" answer — a QUIC server replies only to a valid Initial packet carrying a TLS ClientHello, so a plain datagram gets nothing back.

Returns null when no server is registered under that name, which the caller must treat differently from a stale pulse: never registered and stopped talking are different faults.

An age, not the stamp. The database stamps every pulse, so the age is measured against the database clock inside the reading statement, never negative. This used to return last_pulse for the supervising daemon to subtract from its own DateTime.UtcNow: a daemon host running faster than the database by more than the stale limit saw every healthy server as silent and restarted it, over and over.

FetchScenesAsync(int?, long?, int, int, CancellationToken)

Live scene instances.

Task<DatabaseResult<SceneInstancePage>> FetchScenesAsync(int? status, long? sceneServerId, int page, int pageSize, CancellationToken cancellationToken = default)

Parameters

status int?

Filter by SceneStatus, or null for any.

sceneServerId long?

Filter to one scene server, or null for all.

page int

1-based page number.

pageSize int

Rows per page. Clamped by the service.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<DatabaseResult<SceneInstancePage>>