Core/PacketIO: Require valid WorldSession for CMSG_KEEP_ALIVE

This commit is contained in:
Shauren
2022-04-08 18:07:59 +02:00
parent 09204159f8
commit de4340af37

View File

@@ -346,9 +346,12 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
sessionGuard.lock();
LogOpcodeText(opcode, sessionGuard);
if (_worldSession)
{
_worldSession->ResetTimeOutTime(true);
return ReadDataHandlerResult::Ok;
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_TIME_SYNC_RESP:
packetToQueue = new WorldPacket(std::move(packet), std::chrono::steady_clock::now());
break;