Skip to main content
The SS Integrated Management Server uses Entity Framework Core to manage tournament data. This section documents all database models, their properties, and relationships.

Database Schema

The system is built around several core entities that model a tournament structure:

Entity Relationship Diagram

Database Models

MatchRoom

Represents a scheduled match between two teams in the Elimination Stage

QualifierRoom

Represents a lobby for the Qualifier Stage where multiple players compete

Round

Defines a tournament stage with its rules, map pool, and format

User & Player

User registration linking osu! identity to Discord, and player-specific data

RefereeInfo

Authentication and identity information for tournament referees

ScoreResults

Individual score entries parsed from match results

Entity Relationships Summary

Match Management

  • MatchRoom represents elimination stage matches between two teams
  • QualifierRoom represents qualifier stage lobbies for multiple players
  • Both reference a Round for rules and map pool
  • Both can be assigned a RefereeInfo for management

User System

  • User is the core identity linking Discord and osu! accounts
  • OsuUser stores cached osu! profile data (rank, username)
  • Player extends User with tournament-specific data (availability, qualifier assignment)

Score Tracking

  • ScoreResults stores individual player performance per map
  • Links to both User (player) and Round (tournament stage)

Common Patterns

Foreign Keys

All relationships use Entity Framework navigation properties:
[ForeignKey("RoundId")]
public virtual Round Round { get; set; }

JSON Storage

Complex data structures are stored as JSON in database columns:
  • MatchRoom.BannedMaps and PickedMaps store pick/ban sequences
  • Round.MapPool stores the beatmap pool
  • Player.Availability stores time slot preferences

Match References

Both match types store a reference to the Bancho match:
  • MpLinkId: The numerical ID from https://osu.ppy.sh/community/matches/{MpLinkId}

Database Tables

ModelTable NamePrimary KeyDescription
MatchRoommatch_roomsid (string)Elimination stage matches (e.g., “A1”, “C2”)
QualifierRoomqualifier_roomsid (string)Qualifier stage lobbies
Roundroundsid (int)Tournament stages and rules
Userusersid (int)Registered users
OsuUserosu_userid (int)osu! profile cache
Playerplayersid (int)Tournament participants
RefereeInforefereesid (int)Referee accounts
ScoreResultsN/Aid (int)Match scores

Enumerations

The system uses several enums for type safety:

TeamColor

public enum TeamColor {
    TeamBlue,
    TeamRed,
    None  // For initialization or neutral states
}

BansType

public enum BansType {
    SpanishShowdown = 0,  // Standard snake draft or fixed order
    Other = 1
}

MatchType

public enum MatchType {
    EliminationStage = 0,
    QualifiersStage = 1
}

Nested Types

RoundBeatmap

Defines a beatmap in a round’s map pool:
public class RoundBeatmap {
    public int BeatmapID { get; set; }
    public string Slot { get; set; }  // e.g., "NM1", "HD2", "DT3"
}

RoundChoice

Records a pick or ban action during a match:
public class RoundChoice {
    public string Slot { get; set; }
    public TeamColor TeamColor { get; set; }
    public TeamColor? Winner { get; set; }
}

Build docs developers (and LLMs) love