mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix Opcode dispatch, trusts every queued packet to have a handler
This commit is contained in:
@@ -227,6 +227,12 @@ void PlayerbotHolder::HandleBotPackets(WorldSession* session)
|
|||||||
{
|
{
|
||||||
OpcodeClient opcode = static_cast<OpcodeClient>(packet->GetOpcode());
|
OpcodeClient opcode = static_cast<OpcodeClient>(packet->GetOpcode());
|
||||||
ClientOpcodeHandler const* opHandle = opcodeTable[opcode];
|
ClientOpcodeHandler const* opHandle = opcodeTable[opcode];
|
||||||
|
if (!opHandle)
|
||||||
|
{
|
||||||
|
LOG_ERROR("playerbots", "Unhandled opcode {} queued for bot session {}. Packet dropped.", static_cast<uint32>(opcode), session->GetAccountId());
|
||||||
|
delete packet;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
opHandle->Call(session, *packet);
|
opHandle->Call(session, *packet);
|
||||||
delete packet;
|
delete packet;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user