Race state websocket #4
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#5 Live race telemetry in the game-state feed
mintopia/blur
#2 Game-state feed
mintopia/blur
Reference
mintopia/blur#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
External apps can connect to a local websocket server the game opens when
BLUR_STATE_WS=<port>is set (off by default, localhost only). On connect a client gets a JSON snapshot of the game-state feed, then a JSON message for every change. The message format is documented.Acceptance criteria
BLUR_STATE_WSset, a websocket client (e.g.websocat) gets a snapshot on connect, then changes as the player moves through menus/events/lobbiesBLUR_ENGINE=recompBlocked by
Implemented.
BLUR_STATE_WS=<port>starts a Network.framework websocket server bound to 127.0.0.1 only (src/host/state_ws.mm); unset = no listener. On connect:{"type":"snapshot","state":{...}}, then{"type":"change","key":..,"value":..}per change (format indocs/state-websocket.md, env var in README). Multiple clients supported; disconnects dont affect the game. Verified onBLUR_ENGINE=recompviamdrive.py mp_menus: snapshot + live screen/mode changes received,lsofshows only127.0.0.1:portlistening, second client connect/kill left game and first client running. Unit teststate_ws_testadded (ctest state_ws passes). Lobby/event-track keys come from the existing #2 feed and were not exercised by this menu plan.Completed and merged by Harmonic (task 7).