import uuid from pydantic import BaseModel from app.models import Mode class QueueJoinRequest(BaseModel): callsign: str mode: Mode class QueueJoinResponse(BaseModel): ticket_id: uuid.UUID status: str class QueueStatusResponse(BaseModel): ticket_id: uuid.UUID status: str server_ip: str | None = None server_port: int | None = None team: int | None = None class ServerRegisterRequest(BaseModel): ip: str port: int mode: Mode player_count: int = 0 max_players: int = 50 # See GameServer.game_mode/map_name in app/models.py -- the in-match # GameMode id and map display name, distinct from `mode` (queue mode). game_mode: str = "team_deathmatch" map_name: str = "Sector Alpha" class PlayerStatsResponse(BaseModel): callsign: str mmr: int wins: int losses: int kills: int deaths: int hours_played: float ram_kb: int # Reported by the hosting game server (never a client directly -- see # spacewar/autoload/network_manager.gd's register_server()/heartbeat being # server-only-triggered the same way) once a match's MatchManager POST_MATCH # phase begins. team here is a race_id (races double as teams, see # menu/team_select.gd's RACES), not a 0/1 index. class MatchPlayerResult(BaseModel): callsign: str team: int kills: int deaths: int is_winner: bool seconds_played: float class MatchReportRequest(BaseModel): server_ip: str server_port: int mode: Mode = Mode.casual winner_team: int | None = None # None = draw players: list[MatchPlayerResult]