diff --git a/src/CommandFormats.hh b/src/CommandFormats.hh index 63e9e591..b18bc49a 100644 --- a/src/CommandFormats.hh +++ b/src/CommandFormats.hh @@ -2099,6 +2099,12 @@ struct C_SetBlockedSenders_BB_C6 : C_SetBlockedSenders_C6<28> { } __packed__; // This command is not valid on Episode 3 Trial Edition. // header.flag determines the client's registration state - 1 if the client is // registered for the tournament, 0 if not. +// This command controls what's shown in the Check Tactics pane in the pause +// menu. If the client is registered (header.flag==1), the option is enabled and +// the bracket data in the command is shown there, and a third pane on the +// Status item shows the other information (tournament name, ship name, and +// start time). If the client is not registered, the Check Tactics option is +// disabled and the Status item has only two panes. struct S_ConfirmTournamentEntry_GC_Ep3_CC { ptext tournament_name; diff --git a/src/ProxyCommands.cc b/src/ProxyCommands.cc index 6435a41a..0ecc4ebc 100644 --- a/src/ProxyCommands.cc +++ b/src/ProxyCommands.cc @@ -890,7 +890,21 @@ static HandlerResult S_6x(shared_ptr, } } + bool modified = false; if (!data.empty()) { + // Unmask any masked Episode 3 commands from the server + if ((session.version == GameVersion::GC) && (data.size() > 8) && + ((static_cast(data[0]) == 0xB3) || + (static_cast(data[0]) == 0xB4) || + (static_cast(data[0]) == 0xB5))) { + const auto& header = check_size_t( + data, sizeof(G_CardBattleCommandHeader), 0xFFFF); + if (header.mask_key) { + set_mask_for_ep3_game_command(data.data(), data.size(), 0); + modified = true; + } + } + if (data[0] == 0x46) { const auto& cmd = check_size_t(data, offsetof(G_AttackFinished_6x46, entries), @@ -962,7 +976,7 @@ static HandlerResult S_6x(shared_ptr, } } - return HandlerResult::Type::FORWARD; + return modified ? HandlerResult::Type::MODIFIED : HandlerResult::Type::FORWARD; } template