implement episode 3 battles

This commit is contained in:
Martin Michelsen
2022-11-09 22:48:27 -08:00
parent 8481ba23c5
commit 9f2f0ccc14
41 changed files with 19300 additions and 2891 deletions
+3 -3
View File
@@ -878,9 +878,9 @@ static HandlerResult S_6x(shared_ptr<ServerState>,
string map_data = prs_decompress(
data.data() + sizeof(cmd), data.size() - sizeof(cmd));
save_file(filename, map_data);
if (map_data.size() != sizeof(Ep3Map)) {
if (map_data.size() != sizeof(Episode3::MapDefinition)) {
session.log.warning("Wrote %zu bytes to %s (expected %zu bytes; the file may be invalid)",
map_data.size(), filename.c_str(), sizeof(Ep3Map));
map_data.size(), filename.c_str(), sizeof(Episode3::MapDefinition));
} else {
session.log.info("Wrote %zu bytes to %s", map_data.size(), filename.c_str());
}
@@ -1016,7 +1016,7 @@ static HandlerResult S_13_A7(shared_ptr<ServerState>,
if (sf->f.get()) {
session.log.info("Writing %" PRIu32 " bytes to %s",
cmd.data_size.load(), sf->output_filename.c_str());
fwritex(sf->f.get(), cmd.data, cmd.data_size);
fwritex(sf->f.get(), cmd.data.data(), cmd.data_size);
}
sf->remaining_bytes -= cmd.data_size;