Multiplayer: per-player snapshot + shared market view (step 8/12) #112

Closed
opened 2026-09-22 10:31:36 +02:00 by kamilkrzywda · 0 comments
Owner

Part of the #101 multiplayer plan.

Rework getStateSnapshot() in lib/game/state.ts and GET /api/state: own planes/cash/reputation, all open packages with carrier name (join via planes.owner_id), other players' planes if visibility is enabled (decision point from #101). Update StateSnapshot types and the left/right panes to render owner info.

NOTE (2026-09-23): state now reaches clients over BOTH GET /api/state and SSE push (app/api/events/route.ts; broadcastState() after each tick since v0.57.0) - keep both in sync, the sseFrame() projection sits next to getStateSnapshot(). Open packages are already filtered to pool airports only (v0.65.0 per-airport pools).

Part of the #101 multiplayer plan. Rework getStateSnapshot() in lib/game/state.ts and GET /api/state: own planes/cash/reputation, all open packages with carrier name (join via planes.owner_id), other players' planes if visibility is enabled (decision point from #101). Update StateSnapshot types and the left/right panes to render owner info. NOTE (2026-09-23): state now reaches clients over BOTH GET /api/state and SSE push (app/api/events/route.ts; broadcastState() after each tick since v0.57.0) - keep both in sync, the sseFrame() projection sits next to getStateSnapshot(). Open packages are already filtered to pool airports only (v0.65.0 per-airport pools).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/Flight-Ops#112