Am applying manually now to a new rev but stuck with this
@@ -489,34 +827,33 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/)
GetPlayer()->SendMessageToSet(&data, false);
}
-void WorldSession::HandleMoveKnockBackAck( WorldPacket & /*recv_data*/ )
+void WorldSession::HandleMoveKnockBackAck( WorldPacket & recv_data )
{
// CHECK_PACKET_SIZE(recv_data,?);
sLog.outDebug("CMSG_MOVE_KNOCK_BACK_ACK");
// Currently not used but maybe use later for recheck final player position
// (must be at call same as into "recv_data >> x >> y >> z >> orientation;"
- /*
- uint32 flags, time;
- float x, y, z, orientation;
- uint64 guid;
- uint32 sequence;
- uint32 ukn1;
- float xdirection,ydirection,hspeed,vspeed;
+ /* extract packet */
+ MovementInfo movementInfo;
+ uint32 unk1,unk2,unk3;
+ recv_data >> unk1 >> unk2 >> unk3;
+ ReadMovementInfo(recv_data, &movementInfo);
- recv_data >> guid;
- recv_data >> sequence;
- recv_data >> flags >> time;
- recv_data >> x >> y >> z >> orientation;
- recv_data >> ukn1; //unknown
- recv_data >> vspeed >> xdirection >> ydirection >> hspeed;
+ //Save movement flags
+ _player->m_movementInfo.SetMovementFlags(MovementFlags(movementInfo.flags));
- // skip not personal message;
- if(GetPlayer()->GetGUID()!=guid)
- return;
+ #ifdef MOVEMENT_ANTICHEAT_DEBUG
+ sLog.outBasic("%s CMSG_MOVE_KNOCK_BACK_ACK: tm:%d ftm:%d | %f,%f,%fo(%f) [%X]",GetPlayer()->GetName(),movementInfo.time,movementInfo.fallTime,movementInfo.x,movementInfo.y,movementInfo.z,movementInfo.o,movementInfo.flags);
+ sLog.outBasic("%s CMSG_MOVE_KNOCK_BACK_ACK additional: vspeed:%f, hspeed:%f",GetPlayer()->GetName(), movementInfo.j_unk, movementInfo.j_xyspeed);
+ #endif
+
+ _player->m_movementInfo = movementInfo;
+ _player->m_anti_Last_HSpeed = movementInfo.j_xyspeed;
+ _player->m_anti_Last_VSpeed = movementInfo.j_unk < 3.2f ? movementInfo.j_unk - 1.0f : 3.2f;
- // check code
- */
+ uint32 dt = (_player->m_anti_Last_VSpeed < 0) ? (int)(ceil(_player->m_anti_Last_VSpeed/-25)*1000) : (int)(ceil(_player->m_anti_Last_VSpeed/25)*1000);
+ _player->m_anti_LastSpeedChangeTime = movementInfo.time + dt + 1000;
}
as the code for that function has changed to
sLog.outDebug("CMSG_MOVE_KNOCK_BACK_ACK");
recv_data.read_skip<uint64>(); // guid
recv_data.read_skip<uint32>(); // unk
MovementInfo movementInfo;
ReadMovementInfo(recv_data, &movementInfo);
So what would be the patch code for that part in the new mangos revs ?