mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Fix dynamic user limit settings
PR #2220 removed the ability to be able to change the max user limit count while the server is running requiring a restart to make the settings change. This PR reverts the behavior back to how it operated prior to the PR.
This commit is contained in:
parent
b808d3824b
commit
749bc5d6f5
4 changed files with 16 additions and 8 deletions
|
|
@ -234,11 +234,11 @@ bool Servatrice::initServer()
|
|||
|
||||
qDebug() << "Store Replays: " << settingsCache->value("game/store_replays", true).toBool();
|
||||
qDebug() << "Client ID Required: " << clientIdRequired;
|
||||
maxUserLimitEnabled = settingsCache->value("security/enable_max_user_limit", false).toBool();
|
||||
bool maxUserLimitEnabled = settingsCache->value("security/enable_max_user_limit", false).toBool();
|
||||
qDebug() << "Maximum user limit enabled: " << maxUserLimitEnabled;
|
||||
|
||||
if (maxUserLimitEnabled){
|
||||
maxUserLimit = settingsCache->value("security/max_users_total", 500).toInt();
|
||||
int maxUserLimit = settingsCache->value("security/max_users_total", 500).toInt();
|
||||
qDebug() << "Maximum total user limit: " << maxUserLimit;
|
||||
int maxTcpUserLimit = settingsCache->value("security/max_users_tcp", 500).toInt();
|
||||
qDebug() << "Maximum tcp user limit: " << maxTcpUserLimit;
|
||||
|
|
@ -725,3 +725,11 @@ void Servatrice::doSendIslMessage(const IslMessage &msg, int serverId)
|
|||
interface->transmitMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
int Servatrice::getMaxUserLimit() const {
|
||||
return settingsCache->value("security/max_users_total", 500).toInt();
|
||||
}
|
||||
|
||||
bool Servatrice::getMaxUserLimitEnabled() const {
|
||||
return settingsCache->value("security/enable_max_user_limit", false).toBool();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue