Skip to content

feat(game): roster lifecycle controls & optional game completion deadline (PR 4/6) - #49

Open
TimerErTim-Agent wants to merge 1 commit into
feat/shutter-first-capture-offline-queuefrom
feat/roster-lifecycle-and-game-deadline
Open

TimerErTim-Agent wants to merge 1 commit into
feat/shutter-first-capture-offline-queuefrom
feat/roster-lifecycle-and-game-deadline

Conversation

@TimerErTim-Agent

Copy link
Copy Markdown
Collaborator

Stacked on #48 (PR 3/6). Resolves part of #43.

Summary

  • Roster lifecycle: Players can leave in Lobby or Drafting (with host auto-transfer and Drafting-to-Lobby revert if fewer than 3 remain); hosts can kick players, transfer host ownership, or abandon a game (transitions to Completed with Abandoned and no Gold Medal); latecomers can join an active game and receive a starter-deck board.
  • Game completion deadline (endsAt): Optional deadline configurable on create or in Lobby settings; enforced on capture submission and completed automatically by the scheduler (run_finish_expired_games), awarding victory by most filled tiles (tie-breaking on earliest latest capture, drawing with no Gold Medal on 0 captures).
  • Notifications: Emit NearBingoReached when a capture puts a player one tile away from Bingo, render NearBingo / DraftReminder inbox entries, and trigger live in-app toasts on newly arriving unread notifications.

Verification

  • cargo fmt --all && mise run ci exited 0 (unit, conformance, scheduler, migration v0007, E2E + OpenAPI spec validation, Vitest, Biome, TypeScript, and Next/Rust builds).

Implements full roster lifecycle management and the optional game completion deadline:
- Add LeaveGame (auto-transfers host; reverts Drafting to Lobby below 3 players), KickPlayer (cleans authored/targeted drafts; reverts below 3), TransferHost, AbandonGame (Completed without Gold Medal), and late-join into Active play dealing starter-deck boards.
- Add optional ends_at game deadline with FinishExpiredGames scheduler job (most filled tiles wins, ties broken by earliest latest capture, 0 captures draws without Gold Medal) and cutoff check on capture submission.
- Add NearBingoReached notifications and live in-app notification toasts in AppShell.
- Add UI controls for endsAt, Lobby/Drafting/Active roster actions, CompletedPhase deadline/draw/abandoned banners, and Active late-join copy.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant