mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-02 00:47:48 -07:00
Cleanup max user check at login
This change accomplishes two goals. The first is it moves the checking for if the servers set user limit is reached out of the socket interface and into the protocol handler portion of the code (were it should live). It also eleminates the need for a DB query at login to check the user count. The user account is actually already maintained by the server and a function already existed to get the user count total.
This commit is contained in:
@@ -234,11 +234,11 @@ bool Servatrice::initServer()
|
||||
|
||||
qDebug() << "Store Replays: " << settingsCache->value("game/store_replays", true).toBool();
|
||||
qDebug() << "Client ID Required: " << clientIdRequired;
|
||||
bool maxUserLimitEnabled = settingsCache->value("security/enable_max_user_limit", false).toBool();
|
||||
maxUserLimitEnabled = settingsCache->value("security/enable_max_user_limit", false).toBool();
|
||||
qDebug() << "Maximum user limit enabled: " << maxUserLimitEnabled;
|
||||
|
||||
if (maxUserLimitEnabled){
|
||||
int maxUserLimit = settingsCache->value("security/max_users_total", 500).toInt();
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user