Core/PacketIO: Require valid WorldSession for CMSG_KEEP_ALIVE

(cherry picked from commit de4340af37)
This commit is contained in:
Shauren
2022-04-08 18:07:59 +02:00
parent c8e26e1962
commit 88b6d75bce

View File

@@ -433,8 +433,12 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
sessionGuard.lock();
LogOpcodeText(opcode, sessionGuard);
if (_worldSession)
{
_worldSession->ResetTimeOutTime(true);
break;
return ReadDataHandlerResult::Ok;
}
TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler: client %s sent CMSG_KEEP_ALIVE without being authenticated", GetRemoteIpAddress().to_string().c_str());
return ReadDataHandlerResult::Error;
case CMSG_LOG_DISCONNECT:
LogOpcodeText(opcode, sessionGuard);
packet.rfinish(); // contains uint32 disconnectReason;