From 287296cf482c72d53d3ad3183053c01fabd9935d Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Fri, 8 Mar 2024 13:42:54 -0800 Subject: [PATCH] fix PCv2 6x7C command --- src/PlayerSubordinates.hh | 39 ++++++++++++++++++++------------------- src/ReceiveSubcommands.cc | 2 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/PlayerSubordinates.hh b/src/PlayerSubordinates.hh index 4bbaf9f4..b34c921f 100644 --- a/src/PlayerSubordinates.hh +++ b/src/PlayerSubordinates.hh @@ -348,13 +348,14 @@ struct ChallengeAwardState { template struct PlayerRecordsDCPC_Challenge { - /* 00 */ le_uint16_t title_color = 0x7FFF; - /* 02 */ parray unknown_u0; - /* 04 */ pstring rank_title; - /* 10 */ parray, 9> times_ep1_online; // TODO: This might be offline times - /* 34 */ uint8_t grave_stage_num = 0; - /* 35 */ uint8_t grave_floor = 0; - /* 36 */ le_uint16_t grave_deaths = 0; + /* DC:PC */ + /* 00:00 */ le_uint16_t title_color = 0x7FFF; + /* 02:02 */ parray unknown_u0; + /* 04:04 */ pstring rank_title; + /* 10:1C */ parray, 9> times_ep1_online; // TODO: This might be offline times + /* 34:40 */ uint8_t grave_stage_num = 0; + /* 35:41 */ uint8_t grave_floor = 0; + /* 36:42 */ le_uint16_t grave_deaths = 0; // grave_time is encoded with the following bit fields: // YYYYMMMM DDDDDDDD HHHHHHHH mmmmmmmm // Y = year after 2000 (clamped to [0, 15]) @@ -362,22 +363,22 @@ struct PlayerRecordsDCPC_Challenge { // D = day // H = hour // m = minute - /* 38 */ le_uint32_t grave_time = 0; - /* 3C */ le_uint32_t grave_defeated_by_enemy_rt_index = 0; - /* 40 */ le_float grave_x = 0.0f; - /* 44 */ le_float grave_y = 0.0f; - /* 48 */ le_float grave_z = 0.0f; - /* 4C */ pstring grave_team; - /* 60 */ pstring grave_message; - /* 78 */ parray, 9> times_ep1_offline; // TODO: This might be online times - /* 9C */ parray unknown_l4; - /* A0 */ + /* 38:44 */ le_uint32_t grave_time = 0; + /* 3C:48 */ le_uint32_t grave_defeated_by_enemy_rt_index = 0; + /* 40:4C */ le_float grave_x = 0.0f; + /* 44:50 */ le_float grave_y = 0.0f; + /* 48:54 */ le_float grave_z = 0.0f; + /* 4C:58 */ pstring grave_team; + /* 60:80 */ pstring grave_message; + /* 78:B0 */ parray, 9> times_ep1_offline; // TODO: This might be online times + /* 9C:D4 */ parray unknown_l4; + /* A0:D8 */ } __attribute__((packed)); -struct PlayerRecordsDC_Challenge : PlayerRecordsDCPC_Challenge { +struct PlayerRecordsDC_Challenge : PlayerRecordsDCPC_Challenge { } __attribute__((packed)); -struct PlayerRecordsPC_Challenge : PlayerRecordsDCPC_Challenge { +struct PlayerRecordsPC_Challenge : PlayerRecordsDCPC_Challenge { } __attribute__((packed)); template diff --git a/src/ReceiveSubcommands.cc b/src/ReceiveSubcommands.cc index fc73a4be..f79e7205 100644 --- a/src/ReceiveSubcommands.cc +++ b/src/ReceiveSubcommands.cc @@ -3309,7 +3309,7 @@ static void on_challenge_update_records(shared_ptr c, uint8_t command, u break; } case Version::PC_V2: { - const auto& cmd = check_size_t(data, size); + const auto& cmd = check_size_t(data, size); p->challenge_records = cmd.records; break; }