use flag to separate customized GC clients from non-customized

This commit is contained in:
Martin Michelsen
2024-04-27 14:25:46 -07:00
parent f5c2c930d8
commit c7dd98ccc0
6 changed files with 15 additions and 2 deletions
+6 -1
View File
@@ -792,7 +792,8 @@ Lobby::JoinError Lobby::join_error_for_client(std::shared_ptr<Client> 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<Client> 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;