fix sub_version sharing between some Ep3 and BB versions
This commit is contained in:
+11
-7
@@ -24,6 +24,15 @@ static atomic<uint64_t> next_id(1);
|
|||||||
void Client::Config::set_flags_for_version(Version version, int64_t sub_version) {
|
void Client::Config::set_flags_for_version(Version version, int64_t sub_version) {
|
||||||
this->set_flag(Flag::PROXY_CHAT_COMMANDS_ENABLED);
|
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) {
|
switch (sub_version) {
|
||||||
case -1: // Initial check (before sub_version recognition)
|
case -1: // Initial check (before sub_version recognition)
|
||||||
switch (version) {
|
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::NO_D6_AFTER_LOBBY);
|
||||||
this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH);
|
this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH);
|
||||||
break;
|
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:
|
default:
|
||||||
throw logic_error("invalid game version");
|
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_D6_AFTER_LOBBY);
|
||||||
this->set_flag(Flag::NO_SEND_FUNCTION_CALL);
|
this->set_flag(Flag::NO_SEND_FUNCTION_CALL);
|
||||||
break;
|
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::NO_D6_AFTER_LOBBY);
|
||||||
this->set_flag(Flag::ENCRYPTED_SEND_FUNCTION_CALL);
|
this->set_flag(Flag::ENCRYPTED_SEND_FUNCTION_CALL);
|
||||||
this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH);
|
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
|
// instead look at header.flag in the 61 command and set the
|
||||||
// IS_EP3_TRIAL_EDITION flag there.
|
// IS_EP3_TRIAL_EDITION flag there.
|
||||||
break;
|
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::NO_D6_AFTER_LOBBY);
|
||||||
this->set_flag(Flag::USE_OVERFLOW_FOR_SEND_FUNCTION_CALL);
|
this->set_flag(Flag::USE_OVERFLOW_FOR_SEND_FUNCTION_CALL);
|
||||||
this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH);
|
this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH);
|
||||||
|
|||||||
@@ -1056,7 +1056,7 @@ static void on_93_BB(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
|
|||||||
throw runtime_error("invalid size for 93 command");
|
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;
|
c->channel.language = cmd.language;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user