mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 06:00:10 -04:00
Proper client timeout detection (#19906)
- Properly detect client timeout when logged into a character after a configurable time (default 60s) has passed without the client sending any packets.
- Fixes issues with crashed clients leaving characters in the world for a very long time (default 15 minutes), as well as edge case exploits involving intentionally pausing client execution for some amount of time.
(cherry picked from commit 7dfd472f8d)
This commit is contained in:
@@ -424,7 +424,10 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
|
||||
return ReadDataHandlerResult::WaitingForQuery;
|
||||
}
|
||||
case CMSG_KEEP_ALIVE:
|
||||
sessionGuard.lock();
|
||||
LogOpcodeText(opcode, sessionGuard);
|
||||
if (_worldSession)
|
||||
_worldSession->ResetTimeOutTime(true);
|
||||
break;
|
||||
case CMSG_LOG_DISCONNECT:
|
||||
LogOpcodeText(opcode, sessionGuard);
|
||||
@@ -471,9 +474,8 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
|
||||
break;
|
||||
}
|
||||
|
||||
// Our Idle timer will reset on any non PING opcodes.
|
||||
// Catches people idling on the login screen and any lingering ingame connections.
|
||||
_worldSession->ResetTimeOutTime();
|
||||
// Our Idle timer will reset on any non PING opcodes on login screen, allowing us to catch people idling.
|
||||
_worldSession->ResetTimeOutTime(false);
|
||||
|
||||
// Copy the packet to the heap before enqueuing
|
||||
_worldSession->QueuePacket(new WorldPacket(std::move(packet)));
|
||||
|
||||
Reference in New Issue
Block a user