diff --git a/src/Client.cc b/src/Client.cc index 5619ecfe..27600c71 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -24,6 +24,15 @@ static atomic next_id(1); void Client::Config::set_flags_for_version(Version version, int64_t sub_version) { this->set_flag(Flag::PROXY_CHAT_COMMANDS_ENABLED); + // BB shares some sub_version values with GC Episode 3, so we handle it + // separately first. + if (version == Version::BB_V4) { + this->set_flag(Flag::NO_D6); + this->set_flag(Flag::SAVE_ENABLED); + this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH); + return; + } + switch (sub_version) { case -1: // Initial check (before sub_version recognition) switch (version) { @@ -55,11 +64,6 @@ void Client::Config::set_flags_for_version(Version version, int64_t sub_version) this->set_flag(Flag::NO_D6_AFTER_LOBBY); this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH); break; - case Version::BB_V4: - this->set_flag(Flag::NO_D6); - this->set_flag(Flag::SAVE_ENABLED); - this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH); - break; default: throw logic_error("invalid game version"); } @@ -108,7 +112,7 @@ void Client::Config::set_flags_for_version(Version version, int64_t sub_version) this->set_flag(Flag::NO_D6_AFTER_LOBBY); this->set_flag(Flag::NO_SEND_FUNCTION_CALL); break; - case 0x40: // GC Ep3 JP and Trial Edition + case 0x40: // GC Ep3 JP and Trial Edition (and BB) this->set_flag(Flag::NO_D6_AFTER_LOBBY); this->set_flag(Flag::ENCRYPTED_SEND_FUNCTION_CALL); this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH); @@ -116,7 +120,7 @@ void Client::Config::set_flags_for_version(Version version, int64_t sub_version) // instead look at header.flag in the 61 command and set the // IS_EP3_TRIAL_EDITION flag there. break; - case 0x41: // GC Ep3 US + case 0x41: // GC Ep3 US (and BB) this->set_flag(Flag::NO_D6_AFTER_LOBBY); this->set_flag(Flag::USE_OVERFLOW_FOR_SEND_FUNCTION_CALL); this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH); diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 96c4eac5..a26395f2 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -1056,7 +1056,7 @@ static void on_93_BB(shared_ptr c, uint16_t, uint32_t, string& data) { throw runtime_error("invalid size for 93 command"); } - c->config.set_flags_for_version(c->version(), -1); + c->config.set_flags_for_version(c->version(), cmd.sub_version); c->channel.language = cmd.language; try {