Core/Movement: Implement move time skipped handler (ported commit: f9ed72e351ecdafe77da2036d9fd68e46da2f3ab)
This commit is contained in:
1 parent
d997bb6d28
commit
a34160347e
3 files changed
+50
-44
No files matched your search
@@ -655,3 +655,52 @@ void WorldSession::HandleSetCollisionHeightAck(WorldPacket& recvPacket)
|
||||
MovementInfo movementInfo;
|
||||
GetPlayer()->ReadMovementInfo(recvPacket, &movementInfo, &extra);
|
||||
}
|
||||
|
||||
void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recvData)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "WORLD: Received CMSG_MOVE_TIME_SKIPPED");
|
||||
|
||||
ObjectGuid guid;
|
||||
uint32 time;
|
||||
recvData >> time;
|
||||
|
||||
guid[5] = recvData.ReadBit();
|
||||
guid[1] = recvData.ReadBit();
|
||||
guid[3] = recvData.ReadBit();
|
||||
guid[7] = recvData.ReadBit();
|
||||
guid[6] = recvData.ReadBit();
|
||||
guid[0] = recvData.ReadBit();
|
||||
guid[4] = recvData.ReadBit();
|
||||
guid[2] = recvData.ReadBit();
|
||||
|
||||
recvData.ReadByteSeq(guid[7]);
|
||||
recvData.ReadByteSeq(guid[1]);
|
||||
recvData.ReadByteSeq(guid[2]);
|
||||
recvData.ReadByteSeq(guid[4]);
|
||||
recvData.ReadByteSeq(guid[3]);
|
||||
recvData.ReadByteSeq(guid[6]);
|
||||
recvData.ReadByteSeq(guid[0]);
|
||||
recvData.ReadByteSeq(guid[5]);
|
||||
|
||||
Unit* mover = GetPlayer()->m_unitMovedByMe;
|
||||
|
||||
if (!mover)
|
||||
{
|
||||
TC_LOG_WARN("entities.player", "WorldSession::HandleMoveTimeSkippedOpcode wrong mover state from the unit moved by the player %s", GetPlayer()->GetGUID().ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
// prevent tampered movement data
|
||||
if (guid != mover->GetGUID())
|
||||
{
|
||||
TC_LOG_WARN("entities.player", "WorldSession::HandleMoveTimeSkippedOpcode wrong guid from the unit moved by the player %s", GetPlayer()->GetGUID().ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
mover->m_movementInfo.time += time;
|
||||
|
||||
WorldPacket data(MSG_MOVE_TIME_SKIPPED, recvData.size());
|
||||
data << guid.WriteAsPacked();
|
||||
data << time;
|
||||
GetPlayer()->SendMessageToSet(&data, false);
|
||||
}
|
||||
Reference in new issue
Block a user