Dedicated Server Hosting
Production layout and startup contract
Direct packaging, Docker, and systemd use the same staged layout:
/opt/domination/server/config/server.json
/opt/domination/server/config/release-maps.json
/opt/domination/server/src/*.js
/opt/domination/unity/Assets/StreamingAssets/data/maps/<approved-id>.json
/server-data/ # the only mutable tree
server.json is required. Relative paths inside it resolve from the config file, never from the
process working directory. release-maps.json is the versioned allow-list for built-in maps; every
listed descriptor must exist, parse, match its ID, and provide at least two spawns. The server exits
before listening if the config, manifest, map directory, any approved descriptor, or writable data
tree is unavailable. Approved custom maps under /server-data/maps/approved are additive and cannot
replace a built-in map ID.
The current catalog is 2026.09.14-heartland-metro with one approved skirmish map (heartland). Campaign and test descriptors
are not advertised by production servers.
Validate a checkout
The server uses Node.js built-ins only (Node 20 or newer). From the repository root:
npm run validate
SERVER_DATA_DIR="$(mktemp -d)" npm run validate:deployment
npm run test:deployment
config/server.json names the staged layout (../../unity/... from /opt/domination/server/config).
A checkout keeps the release maps under the game root instead, game-contract/ unless
DOMINATION_GAME_ROOT names another, so npm start, validate:deployment and the domination-server
launcher go through scripts/local-server.mjs, which sets MAP_SOURCE_DIR to the game root's maps.
validate:deployment loads the required config and complete release catalog without opening a
socket. A healthy result includes:
"event":"deployment_validated" ... "releaseMapCount":1
Secure transport contract
Public and LAN runtime binds require native TLS 1.2 or newer. The server reads a PEM certificate chain and private key before it creates runtime directories or opens a socket, and fails closed if either is absent, unreadable, malformed, or mismatched:
DEDICATED_SERVER_HOST=0.0.0.0 \
TLS_CERT_PATH=/etc/domination/tls/fullchain.pem \
TLS_KEY_PATH=/etc/domination/tls/privkey.pem \
SERVER_DATA_DIR="$HOME/.local/share/domination-server" \
node "$(pwd)/scripts/local-server.mjs" \
--config "$(pwd)/config/server.json"
The certificate SAN must contain the hostname players enter. Unity shipping
clients use platform chain, lifetime, revocation, and hostname validation;
players connect with tls://game.example.com:7777 (a bare hostname also
defaults to TLS). This is TLS-wrapped newline JSON, not HTTP. The automated
player harness has a separate exact-certificate pin that activates only for
MP_AUTOTEST=host|join after the connected peer is confirmed as loopback;
interactive and public connections cannot activate it.
The Android build connects the same way and is admitted by the same checks: it is an IL2CPP player like the Windows and Linux releases, so phones and desktops share lobbies on any relay that accepts that release. A phone checks the certificate against its own system trust store, so a relay Android players use needs a certificate from a public CA.
Plaintext is a local development exception only. It requires an explicit flag
on both processes and literal numeric loopback addresses—hostnames including
localhost, LAN addresses, and public addresses are rejected:
ALLOW_INSECURE_LOOPBACK=1 DEDICATED_SERVER_HOST=127.0.0.1 \
node scripts/local-server.mjs --config "$PWD/config/server.json"
# from a red-jester-studios/domination checkout with a player build
domination_ALLOW_INSECURE_LOOPBACK=1 \
MULTIPLAYER_SERVER_URL=tcp://127.0.0.1:7777 \
./unity/Build/domination/domination.x86_64
Never use account, lobby, or reconnect credentials in plaintext mode.
For a local server, pass the config explicitly. The absolute path keeps the invocation independent of the shell's current directory:
SERVER_DATA_DIR="$HOME/.local/share/domination-server" \
node "$(pwd)/scripts/local-server.mjs" \
--config "$(pwd)/config/server.json"
The checked-in launcher resolves its own source path and accepts the same arguments:
./domination-server --config "$(pwd)/config/server.json" --port 7777
Readiness
The TLS-authenticated ping response is safe for health monitoring and
contains no secrets:
{
"type": "pong",
"ready": true,
"persistenceState": "healthy",
"configLoaded": true,
"config": "server.json",
"catalogVersion": "2026.09.14-heartland-metro",
"releaseMapCount": 1,
"customMapModelCatalogVersion": "map-editor-assets-5302f1118d3005eb",
"customMapModelCount": 2307,
"mapCount": 1,
"serverTime": 1790809200000,
"uptimeSeconds": 42
}
Run the shipped probe from the staged server package:
READINESS_HOST=127.0.0.1 READINESS_PORT=7777 \
READINESS_SERVER_NAME=game.example.com \
node /opt/domination/server/scripts/readiness-check.mjs
Public-CA certificates use Node's platform trust store. For a private CA or
the checked-in localhost test fixture only, also set
READINESS_TLS_CA_PATH=/path/to/ca.pem. The probe never disables certificate
or hostname validation.
mapCount can be greater than releaseMapCount when approved custom maps are installed. Readiness
requires at least one release map and persistenceState: "healthy", so custom content cannot hide a
broken production map mount and unresolved result recovery cannot accept new matches.
Docker
Build from the repository root. The root .dockerignore sends only the server runtime files and the
vendored game contract's map descriptors and map-editor catalog; the packager copies only
manifest-approved maps into the final image.
SERVER_COMPONENT_SOURCE_SHA256="$(
python3 .github/scripts/component_source_identity.py \
--component server \
--repo "$PWD" \
--require-clean-head \
--expected-commit "$(git rev-parse --verify HEAD)"
)"
[[ "$SERVER_COMPONENT_SOURCE_SHA256" =~ ^[0-9a-f]{64}$ ]]
printf '%s\n' "$SERVER_COMPONENT_SOURCE_SHA256"
docker build \
--build-arg "COMPONENT_SOURCE_SHA256=$SERVER_COMPONENT_SOURCE_SHA256" \
-t domination-server:local .
docker volume create domination-server-data
docker run -d \
--name domination-server \
--read-only \
--tmpfs /tmp:rw,noexec,nosuid,size=16m \
--cap-drop ALL \
--security-opt no-new-privileges:true \
-p 7777:7777/tcp \
-v domination-server-data:/server-data \
-v /srv/domination/tls:/certs:ro \
-e TLS_CERT_PATH=/certs/fullchain.pem \
-e TLS_KEY_PATH=/certs/privkey.pem \
-e READINESS_SERVER_NAME=game.example.com \
domination-server:local
The identity command prints exactly one 64-character lowercase hexadecimal line. For a production
image, compute it from a clean checkout at the committed HEAD as shown; the image then advertises
the identity of the exact tracked inputs that affect the server component. An uncommitted or
untracked change makes this production command fail instead of assigning a misleading identity.
Direct local staging, including from a dirty development checkout, defaults to the development
identity. The systemd installer intentionally invokes staging without an explicit component
identity and therefore reports development. A manual staging invocation can replace that marker
by passing a computed identity to stage-production.mjs with --component-source-sha256, but only
the clean-checkout procedure above establishes a clean committed production identity.
The image runs as the unprivileged node user. Config, code, manifest, and map
descriptors live in the read-only image; only /server-data is writable. TLS
material is a read-only bind mount. The built-in Docker health check runs the
same authenticated readiness probe and the container fails closed when the
certificate/key are absent:
Ensure the mounted certificate and private key are readable by the container's
user, UID 65532 (the distroless image's nonroot), without making the private key
world-readable (for example, owner/group 65532 with mode 0640). For a private CA, mount its PEM too and set
READINESS_TLS_CA_PATH to the in-container path.
docker inspect --format '{{json .State.Health}}' domination-server
docker logs domination-server
For a host bind mount instead of the named volume, create it for container UID/GID 65532 first:
sudo install -d -o 65532 -g 65532 -m 0750 /srv/domination/server-data
Do not mount over /opt/domination; doing so removes the validated config or release catalog and
startup will fail intentionally.
Linux/systemd
From a repository checkout, the installer creates the unprivileged domination account, stages the
same manifest-selected runtime used by Docker, creates /server-data, installs the hardened unit,
validates the deployment in ExecStartPre, and starts it:
sudo TLS_CERT_SOURCE=/etc/letsencrypt/live/game.example.com/fullchain.pem \
TLS_KEY_SOURCE=/etc/letsencrypt/live/game.example.com/privkey.pem \
TLS_SERVER_NAME=game.example.com \
scripts/install-systemd.sh --start
sudo journalctl -u domination-server -f
To inspect before starting, omit --start, then run:
sudo systemctl enable --now domination-server
sudo systemctl status domination-server
sudo env READINESS_SERVER_NAME=game.example.com \
node /opt/domination/server/scripts/readiness-check.mjs
The installer copies the supplied certificate and key to
/etc/domination/tls, writes a root-owned service environment file, and runs
catalog, key-pair, and certificate-hostname preflight before replacing or
starting the unit. TLS_SERVER_NAME must be the hostname players use. For a
private CA, also supply TLS_CA_SOURCE=/path/to/ca.pem; public-CA deployments
use Node's platform trust store. Rerun the installer after certificate
rotation. The unit treats /opt/domination and TLS
material as read-only and grants writes only to /server-data. Never place the
production config under /server-data; mutable state must not be able to
replace the release catalog or server policy.
domination-server.service uses Type=simple: systemctl status reports process liveness, not
application readiness. A server with retained recovery evidence deliberately keeps its diagnostic
socket alive but answers ready:false. The installer runs the readiness probe when invoked with
--start; production monitoring must run the same probe continuously and alert on a nonzero exit.
Do not route players to an instance based on active (running) alone.
Configuration overrides
The supported deployment variables are:
DEDICATED_SERVER_HOST
DEDICATED_SERVER_PORT
SERVER_CONFIG # use an absolute production path
SERVER_DATA_DIR
MAP_SOURCE_DIR # must contain every manifest-approved descriptor
MAP_MANIFEST # must be a valid, non-empty release manifest
GAME_VERSION
TLS_CERT_PATH # PEM certificate/full chain
TLS_KEY_PATH # PEM private key; never log or commit
TLS_SERVER_NAME # exact public certificate hostname for preflight
MAX_PENDING_TLS_HANDSHAKES # default 64; 1-4096 pre-auth sockets
TLS_RELOAD_INTERVAL_SECONDS # default 300; re-read cert/key (also on file change)
MAX_CONNECTIONS # default 128 ADMITTED clients (counted after a valid hello)
HELLO_TIMEOUT_SECONDS # default 15; a socket with no valid hello is closed
MAX_PRE_HELLO_CONNECTIONS # default 32; oldest silent socket evicted beyond it
MAX_CONNECTIONS_PER_PEER # default 32 per remote address; 0 = off
CONNECTION_LIMIT_EXEMPT_LOOPBACK # default 1: loopback peers (Istio's 127.0.0.6) are exempt
MAX_HELLOS_PER_CONNECTION # default 8
MAX_IDENTITIES_PER_CONNECTION # default 3 distinct profile keys per connection
NEW_IDENTITY_RATE_PER_SEC # default 50 never-seen identities/s relay-wide
NEW_IDENTITY_BURST # default 500
MAX_PENDING_PROFILES # default 4096 guests held in memory before a match
MAX_CONNECTIONS_PER_ACCOUNT # default 4 sockets per account identity
MAP_UPLOADS_ENABLED # default 0: uploadMap refused, every line capped at 256 KiB
MAP_UPLOAD_INFLIGHT_BUDGET_BYTES # default 256 MiB of unterminated upload lines relay-wide
MAP_UPLOAD_LINE_TIMEOUT_SECONDS # default 120 per large line
ALLOW_INSECURE_LOOPBACK # local numeric-loopback tests only
RECONNECT_GRACE_SECONDS
DISCONNECT_OUTCOME
LOADING_TIMEOUT_SECONDS
MESSAGE_RATE_PER_SEC
MESSAGE_BURST
COMMAND_DEFER_ENABLED # default 0 (off). 1: a seated player's commands at an empty token bucket queue (FIFO, drained on tick) instead of being dropped
COMMAND_DEFER_QUEUE_MAX # default 256; per-client deferred-command entries, integer 0..4096
COMMAND_DEFER_CLIENT_BYTES_MAX # default 2097152 (2 MiB); queued bytes per connection, integer 0..67108864
COMMAND_DEFER_SHARD_BYTES_MAX # default 16777216 (16 MiB); queued bytes across the relay process, integer 0..1073741824
SEAT_LAG_WARN_TICKS # default 150; checksum-arrival lag that logs `seat_lagging` (telemetry only)
DESYNC_VOID_TICKS
LOBBY_CREATES_PER_WINDOW
ACCOUNT_TOKEN_PUBLIC_KEY # dominationrts.com's Ed25519 public key (PEM); empty = off
REQUIRE_ACCOUNT # 1/true: online play only for signed-in website members
GLOBAL_CHAT # 0/false closes the global chat room (default open)
WHISPERS # 0/false turns private messages off (default on)
Connection admission (domination-server #101, #102, #103): a socket holds one of
MAX_PRE_HELLO_CONNECTIONS until its first valid hello, and only then one of
MAX_CONNECTIONS, so silent sockets cannot lock players out. A guest's profile
stays in memory until the guest enters a match, where it is written once
(returning players are already durable); a website account's profile is written
at its first hello. The per-peer cap keys on the remote address the relay sees.
Behind the Istio sidecar that is always 127.0.0.6 (loopback, exempt), so the cap
only takes effect once the relay sees real client addresses. A matchmaker that
reaches shards from a non-loopback pod address must be listed in the config's
connectionLimitExemptAddresses (or set MAX_CONNECTIONS_PER_PEER=0).
Run --validate-only after any override and before restarting production.
Catalog-only --validate-only does not open a listener; a real runtime start
must additionally load the TLS material successfully. Use
--validate-only --validate-transport with TLS_CERT_PATH and TLS_KEY_PATH
to perform the exact systemd preflight without opening a listener.
Website accounts
Members sign in with their dominationrts.com account. The website's accounts
service signs a short-lived play token for a member who holds a game licence and
is not banned, and the game sends it as authToken in hello. The relay
verifies it offline (src/play-tokens.js): no network call, no password.
dpt1.<base64url(payload)>.<base64url(Ed25519 signature over "dpt1.<base64url(payload)>")>
payload: {"v":1,"iss":"dominationrts.com","aud":"domination-relay",
"sub":"acct:<lowercase name>","name":"<name>","lic":true,"iat":<s>,"exp":<s>}
A valid token binds the connection to acct:<name>, the same profile an
account login has always bound (ranking, commander careers, lobby identity), and
helloAck reports account and accountSource: "web". Tokens over 2048
characters, with a bad signature, the wrong issuer/audience/version, a name the
relay would refuse, lic other than true, or issued more than 60 s in the
future are account_token_invalid; a genuine token more than 60 s past exp is
account_token_expired, which tells the client to refresh its sign-in and retry.
ACCOUNT_TOKEN_PUBLIC_KEY |
REQUIRE_ACCOUNT |
Valid token | Bad or expired token | Guest or legacy token | register / login |
|---|---|---|---|---|---|
| empty (default) | false (default) | guest (unknown token) | guest | as before | as before |
| set | false | account | error, then guest | as before | register_closed / login_moved |
| set | true | account | error, connection closed | account_required, connection closed |
register_closed / login_moved |
| empty | true | startup fails |
The key must be the PUBLIC key (-----BEGIN PUBLIC KEY-----); startup refuses a
private key, a non-Ed25519 key or unparseable text. Ban and licence changes reach
the relay when a member's current token expires, because a token is checked once,
at hello. Token contents are never logged; account_token_accepted and
account_token_rejected (with a reason such as signature or expired) are.
Global chat
The multiplayer screen's GLOBAL CHAT panel is one room for everyone connected to
the relay, outside any lobby (handleGlobalJoin in src/server.js).
helloAck.globalChat says whether this relay has it; a client sends nothing
for the room until it does, because an older relay answers the messages with
unknown_message.
| Client sends | Relay answers |
|---|---|
{"type":"globalJoin"} |
globalChatHistory to the joiner: the last 50 lines as messages, plus count and roster |
{"type":"globalChat","text":"..."} |
globalChat to every member: id, name, rankId, rankName, avatar, text, ts |
{"type":"globalLeave"} |
nothing; the roster drops the member |
globalPresence (count, plus a roster of up to 100 {name, signedIn, rankId, status} with status online, lobby or match) goes to every
member when someone joins, leaves, signs in or out while connected, or changes
status. It is debounced to one per second and checked every 3 s, and nothing is
sent when the roster has not changed.
Anyone connected may join and read. Only a website member (accountSource
"web") may post, so every line belongs to an account the website can ban:
anyone else gets global_chat_sign_in. A line is clipped to 200 characters
with control characters removed. A member may post once a second and six times
in fifteen seconds (chat_rate_limited), and not the same line twice within
30 s (chat_repeated); a refused line spends nothing. A member in a loading or
running match is skipped, and its posts get global_chat_in_match. The match
has its own chat, and the client rejoins for fresh history when the match ends.
GLOBAL_CHAT=0 closes the room: helloAck.globalChat is false and
globalJoin/globalChat get global_chat_closed.
Lines live in memory only, so a restart empties the room. Neither the text nor
the history is ever logged. One process holds the room, which is every player
while the public port routes to the single relay. Behind the matchmaker
(src/matchmaker.js) each shard would hold its own room until the matchmaker
fans globalChat out across shards.
Private messages
Website members can whisper to each other by account name, wherever the
recipient is: the multiplayer screen, a lobby or a match (handleWhisper).
helloAck.whispers says whether this relay allows them.
| Client sends | Relay answers |
|---|---|
{"type":"whisper","to":"<name>","text":"..."} |
whisper (from, to, rankId, rankName, text, ts) to every connection of that account, and the same with outgoing: true to the sender |
{"type":"setBlocked","names":["<name>", ...]} |
nothing. This connection's block list, at most 200 names, replaced each time |
Both ends must be signed in with a play token (whisper_sign_in for the
sender; a guest has no inbox, so it reads as whisper_offline). The name is
matched without regard to case, and the recipient's own spelling comes back in
to. If the recipient blocked the sender, nothing is delivered and the sender
gets whisper_blocked ("whisper_offline,
whisper_self, whisper_no_target and bad_chat. A member may whisper once a
second and eight times in fifteen seconds (chat_rate_limited); a refused
whisper spends nothing. WHISPERS=0 answers whisper_closed. Whispers are
never stored or logged.
Transport validation
The server suite covers fail-closed public startup, plaintext and hostname-based opt-in probes, hostname mismatch, malformed credentials, secret-free logs, and saturated/stalled pre-auth TLS handshakes:
npm test
After deployment integration supplies the certificate paths and TLS-aware health probe, validate the exact public name and capture a login/lobby session:
openssl s_client -connect game.example.com:7777 \
-servername game.example.com -verify_return_error </dev/null
The capture must contain TLS records and no readable passwords, bearer or reconnect tokens, lobby credentials, chat, commands, or match state.
Seat lag: seeing slow simulations before they void a match
The relay advances each running match on wall clock, and every 50 ticks each seat's
client reports a checksum for the tick boundary it has reached. A peer whose simulation
runs below real time (a large army on a weak device) answers those boundaries late. Nothing
visible happens at first; eventually its report for tick T arrives after match.tick has
passed T + CHECKSUM_REPORT_GRACE_TICKS, integrity counts the slot missing, and three
misses void the match for every seat — from the operator's point of view, out of nowhere.
Seat-lag telemetry makes that drift visible early. For every accepted checksum the relay
records lagTicks = serverTickAtReceipt - T, the seat's simulation deficit plus transport,
per player in that match's terminal match_relay_summary log record (seatLags: last, max,
and an exponentially-weighted trend seeded on the first report with α = 0.2, so one delayed
packet barely moves it). When a seat's latest report reaches SEAT_LAG_WARN_TICKS
(default 150 ticks = 15 s at 10 Hz, half the default grace), the relay logs
{"level":"warn","event":"seat_lagging",...} once per crossing; the edge re-arms only when
a later report returns below half the threshold, so a sustained offender is reported once
rather than every 50-tick boundary. This is observation only: acceptance, comparison, void
thresholds and what any client receives are unchanged by it.
GET /metrics exposes two shard-level gauges over the matches currently loading or running:
domination_seat_lag_max_ticks (worst single-seat value) and
domination_seats_lagging (seats whose latest report is at or over the warn
threshold). Scrape these next to domination_event_loop_delay_p99_ms: a rising
domination_seat_lag_max_ticks against a flat loop delay means clients, not this shard,
are falling behind — the signal for advising smaller armies, pinning the cohort to faster
hardware, moving the match to a less loaded shard, or raising
CHECKSUM_REPORT_GRACE_TICKS deliberately if the trade-off is availability over strict
desync detection. The config keys live in Configuration overrides:
SEAT_LAG_WARN_TICKS.
Command deferral (off by default)
MESSAGE_RATE_PER_SEC/MESSAGE_BURST drop any line that arrives at an empty token
bucket. For a player re-ordering a very large army that loses orders without feedback.
COMMAND_DEFER_ENABLED=1 queues those orders instead, under these rules:
- Eligibility is checked from connection state first: only a connected human seat of
a running match may queue, so a pre-hello, lobby or unseated connection never has
its lines scanned or parsed here and keeps the flag-off drop path at framing cost.
For a seat, a line is queued only when its parsed envelope passes the same JSON
depth/value limits as live traffic and has
type: "command"for that match. Lines over 16 KiB are never queued (a command over 8 KiB is refused at dispatch anyway). Everything else (lobby traffic, pings, malformed envelopes) is rate limited exactly as with the flag off, is never parsed twice, and the exact replay-chunk ACK keeps its bucket exemption. - Orders and checksum reports queue separately. While either queue is non-empty,
every eligible order joins the order queue's tail, so
seqfollows arrival order. Heads are dispatched through the live path whenever a token is available (on the tick scheduler, or as the seat's next line arrives) and removed only after taking that token. - A checksum report (
kind: "checksum") never waits behind orders: it goes live when a token is free and no other report is queued, and otherwise waits in a lane of its own (at most 8 reports of up to 1 KiB per seat, outside the byte budgets below) that drains before the orders every tick. A report has noseqorexecuteTick, so this cannot change lockstep order. A defeated seat that is still connected keeps this lane, because it may owe the report for a checksum cohort frozen before its defeat and the result barrier waits for exactly that report; its other lines take the flag-off path. (Queued behind orders, that report was discarded with them at a surrender, or outlasted the 50-tick result barrier, and the match ended voided with no winner.) - A line that would exceed
COMMAND_DEFER_QUEUE_MAXentries, the connection'sCOMMAND_DEFER_CLIENT_BYTES_MAX, or the process-wideCOMMAND_DEFER_SHARD_BYTES_MAXis a counted rate-limit drop (rate_limitedfeedback,DISCONNECT_AFTER_DROPS) that does not consume a token, so a sustained flood cannot starve the queue. With no token available such a line is dropped before it is parsed. - Each queued line is stored as an exact-size copy of its bytes, so the byte budgets bound the memory the queues hold.
- Startup refuses a configuration where a full order queue takes
checksumReportGraceTicksor longer to drain, so no order lands later than the relay lets a seat's checksum trail the simulation:COMMAND_DEFER_QUEUE_MAX x tickRate / MESSAGE_RATE_PER_SECmust be below the grace (default 256 x 10 / 40 = 64 < 300 ticks). Checksum reports are not bound by this, because they do not wait behind orders. - Both queues are discarded on disconnect,
leaveLobby, and match end or void; the order queue alone is discarded at defeat or surrender.match_relay_summaryreportscommandDefersEnqueued,commandDefersDrained,commandDefersDroppedFullandcommandDeferDiscards(discarded entries by reason:disconnect,leave,defeat,match_end,match_void,seat_recheckfor orders, and the same reasons prefixedchecksum_for reports).
With the flag off the only change on the message path is the flag test itself.
Lockstep timing contract
Protocol 0.1 uses a fixed deterministic simulation rate of 10 Hz. The authoritative command lead
defaults to 3 ticks and accepts only 1–20 ticks. config/server.json deliberately omits
commandLeadTicks, retaining the code-owned default. Invalid timing stops startup before a socket
opens.
The server sends the timing contract in every initial and pre-simulation loading reconnect config.
Clients reject missing or incompatible values and calculate their complete simulation horizon as
serverTick + commandLeadTicks - 1. Running-match reconnect is rejected until authoritative
snapshot recovery is available; command history alone is not a state checkpoint.
Safe shutdown
Use SIGTERM/SIGINT:
sudo systemctl stop domination-server
docker stop -t 150 domination-server
SIGTERM drains first (game#1065). While any match is loading or running with a connected human, the
relay refuses createLobby, joinLobby and startMatch with server_draining, keeps relaying the
live matches, reports "status":"draining" on /status and domination_draining 1 on /metrics,
and drops out of the matchmaker's /lobbies directory. It exits when the last live match ends or
after drainTimeoutSeconds (env DRAIN_TIMEOUT_SECONDS; 120 in config/server.json, 0 = exit at
once), whichever comes first. A second SIGTERM, or SIGINT, exits at once. The stop timeout must
exceed the drain bound or the drain is killed halfway: the Kubernetes Deployment sets
terminationGracePeriodSeconds: 150, domination-server.service sets TimeoutStopSec=150, and a
Docker host needs docker stop -t 150 (the default 10 s would cut every drain short).
Behind an Istio sidecar (the home-lab domination namespace has istio-injection: enabled), the pod's
grace period is not enough. On SIGTERM, istio-proxy drains for its terminationDrainDuration (mesh default
5 s) and then exits, which cuts every proxied game connection long before the relay's drain ends. The
Deployment's pod template must keep the proxy up for the whole drain, for example with
proxy.istio.io/config: '{"terminationDrainDuration": "140s"}' (below the 150 s grace), or with native
sidecar ordering, where the proxy stops after the app container. Until that is set, the relay drains but its
players lose their sockets after about 5 s.
Logged events: server_draining (with liveMatches), then one of server_drain_complete,
server_drain_timeout or server_drain_interrupted.
The server then sends serverShutdown to connected clients and flushes its append-only logs under
/server-data/logs before exiting.