mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 08:16:08 +00:00
fix(Core): prevent movement exploit (#2410)
This commit is contained in:
committed by
Francesco Borzì
parent
685538b01b
commit
ab637800e7
File diff suppressed because it is too large
Load Diff
@@ -1361,7 +1361,6 @@ struct OpcodeHandler
|
||||
SessionStatus status;
|
||||
PacketProcessing packetProcessing;
|
||||
void (WorldSession::*handler)(WorldPacket& recvPacket);
|
||||
bool isGrouppedMovementOpcode; // pussywizard
|
||||
};
|
||||
|
||||
extern OpcodeHandler opcodeTable[NUM_MSG_TYPES];
|
||||
|
||||
@@ -301,28 +301,18 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (opHandle.isGrouppedMovementOpcode)
|
||||
{
|
||||
if (movementPacket)
|
||||
delete movementPacket;
|
||||
movementPacket = new WorldPacket(packet->GetOpcode(), 0);
|
||||
movementPacket->append(*((ByteBuffer*)packet));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (movementPacket)
|
||||
{
|
||||
HandleMovementOpcodes(*movementPacket);
|
||||
delete movementPacket;
|
||||
movementPacket = NULL;
|
||||
}
|
||||
sScriptMgr->OnPacketReceive(this, *packet);
|
||||
if (movementPacket)
|
||||
{
|
||||
HandleMovementOpcodes(*movementPacket);
|
||||
delete movementPacket;
|
||||
movementPacket = NULL;
|
||||
}
|
||||
sScriptMgr->OnPacketReceive(this, *packet);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnPacketReceive(this, *packet))
|
||||
break;
|
||||
if (!sEluna->OnPacketReceive(this, *packet))
|
||||
break;
|
||||
#endif
|
||||
(this->*opHandle.handler)(*packet);
|
||||
}
|
||||
(this->*opHandle.handler)(*packet);
|
||||
}
|
||||
break;
|
||||
case STATUS_TRANSFER:
|
||||
@@ -358,7 +348,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch(ByteBufferException &)
|
||||
catch(ByteBufferException const&)
|
||||
{
|
||||
sLog->outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
|
||||
if (sLog->IsOutDebug())
|
||||
|
||||
@@ -711,7 +711,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ByteBufferException &)
|
||||
catch (ByteBufferException const&)
|
||||
{
|
||||
sLog->outError("WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.", opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1);
|
||||
if (sLog->IsOutDebug())
|
||||
|
||||
Reference in New Issue
Block a user