rewrite client config; use BB state from login command

This commit is contained in:
Martin Michelsen
2023-10-30 13:15:41 -07:00
parent 47198779b7
commit 5e2e38f1b5
29 changed files with 1139 additions and 1192 deletions
-92
View File
@@ -15,98 +15,6 @@ const vector<string> version_to_lobby_port_name = {
const vector<string> version_to_proxy_port_name = {
"", "dc-proxy", "pc-proxy", "gc-proxy", "xb-proxy", "bb-proxy"};
uint32_t flags_for_version(GameVersion version, int64_t sub_version) {
switch (sub_version) {
case -1: // Initial check (before sub_version recognition)
switch (version) {
case GameVersion::DC:
return Client::Flag::NO_D6 |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case GameVersion::GC:
return 0;
case GameVersion::XB:
return Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case GameVersion::PC:
return Client::Flag::NO_D6 |
Client::Flag::SEND_FUNCTION_CALL_CHECKSUM_ONLY |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case GameVersion::PATCH:
return Client::Flag::NO_D6 |
Client::Flag::NO_SEND_FUNCTION_CALL;
case GameVersion::BB:
return Client::Flag::NO_D6 |
Client::Flag::SAVE_ENABLED |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
}
break;
case 0x20: // DCNTE, possibly also DCv1 JP
case 0x21: // DCv1 US
// In the case of DCNTE, the IS_DC_TRIAL_EDITION flag is already set when
// we get here, so the remaining flags are the same as DCv1
return Client::Flag::IS_DC_V1 |
Client::Flag::NO_D6 |
Client::Flag::NO_SEND_FUNCTION_CALL;
case 0x23: // DCv1 EU
return Client::Flag::IS_DC_V1 |
Client::Flag::NO_D6 |
Client::Flag::NO_SEND_FUNCTION_CALL;
case 0x25: // DCv2 JP
case 0x26: // DCv2 US
case 0x28: // DCv2 EU
return Client::Flag::NO_D6 |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case 0x29: // PC
return Client::Flag::NO_D6 |
Client::Flag::SEND_FUNCTION_CALL_CHECKSUM_ONLY |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case 0x30: // GC Ep1&2 GameJam demo, GC Ep1&2 JP v1.02, at least one version of PSO XB
case 0x31: // GC Ep1&2 US v1.00, GC US v1.01, GC EU v1.00, GC JP v1.00
case 0x34: // GC Ep1&2 JP v1.03
// In the case of GC Trial Edition, the IS_GC_TRIAL_EDITION flag is
// already set when we get here (because the client has used V2 encryption
// instead of V3)
return 0;
case 0x32: // GC Ep1&2 EU 50Hz
case 0x33: // GC Ep1&2 EU 60Hz
return Client::Flag::NO_D6_AFTER_LOBBY;
case 0x35: // GC Ep1&2 JP v1.04 (Plus)
return Client::Flag::NO_D6_AFTER_LOBBY |
Client::Flag::ENCRYPTED_SEND_FUNCTION_CALL |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case 0x36: // GC Ep1&2 US v1.02 (Plus)
case 0x39: // GC Ep1&2 JP v1.05 (Plus)
return Client::Flag::NO_D6_AFTER_LOBBY |
Client::Flag::NO_SEND_FUNCTION_CALL;
case 0x40: // GC Ep3 JP and Trial Edition
// sub_version can't be used to tell JP final and Trial Edition apart; we
// instead look at header.flag in the 61 command.
return Client::Flag::NO_D6_AFTER_LOBBY |
Client::Flag::IS_EPISODE_3 |
Client::Flag::ENCRYPTED_SEND_FUNCTION_CALL |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case 0x42: // Also GC Ep3 JP?
return Client::Flag::NO_D6_AFTER_LOBBY |
Client::Flag::IS_EPISODE_3 |
Client::Flag::ENCRYPTED_SEND_FUNCTION_CALL |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case 0x41: // GC Ep3 US
return Client::Flag::NO_D6_AFTER_LOBBY |
Client::Flag::IS_EPISODE_3 |
Client::Flag::USE_OVERFLOW_FOR_SEND_FUNCTION_CALL |
Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
case 0x43: // GC Ep3 EU
return Client::Flag::NO_D6_AFTER_LOBBY |
Client::Flag::IS_EPISODE_3 |
Client::Flag::NO_SEND_FUNCTION_CALL;
}
throw runtime_error(string_printf("unknown sub_version %" PRIX64, sub_version));
}
const char* name_for_version(GameVersion version) {
switch (version) {
case GameVersion::GC: