automatically delete tournaments when complete
This commit is contained in:
@@ -1058,7 +1058,12 @@ static void on_ep3_server_data_request(shared_ptr<ServerState> s, shared_ptr<Cli
|
||||
} else {
|
||||
throw logic_error("invalid winner team id");
|
||||
}
|
||||
send_ep3_tournament_match_result_result(l, l->tournament_match);
|
||||
send_ep3_tournament_match_result(l, l->tournament_match);
|
||||
|
||||
auto tourn = l->tournament_match->tournament.lock();
|
||||
if (tourn && (tourn->get_state() == Episode3::Tournament::State::COMPLETE)) {
|
||||
s->ep3_tournament_index->delete_tournament(tourn->get_number());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2101,7 +2101,7 @@ void send_ep3_set_tournament_player_decks(
|
||||
// TODO: Handle disconnection during the match (the other team should win)
|
||||
}
|
||||
|
||||
void send_ep3_tournament_match_result_result(
|
||||
void send_ep3_tournament_match_result(
|
||||
shared_ptr<Lobby> l, shared_ptr<const Episode3::Tournament::Match> match) {
|
||||
auto tourn = match->tournament.lock();
|
||||
if (!tourn) {
|
||||
|
||||
+1
-1
@@ -322,7 +322,7 @@ void send_ep3_set_tournament_player_decks(
|
||||
std::shared_ptr<Lobby> l,
|
||||
std::shared_ptr<Client> c,
|
||||
std::shared_ptr<const Episode3::Tournament::Match> match);
|
||||
void send_ep3_tournament_match_result_result(
|
||||
void send_ep3_tournament_match_result(
|
||||
std::shared_ptr<Lobby> l,
|
||||
std::shared_ptr<const Episode3::Tournament::Match> match);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user