uno / progress.md
cacodex's picture
Fix auto draw and room deep links
9f14abf verified
|
Raw
History Blame Contribute Delete
3.43 kB

Original prompt: 请你参照uno.html,修改为可以部署在huggingface上并支持多人对战的游戏,要求可以支持抢出相同牌的规则,并支持3-15人在线对战。另外,前端的风格和动画不要改变,不要修改已有的文件。

Implementation notes:

  • Existing uno.html must remain unchanged.
  • Add a new FastAPI/WebSocket/Docker multiplayer implementation beside it.
  • Use uno.html as visual/CSS reference and serve/extract its CSS where practical.
  • Confirmed jump-in rule: strict same card, meaning same color and same value/type.
  • Confirmed room flow: room code.
  • Confirmed bots: host can add bots, and bots also participate in jump-in.
  • Implemented FastAPI/WebSocket backend, new multiplayer frontend, Docker/Space files, and tests.
  • Local verification passed: pytest -q reports 13 passed; python -m py_compile app.py passed.
  • Playwright manual smoke checks covered room creation, Bot fill, gameplay, desktop 15-seat layout, and mobile 15-seat layout with no console errors.
  • Deployed to Hugging Face Space cacodex/uno; upload commit: 86ff9a7c997869892f08ea0a8ade50e5dccf2198.
  • Live checks passed: /healthz, /, /uno-style.css, WebSocket create-room/add-Bot/start/play flow, per-player hand privacy, and deployed frontend feature markers.
  • Added local support for page-refresh reconnect via saved roomCode/playerId/token, plus live rename via a rename WebSocket command.
  • Local verification for reconnect/rename passed: browser smoke test restored the same playing room, same hand, and renamed player after refresh; pytest -q reports 14 passed.
  • Deployment retry for reconnect/rename succeeded; remote HEAD for cacodex/uno is a85300ab8cb9776deea6cf2a6fbdce5ff500e49d.
  • Live checks after retry passed: /healthz returns OK, deployed frontend contains refresh-session and rename handlers, and WebSocket smoke test created a 3-seat game, renamed the host, added 2 Bots, started play, disconnected, reconnected with the same token, restored the same hand, and preserved other players' hand privacy.
  • Online browser smoke test passed: the deployed UI created room RBANS, added 2 Bots, started play, renamed the human player to Browser Reloaded, reloaded the page, restored the same playing room and the same hand IDs, and reported 0 console errors. Screenshot artifact: uno-online-refresh-rename-smoke.png in the Playwright output directory.
  • Final local verification passed: pytest -q reports 14 passed with only FastAPI on_event deprecation warnings.
  • Remaining suggestion: rotate the Hugging Face token that was shared in chat after confirming deployment access, since it is a long-lived secret.
  • Implemented server-authoritative auto draw for human turns with no legal plays, using a 420ms revalidated delay and existing cards_drawn events marked with auto: true / reason: no_playable.
  • Implemented single-segment room deep links such as /ABCDE; unjoined visitors get the room code prefilled without occupying a seat, while saved matching sessions reconnect and successful create/join updates the browser URL.
  • Local verification for auto draw/deep links passed: python -m py_compile app.py, pytest -q reports 19 passed, /ABCDE returns the frontend, browser smoke confirmed unjoined deep link prefill plus /roomCode refresh reconnect, and a live local WebSocket probe caught an automatic draw/skip on attempt 10.