mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-01 16:37:44 -07:00
Rework idle timeout, now server side (#2259)
* Server side idle timeout Initial commit for server side idle timeout counter. This adds a new int value that is updated when room/game/mod/admin commands occur and is checked during the regular ping timout function that if the users new "idle" value exceeds the idleclienttimeout value defined in the servers configuration file the user is logged out. The user will receive a warning at the 90% time frame mark about being idle. * Use round instead of ceil Travis fix for older xcode issue's. * Fixed requested items Mis-spelleed function, added header, added warning message sent check value. Also corrected the protobuf declaration file for event_notifyuser * Moved bool to protected * Re-Ordered Declarations * Removed most stylistic items Resolved most noted things. * Remove client side idle timeout Removed client side idle timeout functionality
This commit is contained in:
@@ -405,6 +405,13 @@ bool Servatrice::initServer()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (getIdleClientTimeout() > 0) {
|
||||
qDebug() << "Idle client timeout value: " << getIdleClientTimeout();
|
||||
if (getIdleClientTimeout() < 300)
|
||||
qDebug() << "WARNING: It is not recommended to set the IdleClientTimeout value very low. Doing so will cause clients to very quickly be disconnected. Many players when connected may be searching for card details outside the client in the middle of matches or possibly drafting outside the client and short time out values will remove these players.";
|
||||
}
|
||||
|
||||
setRequiredFeatures(getRequiredFeatures());
|
||||
return true;
|
||||
}
|
||||
@@ -814,4 +821,8 @@ QString Servatrice::getISLNetworkSSLKeyFile() const {
|
||||
|
||||
int Servatrice::getISLNetworkPort() const {
|
||||
return settingsCache->value("servernetwork/port", 14747).toInt();
|
||||
}
|
||||
|
||||
int Servatrice::getIdleClientTimeout() const {
|
||||
return settingsCache->value("server/idleclienttimeout", 3600).toInt();
|
||||
}
|
||||
Reference in New Issue
Block a user