mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-28 11:53:11 -07:00
Added server side setting to allow the requirement of a client id from clients.
This commit is contained in:
@@ -46,6 +46,9 @@ clientkeepalive=1
|
||||
; considered disconnected; default is 15
|
||||
max_player_inactivity_time=15
|
||||
|
||||
; More modern clients generate client IDs based on specific client side information. Enable this option to
|
||||
' require that clients report the client ID in order to log into the server. Default is false
|
||||
requireclientid=false
|
||||
|
||||
[authentication]
|
||||
|
||||
|
||||
@@ -142,8 +142,9 @@ bool Servatrice::initServer()
|
||||
{
|
||||
serverName = settingsCache->value("server/name", "My Cockatrice server").toString();
|
||||
serverId = settingsCache->value("server/id", 0).toInt();
|
||||
clientIdRequired = settingsCache->value("server/requireclientid",0).toBool();
|
||||
bool regServerOnly = settingsCache->value("authentication/regonly", 0).toBool();
|
||||
|
||||
|
||||
const QString authenticationMethodStr = settingsCache->value("authentication/method").toString();
|
||||
if (authenticationMethodStr == "sql") {
|
||||
qDebug() << "Authenticating method: sql";
|
||||
@@ -160,7 +161,8 @@ bool Servatrice::initServer()
|
||||
qDebug() << "Authenticating method: none";
|
||||
authenticationMethod = AuthenticationNone;
|
||||
}
|
||||
|
||||
|
||||
qDebug() << "Client ID Required: " << clientIdRequired;
|
||||
bool maxUserLimitEnabled = settingsCache->value("security/enable_max_user_limit", false).toBool();
|
||||
qDebug() << "Maximum user limit enabled: " << maxUserLimitEnabled;
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
QString shutdownReason;
|
||||
int shutdownMinutes;
|
||||
QTimer *shutdownTimer;
|
||||
bool isFirstShutdownMessage;
|
||||
bool isFirstShutdownMessage, clientIdRequired;
|
||||
|
||||
mutable QMutex serverListMutex;
|
||||
QList<ServerProperties> serverList;
|
||||
@@ -137,6 +137,7 @@ public:
|
||||
QString getServerName() const { return serverName; }
|
||||
QString getLoginMessage() const { QMutexLocker locker(&loginMessageMutex); return loginMessage; }
|
||||
bool getGameShouldPing() const { return true; }
|
||||
bool getClientIdRequired() const { return clientIdRequired; }
|
||||
int getPingClockInterval() const { return pingClockInterval; }
|
||||
int getMaxGameInactivityTime() const { return maxGameInactivityTime; }
|
||||
int getMaxPlayerInactivityTime() const { return maxPlayerInactivityTime; }
|
||||
|
||||
Reference in New Issue
Block a user