Skip to main content

Module tournament_selection

Module tournament_selection 

Source
Expand description

The per-mod tournament selection state, NO extra file.

The selection lives in the mod’s own active configuration (the mods.json entries the launcher already writes and the hook resolver already merges):

  • tournament_room_id, non-empty = a selection exists; the enable_if-gated managed rules interpolate it into their URLs;
  • tournament_env / tournament_difficulty / tournament_player, the launcher-set values the rules’ remote/push_url interpolate;
  • tournament_room_name / tournament_starts_at / tournament_ends_at, display + play-gating values (rooms have a name and a planning window; a room that has not started yet or has expired must not start the game).

Everything here reads that map. Writing it is the tournament page’s job (same mechanism as any parameter edit, mods_tasks::persist_mod_configurations).

Structs§

TournamentSelection
One mod’s current tournament selection, read from its active configuration. None when no room is selected (tournament_room_id empty or absent).

Constants§

TOURNAMENT_ENDS_AT_CFG
when the selected room closes (epoch seconds, UTC).
TOURNAMENT_ONLINE_CFG
the mod’s own play-online toggle (declared, user-facing): when off, the whole tournament flow goes dormant and the mod’s offline rules take over (vanilla main menu with the room list).
TOURNAMENT_ROOMS_CFG
the launcher-computed room list the offline main-menu patch interpolates: "Name (records), ...", soonest-expiring room first.
TOURNAMENT_ROOM_ID_CFG
The configuration key carrying the selected room id (the mod’s own parameter id, declared, but hidden from the UI since ).
TOURNAMENT_ROOM_NAME_CFG
display name of the selected room (launcher-written; no rule interpolates it, it exists so the UI never has to show the room id).
TOURNAMENT_STARTS_AT_CFG
when the selected room opens for play (epoch seconds, UTC).

Functions§

format_tournament_when
Formats an epoch value as local time for UI display (2026-10-23 18:00).
is_online
Whether the mod’s active configuration plays online (the tournament_online toggle). true when the key is absent: the mod defaults to online and older configurations predate the toggle.
validate_player_name
The player-name field’s contract: 1 to 9 ASCII letters. The name travels inside every replay .dat and lands in the game’s high-times table, so it stays as narrow as the game’s own name handling needs. Returns the trimmed name, or the reason an input was refused.