pub struct GameSnapshot {Show 16 fields
pub game_id: String,
pub game_type: GameType,
pub state: GameState,
pub grid: Grid,
pub players: Vec<PlayerInfo>,
pub spectators: Vec<SpectatorInfo>,
pub current_turn: i64,
pub round: u8,
pub max_rounds: u8,
pub used_words: Vec<String>,
pub timer_vote_state: TimerVoteState,
pub your_player: Option<PlayerInfo>,
pub timer_expiration_time: Option<DateTime<Utc>>,
pub custom: Option<CustomMeta>,
pub time_remaining_ms: Option<u64>,
pub your_found_words: Option<Vec<String>>,
}Expand description
Complete snapshot of the game state.
Fields§
§game_id: String§game_type: GameTypeWhich mode this game is, so the snapshot is self-describing.
Without this a client has to infer the mode from indirect tells — the lobby games list, the joined pool, or the presence of a per-viewer field. That inference was load-bearing for RuneBox and it read the wrong thing more than once, so the type rides on the snapshot itself.
#[serde(default)] (→ GameType::Unknown) keeps a payload written
before this field existed decodable; it is NOT an invitation to omit
the field when building one. Every construction site must set it, which
is why this is a plain field and not an Option.
state: GameState§grid: Grid§players: Vec<PlayerInfo>§spectators: Vec<SpectatorInfo>§current_turn: i64§round: u8§max_rounds: u8§used_words: Vec<String>§timer_vote_state: TimerVoteState§your_player: Option<PlayerInfo>Your player info (for the receiving client)
timer_expiration_time: Option<DateTime<Utc>>When the turn timer expires (if active)
custom: Option<CustomMeta>Some marks an unranked custom (sandbox) game, mirroring
GameStarted.custom, so the unranked badge survives reconnect/spectate.
time_remaining_ms: Option<u64>Server-authoritative time left in a Daily Challenge run, in milliseconds.
Mirrors GameStarted.time_remaining_ms so a daily run that recovers via
the snapshot/reconnect path keeps its deadline. Omitted otherwise.
your_found_words: Option<Vec<String>>The receiving player’s own found words (RuneBox only).
Restores the word list after a reconnect. The authoritative score
already rides on PlayerInfo, but without this a reconnecting player
sees an empty list and gets a confusing “already found” when
re-submitting a word they had already scored. Omitted for every other
mode, whose found-words concept is the game-global used_words.
Trait Implementations§
Source§impl Clone for GameSnapshot
impl Clone for GameSnapshot
Source§fn clone(&self) -> GameSnapshot
fn clone(&self) -> GameSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more