fix(Core/PacketIO): Require valid WorldSession for CMSG_KEEP_ALIVE (#15426)

* cherry-pick commit (de4340af37)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Kitzunu
2023-03-17 10:23:29 +01:00
committed by GitHub
parent b32d3506de
commit 8b27d9c464

View File

@@ -355,8 +355,12 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
sessionGuard.lock();
LogOpcodeText(opcode, sessionGuard);
if (_worldSession)
{
_worldSession->ResetTimeOutTime(true);
return ReadDataHandlerResult::Ok;
return ReadDataHandlerResult::Ok;
}
LOG_ERROR("network", "WorldSocket::ReadDataHandler: client {} sent CMSG_KEEP_ALIVE without being authenticated", GetRemoteIpAddress().to_string());
return ReadDataHandlerResult::Error;
case CMSG_TIME_SYNC_RESP:
packetToQueue = new WorldPacket(std::move(packet), GameTime::Now());
break;