Skip to main content

Module rooms

Module rooms 

Source
Expand description

Wire DTOs for the Online Tournament rooms API.

The physical module is [crate::game_storage]’s online::rooms; this re-export provides the supreme_fs::rooms path, so consumers (launcher, hook proxy) can share the types while supreme_fs stays independent of supreme_tournament (and vice versa).

Structs§

RoomDto
Full room state as returned by room_create, room_get and room_join.
RoomIdentity
A logged-in account’s identity, attached additively to room actions (user_id + auth_key body fields; None = guest). The server verifies the pair and stamps the account on the room/record; guests keep working unchanged and may not use a registered nickname.
RoomRecordDto
One room record: the best replay .dat of a single player in a room. hash is the CAS sha256 of the uploaded .dat.
RoomSummaryDto
Lightweight room entry as returned by room_list (every room whose ends_at is in the future, including not-yet-started rooms, which the launcher shows as unselectable until they go live).
RoomUploadResult
Result of room_upload_record. accepted: false means the server kept the player’s existing (better or equal) personal best, a successful response, not an error.

Functions§

high_times_entries_from_records
Render the high-times entries for a room’s records LOCALLY (local fallback for servers predating room_high_times): every valid record (positive time_ticks, non-empty hash), per-player best only, ascending by (time_ticks, player, hash), the same ordering as [supreme_tournament::rank_records] and the server-side renderer, so a fallback file can never disagree with a server-rendered one about rank order.
room_remove_payload
The room_remove JSON body (pure, so the wire shape is unit-testable): {id, player} plus the account identity fields when the caller is logged in.