Game System Overview
Understanding how the game system works and how games relate to matches
Game System Overview
The game system automatically creates game slots when matches are created and allows you to import games individually from Riot's API.
How Games Work
Games vs Matches
- Match: A competition between two teams (e.g., "Team A vs Team B")
- Game: An individual League of Legends game within a match
For example:
- A Best of 3 match has 3 game slots
- Each game is a separate League of Legends match
- Games are imported one at a time as they finish
Automatic Game Creation
When you create a match, the system automatically creates game slots based on the best_of value:
- Best of 1: 1 game slot
- Best of 3: 3 game slots
- Best of 5: 5 game slots
- Best of 7: 7 game slots
Each game slot is created with:
- A unique game number (1, 2, 3, etc.)
- A
pendingstate - A unique tournament code (if tournament is linked to Riot)
Game States
Games can have one of four states:
Pending (Yellow)
- Game hasn't been played yet
- Ready to be imported
- Shows in admin UI with "Import Game" button
Completed (Green)
- Game has been imported from Riot's API
- Contains full statistics and participant data
- Match score is updated based on game result
Skipped (Gray)
- Game was not needed (match ended early)
- Automatically marked when match completes
- Cannot be imported
In Progress (Blue)
- Game is currently being played
- Rarely used, mostly for manual tracking
Tournament Codes
Each game has its own unique tournament code:
- Generated automatically when games are created (if tournament is linked to Riot)
- Used to link games to Riot's tournament system
- Displayed in the admin UI for reference
Importing Games
Games can be imported individually:
- Navigate to Match Management
- Expand the match to see all games
- Click "Import Game" for the game you want to import
- Enter the Riot Game ID and region
- Game data is fetched and stored
See Importing Games for detailed instructions.
Auto-Skip Unused Games
When a match completes early (e.g., a team wins 2-0 in a Best of 3), the system automatically:
- Marks the match as "Completed"
- Marks all remaining pending games as "Skipped"
- Prevents those games from being imported
This ensures you don't accidentally import games that weren't needed.
Match Completion Logic
A match is considered complete when a team reaches the required number of wins:
- Best of 1: 1 win needed
- Best of 3: 2 wins needed
- Best of 5: 3 wins needed
- Best of 7: 4 wins needed
Once a team reaches the required wins, the match is automatically marked as "Completed" and remaining games are skipped.
Riot Callback Integration
If you have Riot webhooks configured, games can be imported automatically:
- When a game finishes, Riot sends a callback to your server
- The system finds the correct game slot (by tournament code or game number)
- The game is automatically imported and marked as "Completed"
- Match completion is checked and unused games are skipped
Benefits
The game system provides:
- Better Organization: Each game is tracked individually with its own data
- Clearer Progress: You can see exactly which games have been played
- Automatic Management: Unused games are automatically handled
- Individual Control: Import games one at a time as they finish
- Better Data: Each game has its own statistics and participant data