[Protocol] Share tournament messages and report draws explicitly

- TournamentPlayer/TournamentPairing/TournamentSettings move into
  serverinfo_tournament.proto, imported by both the tournament event and
  the tournament game commands, so Command_CreateGame reaches them without
  crossing the command/event boundary
- Command_CreateGame carries the full TournamentSettings instead of a
  duplicate games_per_match field, keeping game creation and mid-game
  changes on one wire representation
- draw results are explicit: Command_ReportMatchResult and
  TournamentPairing gain is_draw, so a report stays distinguishable from
  an unset -1 winner
- pairing match-wins are uint32 like the other game counts
This commit is contained in:
Lukas Brübach 2026-09-02 08:43:25 +02:00 committed by GitHub
parent e82b311c8b
commit dca6fdf17f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 45 additions and 27 deletions

View file

@ -1,6 +1,6 @@
syntax = "proto2";
import "game_commands.proto";
import "event_tournament_state.proto";
import "serverinfo_tournament.proto";
message Command_ReportMatchResult {
extend GameCommand {
@ -8,7 +8,12 @@ message Command_ReportMatchResult {
}
optional sint32 game_id = 1 [default = -1];
// The winning player's ID. A drawn match is reported with is_draw set and
// winner_id left unset so a missing report stays distinguishable from a
// reported draw via has_winner_id().
optional sint32 winner_id = 2 [default = -1];
// Whether the match ended in a draw; winner_id is meaningless then.
optional bool is_draw = 3;
}
message Command_AdvanceTournament {
@ -23,4 +28,4 @@ message Command_TournamentSettingsSelect {
}
optional TournamentSettings settings = 1;
}
}