automatically delete tournaments when complete

This commit is contained in:
Martin Michelsen
2022-12-08 17:32:33 -08:00
parent 2eacaa993e
commit 93f42a9398
3 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -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());
}
}
}