From b0c481ed62e3c05f6487078788fcd410d1653099 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Tue, 21 Nov 2023 18:33:44 -0800 Subject: [PATCH] fix xbox 64 command on schtserv --- src/ProxyCommands.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ProxyCommands.cc b/src/ProxyCommands.cc index 90a6430a..2b69be13 100644 --- a/src/ProxyCommands.cc +++ b/src/ProxyCommands.cc @@ -1415,6 +1415,10 @@ static HandlerResult S_64(shared_ptr ses, uint16_t, if (ses->sub_version >= 0x40) { cmd = &check_size_t(data, sizeof(S_JoinGame_GC_Ep3_64)); cmd_ep3 = &check_size_t(data); + } else if (ses->version() == GameVersion::XB) { + // Schtserv doesn't send the unknown_a1 field in this command, and we don't + // use it here, so we allow it to be omitted. + cmd = &check_size_t(data.data(), data.size(), sizeof(CmdT) - 0x18, sizeof(CmdT)); } else { cmd = &check_size_t(data); } @@ -1444,8 +1448,7 @@ static HandlerResult S_64(shared_ptr ses, uint16_t, } else { p.name.clear(); } - ses->log.info("Added lobby player: (%zu) %" PRIu32 " %s", - x, p.guild_card_number, p.name.c_str()); + ses->log.info("Added lobby player: (%zu) %" PRIu32 " %s", x, p.guild_card_number, p.name.c_str()); } if (ses->config.override_section_id != 0xFF) {