feat(server): generic game engine — GameRound interface + orchestration loop #3

Merged
ayoub merged 1 commit from feature/game-engine into dev 2026-06-08 13:30:49 +00:00
Owner
  • game/round.ts: GameRound contract (start/submitAnswer/reveal/score) +
    RoundContext + RoomGameController (decouples room from engine)
  • game/registry.ts: register/createRound — adding a mode = one registerRound
  • game/engine.ts: server-authoritative orchestration. Per round:
    start → broadcast round:start → wait (timer OR all eligible voted) →
    reveal → apply score deltas → score:update; then game:end. DJ counts as
    eligible voter; round ends on first condition met.
  • handlers: game:start (host-only, validates rounds/modes) + round:vote
    wired to the engine
  • shared: add game:start client event
  • engine.test.ts: covers both end conditions + voteAck (bun test)
  • turbo/root: add test task

Roadmap V1 step 3. No UI yet — concrete quiz mode + client come in step 4.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

- game/round.ts: GameRound contract (start/submitAnswer/reveal/score) + RoundContext + RoomGameController (decouples room from engine) - game/registry.ts: register/createRound — adding a mode = one registerRound - game/engine.ts: server-authoritative orchestration. Per round: start → broadcast round:start → wait (timer OR all eligible voted) → reveal → apply score deltas → score:update; then game:end. DJ counts as eligible voter; round ends on first condition met. - handlers: game:start (host-only, validates rounds/modes) + round:vote wired to the engine - shared: add game:start client event - engine.test.ts: covers both end conditions + voteAck (bun test) - turbo/root: add test task Roadmap V1 step 3. No UI yet — concrete quiz mode + client come in step 4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ayoub self-assigned this 2026-06-08 13:30:40 +00:00
ayoub added 1 commit 2026-06-08 13:30:41 +00:00
- game/round.ts: GameRound contract (start/submitAnswer/reveal/score) +
  RoundContext + RoomGameController (decouples room from engine)
- game/registry.ts: register/createRound — adding a mode = one registerRound
- game/engine.ts: server-authoritative orchestration. Per round:
  start → broadcast round:start → wait (timer OR all eligible voted) →
  reveal → apply score deltas → score:update; then game:end. DJ counts as
  eligible voter; round ends on first condition met.
- handlers: game:start (host-only, validates rounds/modes) + round:vote
  wired to the engine
- shared: add game:start client event
- engine.test.ts: covers both end conditions + voteAck (bun test)
- turbo/root: add test task

Roadmap V1 step 3. No UI yet — concrete quiz mode + client come in step 4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ayoub merged commit eb7e9a20d1 into dev 2026-06-08 13:30:49 +00:00
ayoub deleted branch feature/game-engine 2026-06-08 13:30:49 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ayoub/nerdware#3
No description provided.