diff --git a/src/Client.cc b/src/Client.cc index fd62a8ac..53f4f394 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -108,9 +108,11 @@ void Client::Config::set_flags_for_version(Version version, int64_t sub_version) this->set_flag(Flag::ENCRYPTED_SEND_FUNCTION_CALL); this->set_flag(Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH); break; + case 0x3A: // GC Ep1&2 US v1.2 (Plus) GMK edition + this->set_flag(Flag::IS_CLIENT_CUSTOMIZATION); + [[fallthrough]]; case 0x36: // GC Ep1&2 US v1.2 (Plus) case 0x39: // GC Ep1&2 JP v1.5 (Plus) - case 0x3A: // GC Ep1&2 US v1.2 (Plus) GMK edition this->set_flag(Flag::NO_D6_AFTER_LOBBY); this->set_flag(Flag::NO_SEND_FUNCTION_CALL); break; diff --git a/src/Client.hh b/src/Client.hh index c5fd28a5..5e4310dd 100644 --- a/src/Client.hh +++ b/src/Client.hh @@ -69,6 +69,7 @@ public: SHOULD_SEND_ARTIFICIAL_FLAG_STATE = 0x0002000000000000, // Server-side only SHOULD_SEND_ENABLE_SAVE = 0x0004000000000000, SWITCH_ASSIST_ENABLED = 0x0000000100000000, + IS_CLIENT_CUSTOMIZATION = 0x0100000000000000, // Cheat mode and option flags INFINITE_HP_ENABLED = 0x0000000200000000, diff --git a/src/Lobby.cc b/src/Lobby.cc index 13606585..d0f42567 100644 --- a/src/Lobby.cc +++ b/src/Lobby.cc @@ -792,7 +792,8 @@ Lobby::JoinError Lobby::join_error_for_client(std::shared_ptr c, const s if (this->count_clients() >= this->max_clients) { return JoinError::FULL; } - if (!this->version_is_allowed(c->version()) && !c->config.check_flag(Client::Flag::DEBUG_ENABLED)) { + bool debug_enabled = c->config.check_flag(Client::Flag::DEBUG_ENABLED); + if (!this->version_is_allowed(c->version()) && !debug_enabled) { return JoinError::VERSION_CONFLICT; } if (this->is_game()) { @@ -805,6 +806,10 @@ Lobby::JoinError Lobby::join_error_for_client(std::shared_ptr c, const s if (this->mode == GameMode::SOLO) { return JoinError::SOLO; } + if (!debug_enabled && + (this->check_flag(Flag::IS_CLIENT_CUSTOMIZATION) != c->config.check_flag(Client::Flag::IS_CLIENT_CUSTOMIZATION))) { + return JoinError::VERSION_CONFLICT; + } if (!c->login->account->check_flag(Account::Flag::FREE_JOIN_GAMES)) { if (password && !this->password.empty() && (*password != this->password)) { return JoinError::INCORRECT_PASSWORD; diff --git a/src/Lobby.hh b/src/Lobby.hh index ce3c6d0a..4a2b7515 100644 --- a/src/Lobby.hh +++ b/src/Lobby.hh @@ -70,6 +70,7 @@ struct Lobby : public std::enable_shared_from_this { QUEST_IN_PROGRESS = 0x00000200, BATTLE_IN_PROGRESS = 0x00000400, JOINABLE_QUEST_IN_PROGRESS = 0x00000800, + IS_CLIENT_CUSTOMIZATION = 0x00001000, IS_SPECTATOR_TEAM = 0x00002000, // episode must be EP3 also SPECTATORS_FORBIDDEN = 0x00004000, START_BATTLE_PLAYER_IMMEDIATELY = 0x00008000, diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 6c90d38e..0b299aeb 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -4149,6 +4149,9 @@ shared_ptr create_game_generic( default: throw logic_error("invalid quest script version"); } + if (c->config.check_flag(Client::Flag::IS_CLIENT_CUSTOMIZATION)) { + game->set_flag(Lobby::Flag::IS_CLIENT_CUSTOMIZATION); + } while (game->floor_item_managers.size() < 0x12) { game->floor_item_managers.emplace_back(game->lobby_id, game->floor_item_managers.size()); diff --git a/src/SendCommands.cc b/src/SendCommands.cc index e7f48340..7c50868b 100644 --- a/src/SendCommands.cc +++ b/src/SendCommands.cc @@ -1436,6 +1436,7 @@ void send_game_menu_t( for (shared_ptr l : s->all_lobbies()) { if (l->is_game() && (client_has_debug || l->version_is_allowed(c->version())) && + (client_has_debug || (l->check_flag(Lobby::Flag::IS_CLIENT_CUSTOMIZATION) == c->config.check_flag(Client::Flag::IS_CLIENT_CUSTOMIZATION))) && (l->check_flag(Lobby::Flag::IS_SPECTATOR_TEAM) == is_spectator_team_list) && (!show_tournaments_only || l->tournament_match)) { games.emplace(l);