add option to prevent concurrent logins; closes #511

This commit is contained in:
Martin Michelsen
2026-05-17 15:00:32 -07:00
parent cb69dc9c14
commit 7b9b44c191
7 changed files with 32 additions and 5 deletions
+7
View File
@@ -195,4 +195,11 @@ asio::awaitable<void> GameServer::destroy_client(std::shared_ptr<Client> c) {
c->log.warning_f("Disconnect hook {} failed: {}", h_it.first, e.what());
}
}
if (c->login) {
auto it = this->state->client_for_account.find(c->login->account->account_id);
if ((it != this->state->client_for_account.end()) && (it->second == c)) {
this->state->client_for_account.erase(it);
}
}
}