DocsHostingTools and services

Live status for panels

Each server writes data/<server>/status.json, for panels and monitoring that read files rather than talk to the console. It's written when what it says changes, such as a player joining or leaving, the phase, the game or the queue, at most every 2 seconds, and at least once a minute while nothing does, so an idle server hardly touches the disk. dedicated status reads the same file, and takes a server whose file is older than 90 seconds, or gone, as not running.

data/<server>/status.json
{
  "name": "Community Rotation",
  "address": "203.0.113.4:49176",
  "map": "Guardian",
  "mode": "Slayer",
  "state": "playing",
  "players": [
    { "number": 1, "name": "Bravo", "id": "0123…cdef", "handle": "…", "address": "198.51.100.7:51234", "admin": false, "guests": ["Bravo 2"] }
  ],
  "max_players": 16,
  "pid": 4312,
  "updated": 1793440610,
  "reported": 3,
  "game": 1,
  "played": 4
}
  • state is lobby, voting, countdown, loading, playing or post-game.
  • A player's id is their network key, not the player ID their profile shows, and address is their address with its port. Tools written for 0.9 keyed on its player IDs and its ip field need to change.
  • guests are the split-screen players at that PC: they count against max_players, and appear only there.
  • updated is Unix seconds, reported how many games this process reported to the stats service, game the playlist's game being played or waited for, from 0, and played how many games this process started.
  • updated can be up to 60 seconds old on a running server. A tool that took a status older than 30 seconds for a stopped server must now allow 90.
  • The file also carries the server's phase (lobby, voting, countdown, loading, in_game or post_game) with phase_since, each player's role, who waits in the join queue as join_queue, and health: the version, uptime, players, frame rate and frame times over the last minute, upload and download, and memory_mb. These are as fresh as the last write.
  • health also has the ticks: ticks_per_second played and game_tick_rate, the share of frames that played no tick, one, or two and more, tick times (tick_ms_p50, tick_ms_p99, tick_ms_max), what each part of a frame takes (frame_area_ms), seconds_behind_last_minute, falling_behind, and effective: the settings the server really runs with. Frames are not ticks: a busy server can play 30 frames a second at 60 ticks, two ticks a frame.
  • memory is the server's memory once its last game ended: resident_mib, this_game_mib, since_start_mib, engine_heap_mib and games. It changes only when a game ends.
  • bots counts bots apart from people. The people hold the places; a bot never does.
  • For live figures, ask the remote console's health, or set metrics_http = "127.0.0.1:9310" in a [[server]]: GET /health then answers the same as JSON and GET /metrics as Prometheus text (reclaimer_frame_rate_hz, reclaimer_frame_ms_p99, reclaimer_players, reclaimer_ticks_per_second, reclaimer_falling_behind, reclaimer_memory_megabytes and more). It takes a loopback address only, since it has no password.
  • The player count a server advertises, in the Server Browser, /health and the console's status, counts a connection that hasn't joined the game for 30 seconds only, so connections that never join don't make a server look fuller than it is. players and this file still list every connection.
  • The file is replaced whole, so a reader never sees half of it.