feat(Core/Movement): Implement move time skipped handler (#1433)
This commit is contained in:
@@ -1136,14 +1136,6 @@ void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data)
|
|
||||||
{
|
|
||||||
uint64 guid;
|
|
||||||
uint32 time_skipped;
|
|
||||||
recv_data.readPackGUID(guid);
|
|
||||||
recv_data >> time_skipped;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WorldSession::HandleFeatherFallAck(WorldPacket &recv_data)
|
void WorldSession::HandleFeatherFallAck(WorldPacket &recv_data)
|
||||||
{
|
{
|
||||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||||
|
|||||||
@@ -725,3 +725,37 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData)
|
|||||||
_player->SetSummonAsSpectator(false);
|
_player->SetSummonAsSpectator(false);
|
||||||
_player->SummonIfPossible(agree, summoner_guid);
|
_player->SummonIfPossible(agree, summoner_guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recvData)
|
||||||
|
{
|
||||||
|
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||||
|
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_TIME_SKIPPED");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint64 guid;
|
||||||
|
uint32 timeSkipped;
|
||||||
|
recvData.readPackGUID(guid);
|
||||||
|
recvData >> timeSkipped;
|
||||||
|
|
||||||
|
Unit* mover = GetPlayer()->m_mover;
|
||||||
|
|
||||||
|
if (!mover)
|
||||||
|
{
|
||||||
|
sLog->outError("WorldSession::HandleMoveTimeSkippedOpcode wrong mover state from the unit moved by the player [" UI64FMTD "]", GetPlayer()->GetGUID());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// prevent tampered movement data
|
||||||
|
if (guid != mover->GetGUID())
|
||||||
|
{
|
||||||
|
sLog->outError("WorldSession::HandleMoveTimeSkippedOpcode wrong guid from the unit moved by the player [" UI64FMTD "]", GetPlayer()->GetGUID());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mover->m_movementInfo.time += timeSkipped;
|
||||||
|
|
||||||
|
WorldPacket data(MSG_MOVE_TIME_SKIPPED, recvData.size());
|
||||||
|
data.appendPackGUID(guid);
|
||||||
|
data << timeSkipped;
|
||||||
|
GetPlayer()->SendMessageToSet(&data, false);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user