feat(Core/Opcode): simple opcode filter to log non-existing opcode (#2281)

This commit is contained in:
Viste
2019-11-08 11:21:34 +03:00
committed by Stoabrogga
parent a1fdacbc0b
commit e83169d715

View File

@@ -269,7 +269,11 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
while (m_Socket && !m_Socket->IsClosed() && !_recvQueue.empty() && _recvQueue.peek(true) != firstDelayedPacket && _recvQueue.next(packet, updater))
{
if (packet->GetOpcode() < NUM_MSG_TYPES)
if (packet->GetOpcode() >= NUM_MSG_TYPES)
{
sLog->outError("WorldSession Packet filter: received non-existent opcode %s (0x%.4X)",LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode());
}
else
{
OpcodeHandler &opHandle = opcodeTable[packet->GetOpcode()];
try