feat: WS sends selected_game_id on connect, gear indicator auto-adapts to game mapping (Forza/AC/iRacing)

This commit is contained in:
2026-07-25 16:29:00 +08:00
parent 636801b6a3
commit 7959d911e6
3 changed files with 68 additions and 19 deletions
+6 -1
View File
@@ -84,7 +84,12 @@ async def scene_render(request: Request, scene_id: str):
async def websocket_endpoint(ws: WebSocket):
cid = await ws_manager.connect(ws)
try:
await ws.send_json({"type": "connected", "client_id": cid})
cfg = get_config()
await ws.send_json({
"type": "connected",
"client_id": cid,
"selected_game_id": cfg.get("selected_game_id"),
})
while True:
msg = await ws.receive_json()
if msg.get("type") == "ping":