Core/PacketIO: Restored client opcode handler check lost in ace->boost transition

This commit is contained in:
Sovak authored and Shauren committed 2014-10-12 12:38:04 +02:00
1 parent 241fdc49a7
commit d0db99961f
1 file changed
+11
+11
View File
@@ -213,6 +213,17 @@ bool WorldSocket::ReadDataHandler()
return false;
}
// prevent invalid memory access/crash with custom opcodes
if (opcode >= NUM_OPCODE_HANDLERS)
return false;
OpcodeHandler const* handler = opcodeTable[opcode];
if (!handler || handler->Status == STATUS_UNHANDLED)
{
TC_LOG_ERROR("network.opcode", "No defined handler for opcode %s sent by %s", GetOpcodeNameForLogging(packet.GetOpcode()).c_str(), _worldSession->GetPlayerInfo().c_str());
return false;
}
// Our Idle timer will reset on any non PING opcodes.
// Catches people idling on the login screen and any lingering ingame connections.
_worldSession->ResetTimeOutTime();