mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 17:44:48 -07:00
Mods/Admins/PrivLevels not subject to server idle timeout policy (#5561)
This commit is contained in:
parent
c2292c11a6
commit
e599c6bdac
1 changed files with 5 additions and 1 deletions
|
|
@ -406,7 +406,11 @@ void Server_ProtocolHandler::pingClockTimeout()
|
||||||
if (timeRunning - lastDataReceived > server->getMaxPlayerInactivityTime())
|
if (timeRunning - lastDataReceived > server->getMaxPlayerInactivityTime())
|
||||||
prepareDestroy();
|
prepareDestroy();
|
||||||
|
|
||||||
if (!userInfo || QString::fromStdString(userInfo->privlevel()).toLower() == "none") {
|
// PrivLevel users, Moderators, and Admins are not subject to the server idle timeout policy
|
||||||
|
const bool hasPrivLevel = userInfo && QString::fromStdString(userInfo->privlevel()).toLower() != "none";
|
||||||
|
const bool isModOrAdmin =
|
||||||
|
userInfo && (userInfo->user_level() & (ServerInfo_User::IsModerator | ServerInfo_User::IsAdmin));
|
||||||
|
if (!hasPrivLevel && !isModOrAdmin) {
|
||||||
if ((server->getIdleClientTimeout() > 0) && (idleClientWarningSent)) {
|
if ((server->getIdleClientTimeout() > 0) && (idleClientWarningSent)) {
|
||||||
if (timeRunning - lastActionReceived > server->getIdleClientTimeout()) {
|
if (timeRunning - lastActionReceived > server->getIdleClientTimeout()) {
|
||||||
prepareDestroy();
|
prepareDestroy();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue