Based on the code analysis, the Playoff system in this codebase is a season-bound, manually seeded bracket system with a built-in Map Ban/Pick phase.
Unlike the automated Swiss-style matchmaking used for the regular season, Playoffs require specific Administrative intervention to move from one round to the next.
Here is the full lifecycle of a Playoff:
Before playoffs start, an Admin must configure the season.
- Route:
/manage_playoffs(inroutes/adminDashboard.js) - Action: The admin selects a Season and defines:
- Format: "Tournament" or "Rounds".
- Num Rounds: (e.g., 3 for Quarter/Semi/Finals).
- Double Elimination: Yes/No (stored as
0or1).
- Database: This creates a row in the
playoffstable linking to theseasonstable.
The system does not automatically seed teams based on standings. An Admin must manually create the bracket matchups.
- Route:
/admin/create_match_set(inroutes/adminMatches.ts) - UI: In the Admin panel > Create Matches tab.
- Process:
- Admin toggles "Playoff Match" checkbox.
- Selects the Region, Season, and Playoff Round (e.g., "Upper Round 1").
- Selects Best of Series (Bo1, Bo3, Bo5, Bo7).
- Selects a Map Ban Pool.
- Crucial Step: The Admin manually selects
Home TeamvsAway Teamfrom dropdowns for every match in that round.
- Output: Creates rows in the
matchestable withplayoffIdpopulated andstatus = 0(Unplayed). It also creates placeholder rows in thegamestable (e.g., 3 games for a Bo3) witharenaIdset to null (TBD).
Before the match is played, teams must determine which maps (Arenas) they will play.
- Route:
/match_page/:matchid/map-action(inroutes/matches.ts) - Logic:
- The system checks
match_map_bansto see whose turn it is. - Bo3 Pattern: Away Ban → Home Ban → Home Pick → Away Pick → Away Ban → Home Pick.
- Bo5 Pattern: Away Ban → Home Ban → Home Pick → Away Pick → Away Ban → Home Pick → Away Pick → Home Pick.
- The system checks
- Effect: When a team Picks a map, the system updates the
gamestable.- Example: If Team A picks "Badlands" as the 1st pick, the system updates
Game 1in the database to setarenaIdto the ID for Badlands.
- Example: If Team A picks "Badlands" as the 1st pick, the system updates
- Route:
/match_page/:matchid/update-scores - Process:
- Teams play the maps determined in the Veto phase.
- Scores are reported per map (Game).
- Winner Calculation:
- The system tallies the wins. If a team wins 2 maps in a Bo3, they are declared the winner.
- If a match is finished (e.g., 2-0 in a Bo3), the system automatically marks the unplayed 3rd game as null/void.
- Database Update: The
matchestable is updated withwinnerId,winnerScore(series score, e.g., 2), andloserScore(e.g., 1).
There is no automatic bracket advancement. The code does not automatically move the winner of Match A to Match C.
- Logic:
- The Admin views the results of "Upper Round 1".
- The Admin goes back to Create Match Set.
- The Admin changes the dropdown to "Upper Round 2".
- The Admin manually selects the winning teams from the previous round to face each other.
- This process repeats for Semi-Finals and Grand Finals.
There is a separate, distinct system for "World Championships" located in routes/worldChampionships.ts. This seems to be a newer or specialized implementation separate from the standard Season/League loop.
- Separate Tables: Uses
championship,championship_match,championship_participant. - UI: Uses a specific view
WorldChampionship.ejswith tabs for Day 1 / Day 2 / Qualifiers. - Logic: It allows for more complex visual representations (groups stages, specific bracket rendering) but still relies heavily on Admin input to set winners and create specific match instances.