Tournaments
Overview
Automated tournaments are distinct from organizer events. The backend runs signup, pairing, and game creation from TOURNAMENT* records and scheduled public queries.
Record types
| pk | sk | Purpose |
|---|---|---|
TOURNAMENT |
<tournamentid> |
Tournament definition and state |
TOURNAMENTPLAYER |
<tournamentid>#<division>#<playerid> |
Player entry |
TOURNAMENTGAME |
<tournamentid>#<division>#<gameid> |
Linked game |
COMPLETEDTOURNAMENT |
<metaGame>#<tournamentid> |
Archived tournament |
TOURNAMENTSCOUNTER |
<metaGame>#<variants> (single-leg) or …#2 (two-leg) |
Serial number counter per series |
Lifecycle
- Create — auth
new_tournament(organizer). Requires the meta game to supportplayercount: 2in gameslib (playercountsincludes2). OptionalmatchLegs: 2enables two-leg pairings (leg 2 opens when leg 1 ends, with swapped seats). Default is single game per opponent (matchLegs: 1or omitted). - Join / withdraw —
join_tournament,withdraw_tournament. Join is rejected for the same 2-player requirement. - Start —
starttournamentsLambda (EventBridge 10:00/22:00 UTC). Admins can also invoke it for one tournament (including resume after a partial start). Signup tournaments for ineligible games are cancelled (same path as zero participants). - Play — games are normal
GAMErecords linked viaTOURNAMENTGAME. - End — auth
end_tournament; publicarchive_tournamentsmoves completed tournaments.
Two-leg format (matchLegs: 2)
- At start, only leg 1 games are created (same round-robin pairings as single-leg).
divisions.*.numGamescounts both legs (2 ×pairings per division).- When a leg-1 game finishes, the API creates leg 2 for that pairing with reversed seat order.
- Generated game records use
header.roundof1:1and1:2({schedulingRound}:{matchLeg}). Single-leg tournaments remain1.
Public schedulers
These are called by cron or external schedulers (no user auth):
get_tournaments,get_tournament,get_old_tournamentsarchive_tournaments
Player blocking
Tournament pairing and visibility are not affected by player blocking.
Queries
See Public queries and Auth queries tournament sections.
Related
- Events — manual organizer events
- Database schema