Core/Movement: Do not process server side relocation if reading movementinfo from client resulted in violations (= hacking).

This commit is contained in:
Machiavelli
2012-03-16 18:15:08 +01:00
parent cca93c7a22
commit 65453620e8
5 changed files with 68 additions and 13 deletions
+6
View File
@@ -1621,6 +1621,12 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data)
recv_data.read_skip<float>(); // unk2
if (movementInfo.Violated)
{
recv_data.rfinish();
return;
}
_player->m_mover->m_movementInfo.flags = movementInfo.GetMovementFlags();
}
+24 -1
View File
@@ -278,6 +278,14 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data)
return;
}
//! If some anti-cheat checks in WorldSession::ReadMovementInfo failed, do not process
//! the change of movement server-sided.
if (movementInfo.Violated)
{
recv_data.rfinish();
return;
}
/* handle special cases */
if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT)
{
@@ -485,9 +493,16 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data)
recv_data.readPackGUID(old_mover_guid);
MovementInfo mi;
mi.guid = old_mover_guid;
ReadMovementInfo(recv_data, &mi);
if (mi.Violated)
{
recv_data.rfinish();
return;
}
mi.guid = old_mover_guid;
_player->m_movementInfo = mi;
}
@@ -513,6 +528,13 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data)
MovementInfo movementInfo;
ReadMovementInfo(recv_data, &movementInfo);
if (movementInfo.Violated)
{
recv_data.rfinish();
return;
}
_player->m_movementInfo = movementInfo;
WorldPacket data(MSG_MOVE_KNOCK_BACK, 66);
@@ -571,3 +593,4 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data)
_player->SummonIfPossible(agree);
}
#undef IF_VIOLATED_RETURN
+16 -1
View File
@@ -43,6 +43,12 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data)
mi.guid = guid;
ReadMovementInfo(recv_data, &mi);
if (mi.Violated)
{
recv_data.rfinish();
return;
}
_player->m_movementInfo = mi;
_player->ExitVehicle();
@@ -81,7 +87,16 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
uint64 guid; // current vehicle guid
recv_data.readPackGUID(guid);
ReadMovementInfo(recv_data, &vehicle_base->m_movementInfo);
MovementInfo movementInfo;
ReadMovementInfo(recv_data, &movementInfo);
if (movementInfo.Violated)
{
recv_data.rfinish();
return;
}
vehicle_base->m_movementInfo = movementInfo;
uint64 accessory; // accessory guid
recv_data.readPackGUID(accessory);