fix some tournament state bugs

This commit is contained in:
Martin Michelsen
2022-12-08 18:38:46 -08:00
parent 5f04cbaecb
commit bdff48c343
4 changed files with 57 additions and 21 deletions
+11
View File
@@ -131,6 +131,8 @@ Server commands:\n\
dice-boost=ON/OFF: Enable/disable dice boost\n\
start-tournament \"Tournament Name\"\n\
End registration for a tournament and allow matches to begin.\n\
tournament-state \"Tournament Name\"\n\
Print the current state of a tournament.\n\
\n\
Proxy commands (these will only work when exactly one client is connected):\n\
sc <data>\n\
@@ -415,6 +417,15 @@ Proxy commands (these will only work when exactly one client is connected):\n\
fprintf(stderr, "no such tournament exists\n");
}
} else if (command_name == "tournament-status") {
string name = get_quoted_string(command_args);
auto tourn = this->state->ep3_tournament_index->get_tournament(name);
if (tourn) {
tourn->print_bracket(stderr);
} else {
fprintf(stderr, "no such tournament exists\n");
}
// PROXY COMMANDS