don't skip server data commands before battle start

This commit is contained in:
Martin Michelsen
2024-04-28 13:56:16 -07:00
parent 29f200b83e
commit 29320f0858
6 changed files with 92 additions and 24 deletions
+13 -9
View File
@@ -1588,16 +1588,20 @@ static void on_CA_Ep3(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
bool battle_finished_before = l->ep3_server->battle_finished;
try {
l->ep3_server->on_server_data_input(c, data);
} catch (const exception& e) {
c->log.error("Episode 3 engine returned an error: %s", e.what());
if (l->battle_record) {
string filename = string_printf("system/ep3/battle-records/exc.%" PRIu64 ".mzrd", now());
save_file(filename, l->battle_record->serialize());
c->log.error("Saved partial battle record as %s", filename.c_str());
if (s->catch_handler_exceptions) {
try {
l->ep3_server->on_server_data_input(c, data);
} catch (const exception& e) {
c->log.error("Episode 3 engine returned an error: %s", e.what());
if (l->battle_record) {
string filename = string_printf("system/ep3/battle-records/exc.%" PRIu64 ".mzrd", now());
save_file(filename, l->battle_record->serialize());
c->log.error("Saved partial battle record as %s", filename.c_str());
}
throw;
}
throw;
} else {
l->ep3_server->on_server_data_input(c, data);
}
// If the battle has finished, finalize the recording and link it to all