From 2bcd8913f4b0714237338dd8d3f2f4a06712a193 Mon Sep 17 00:00:00 2001 From: MDIC Date: Mon, 9 May 2022 09:00:46 -0400 Subject: [PATCH] update (detection): Teleport Plane Hack Detection --- src/AnticheatMgr.cpp | 12 +++++++----- src/AnticheatMgr.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 8ee33a8..eff5d3b 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -153,18 +153,20 @@ void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo) BuildReport(player, FLY_HACK_REPORT); } -void AnticheatMgr::TeleportPlaneHackDetection(Player* player, MovementInfo movementInfo) +void AnticheatMgr::TeleportPlaneHackDetection(Player* player, MovementInfo movementInfo, uint32 opcode) { if (!sConfigMgr->GetOption("Anticheat.DetectTelePlaneHack", true)) return; ObjectGuid key = player->GetGUID(); - if (m_Players[key].GetLastMovementInfo().pos.GetPositionZ() != 0 || - movementInfo.pos.GetPositionZ() != 0) + if (m_Players[key].GetLastOpcode() == MSG_MOVE_JUMP) return; - if (movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING)) + if (opcode == (MSG_MOVE_FALL_LAND)) + return; + + if (movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_SWIMMING)) return; float x, y, z; @@ -409,7 +411,7 @@ void AnticheatMgr::StartHackDetection(Player* player, MovementInfo movementInfo, SpeedHackDetection(player, movementInfo); FlyHackDetection(player, movementInfo); JumpHackDetection(player, movementInfo, opcode); - TeleportPlaneHackDetection(player, movementInfo); + TeleportPlaneHackDetection(player, movementInfo, opcode); ClimbHackDetection(player, movementInfo, opcode); TeleportHackDetection(player, movementInfo); IgnoreControlHackDetection(player, movementInfo); diff --git a/src/AnticheatMgr.h b/src/AnticheatMgr.h index 81d5470..534280b 100644 --- a/src/AnticheatMgr.h +++ b/src/AnticheatMgr.h @@ -76,7 +76,7 @@ class AnticheatMgr void FlyHackDetection(Player* player, MovementInfo movementInfo); void WalkOnWaterHackDetection(Player* player, MovementInfo movementInfo); void JumpHackDetection(Player* player, MovementInfo movementInfo,uint32 opcode); - void TeleportPlaneHackDetection(Player* player, MovementInfo); + void TeleportPlaneHackDetection(Player* player, MovementInfo, uint32 opcode); void ClimbHackDetection(Player* player,MovementInfo movementInfo, uint32 opcode); void AntiSwimHackDetection(Player* player, MovementInfo movementInfo, uint32 opcode); void TeleportHackDetection(Player* player, MovementInfo movementInfo);