use Ep3 NTE command formats

This commit is contained in:
Martin Michelsen
2024-02-08 01:02:23 -08:00
parent 729d9af4b0
commit dcea0e4520
3 changed files with 59 additions and 26 deletions
+11 -2
View File
@@ -3063,7 +3063,8 @@ void send_ep3_game_details(shared_ptr<Client> c, shared_ptr<Lobby> l) {
}
}
void send_ep3_set_tournament_player_decks(shared_ptr<Client> c) {
template <typename CmdT>
void send_ep3_set_tournament_player_decks_t(shared_ptr<Client> c) {
auto s = c->require_server_state();
auto l = c->require_lobby();
@@ -3073,7 +3074,7 @@ void send_ep3_set_tournament_player_decks(shared_ptr<Client> c) {
throw runtime_error("tournament is deleted");
}
G_SetTournamentPlayerDecks_Ep3_6xB4x3D cmd;
CmdT cmd;
cmd.rules = tourn->get_rules();
cmd.map_number = tourn->get_map()->map_number;
cmd.player_slot = 0xFF;
@@ -3186,6 +3187,14 @@ void send_ep3_tournament_match_result(shared_ptr<Lobby> l, uint32_t meseta_rewar
}
}
void send_ep3_set_tournament_player_decks(shared_ptr<Client> c) {
if (c->version() == Version::GC_EP3_NTE) {
send_ep3_set_tournament_player_decks_t<G_SetTournamentPlayerDecks_Ep3NTE_6xB4x3D>(c);
} else {
send_ep3_set_tournament_player_decks_t<G_SetTournamentPlayerDecks_Ep3_6xB4x3D>(c);
}
}
void send_ep3_update_game_metadata(shared_ptr<Lobby> l) {
size_t total_spectators = 0;
for (auto watcher_l : l->watcher_lobbies) {