add default values for all command structs

This commit is contained in:
Martin Michelsen
2023-10-28 10:29:37 -07:00
parent ef939075ef
commit 87cae99326
3 changed files with 524 additions and 520 deletions
+3 -1
View File
@@ -7,7 +7,6 @@
- Implement choice search
- Write a simple status API
- Implement per-game logging
- Add default values in all command structures (like we use for Episode 3 battle commands)
- Check for RCE potential in 6x6B-6x6E commands
- Build an exception-handling abstraction in ChatCommands that shows formatted error messages in all cases
- Make reloading happen on separate threads so compression doesn't block active clients
@@ -16,6 +15,9 @@
- Figure out what causes the corruption message on PC proxy sessions and fix it
- Enable item tracking in battle/challenge games (everything should already be set up for it to work)
- Rewrite REL-based parsers so they don't assume any fixed offsets
- Make $edit for DC/PC and attempt to repro disconnect issue with higher-level char
- Look into double item drop from boxes in server drop mode
- Handle DC NTE broadcast commands (see Sylverant subcmd_dcnte_handle_bcast)
## Episode 3
+518 -515
View File
File diff suppressed because it is too large Load Diff
+3 -4
View File
@@ -517,10 +517,9 @@ void send_guild_card_chunk_bb(shared_ptr<Client> c, size_t chunk_index) {
cmd.unknown = 0;
cmd.chunk_index = chunk_index;
memcpy(
cmd.data,
cmd.data.assign_range(
reinterpret_cast<const uint8_t*>(&c->game_data.account()->guild_cards) + chunk_offset,
data_size);
data_size, 0);
send_command(c, 0x02DC, 0x00000000, &cmd, sizeof(cmd) - sizeof(cmd.data) + data_size);
}
@@ -597,7 +596,7 @@ void send_stream_file_chunk_bb(shared_ptr<Client> c, uint32_t chunk_index) {
throw runtime_error("client requested chunk beyond end of stream file");
}
size_t bytes = min<size_t>(contents->size() - offset, sizeof(chunk_cmd.data));
memcpy(chunk_cmd.data, contents->data() + offset, bytes);
chunk_cmd.data.assign_range(reinterpret_cast<const uint8_t*>(contents->data() + offset), bytes, 0);
size_t cmd_size = offsetof(S_StreamFileChunk_BB_02EB, data) + bytes;
cmd_size = (cmd_size + 3) & ~3;