Module compat

Module compat 

Source
Expand description

Module for converting between legacy and new message formats.

This allows gradual migration without breaking the existing frontend.

Functionsยง

legacy_game_state_to_snapshot
Convert legacy game state JSON to new GameSnapshot format.
parse_client_message
Parse a raw JSON message, handling both legacy and new formats.
serialize_server_message
Serialize a server message, optionally wrapping in an envelope.
snapshot_to_legacy_game_state
Convert new GameSnapshot to legacy game_state message format.