Add persistent tournament management #1

Merged
n-popescu merged 1 commit from codex/tournament-manager into main 2026-10-21 17:27:40 +00:00
n-popescu commented 2026-10-21 17:23:32 +00:00 (Migrated from github.com)

GRID0+ organizers can now announce a tournament, collect linked-account registrations and accepted teammate invitations, choose 1v1 or 2v2 after entry closes, and run a single-elimination best-of-three bracket with stable team, match and game IDs.

Scheduling uses explicit player/organizer timezones and availability, prioritizes the first organizer at equal feasible times, refuses overlapping bookings (including across events), and DMs schedules as opponents become known. Unknown or unavailable slots remain visibly unscheduled. Assigned organizers start/report matches; admins can reschedule, undo an unused result, record forfeits, cancel, inspect the audit trail and retry failed notifications.

State and a notification outbox persist in a private, atomically replaced JSON file. Commands remain guild-locked, account verification fails closed, and ordinary members cannot control tournaments. Idle notification polling does not rewrite or serialize the entire store. Notifications are at-least-once; delivery failures are visible.

Enable with tournaments.store_file; no production configuration was changed. docs/TOURNAMENTS.md explains Discord command permissions, round windows, the complete operator flow, backups and limitations. This manages the tournament, not in-game room creation or automatic prize delivery. The initial formats are 1v1/2v2, single elimination, at most 128 entrants.

Validation:

  • go test ./... and go test -race ./...
  • go vet ./..., git diff --check, executable build and -h smoke check
  • Isolated Discord HTTP and local GRID0+ API tests cover account identity/refusal, admin permissions, invitation acceptance, randomized team preservation, byes, best-of-three duplicate handling, result corrections, timezones/DST, conflict-free scheduling, restart/rollback/concurrency, blocked DMs and queued announcements.

No real Discord messages or tournaments were created during verification. No deployment was performed.

GRID0+ organizers can now announce a tournament, collect linked-account registrations and accepted teammate invitations, choose 1v1 or 2v2 after entry closes, and run a single-elimination best-of-three bracket with stable team, match and game IDs. Scheduling uses explicit player/organizer timezones and availability, prioritizes the first organizer at equal feasible times, refuses overlapping bookings (including across events), and DMs schedules as opponents become known. Unknown or unavailable slots remain visibly unscheduled. Assigned organizers start/report matches; admins can reschedule, undo an unused result, record forfeits, cancel, inspect the audit trail and retry failed notifications. State and a notification outbox persist in a private, atomically replaced JSON file. Commands remain guild-locked, account verification fails closed, and ordinary members cannot control tournaments. Idle notification polling does not rewrite or serialize the entire store. Notifications are at-least-once; delivery failures are visible. Enable with `tournaments.store_file`; no production configuration was changed. `docs/TOURNAMENTS.md` explains Discord command permissions, round windows, the complete operator flow, backups and limitations. This manages the tournament, not in-game room creation or automatic prize delivery. The initial formats are 1v1/2v2, single elimination, at most 128 entrants. Validation: - `go test ./...` and `go test -race ./...` - `go vet ./...`, `git diff --check`, executable build and `-h` smoke check - Isolated Discord HTTP and local GRID0+ API tests cover account identity/refusal, admin permissions, invitation acceptance, randomized team preservation, byes, best-of-three duplicate handling, result corrections, timezones/DST, conflict-free scheduling, restart/rollback/concurrency, blocked DMs and queued announcements. No real Discord messages or tournaments were created during verification. No deployment was performed.
Sign in to join this conversation.
No description provided.