mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Mods/Admins/PrivLevels not subject to server idle timeout policy
This commit is contained in:
parent
3d2b1a8435
commit
69b0947c41
1 changed files with 3 additions and 2 deletions
|
|
@ -407,8 +407,9 @@ void Server_ProtocolHandler::pingClockTimeout()
|
|||
prepareDestroy();
|
||||
|
||||
// PrivLevel users, Moderators, and Admins are not subject to the server idle timeout policy
|
||||
if (!userInfo || QString::fromStdString(userInfo->privlevel()).toLower() == "none" ||
|
||||
(userInfo->user_level() & (ServerInfo_User::IsModerator | ServerInfo_User::IsAdmin))) {
|
||||
const bool hasPrivLevel = userInfo && QString::fromStdString(userInfo->privlevel()).toLower() != "none";
|
||||
const bool isModOrAdmin = (userInfo->user_level() & (ServerInfo_User::IsModerator | ServerInfo_User::IsAdmin));
|
||||
if (!hasPrivLevel && !isModOrAdmin) {
|
||||
if ((server->getIdleClientTimeout() > 0) && (idleClientWarningSent)) {
|
||||
if (timeRunning - lastActionReceived > server->getIdleClientTimeout()) {
|
||||
prepareDestroy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue