From b9923c96c90add71df9fc5c2355d0b6e9f150d8c Mon Sep 17 00:00:00 2001 From: MDIC Date: Thu, 21 Apr 2022 13:33:24 -0400 Subject: [PATCH] update (Module): New Min Requirements, Remove Drift New minimal required revision due to helper placements in core. Remove Drift and Can Teleport Helper as we no longer need it due to new core helpers --- .github/README.md | 2 +- .github/README_ES.md | 2 +- src/AnticheatMgr.cpp | 42 +++++++++++++++++++----------------------- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/.github/README.md b/.github/README.md index f475c3c..eb30533 100644 --- a/.github/README.md +++ b/.github/README.md @@ -14,7 +14,7 @@ https://github.com/azerothcore/mod-anticheat/wiki ## Notice -Requires revision [c50f7feda](https://github.com/azerothcore/azerothcore-wotlk/commit/c50f7feda0ee360f7bcca7f004bf6fb22abde533) or newer. +Requires revision [eb91bbf](https://github.com/azerothcore/azerothcore-wotlk/commit/eb91bbfc5627ca3d410cdef5a08e7baf23f6452f) or newer. ## How to install diff --git a/.github/README_ES.md b/.github/README_ES.md index a95470c..c4beadd 100644 --- a/.github/README_ES.md +++ b/.github/README_ES.md @@ -14,7 +14,7 @@ https://github.com/azerothcore/mod-anticheat/wiki ## Aviso -Requiere revisión [c50f7feda](https://github.com/azerothcore/azerothcore-wotlk/commit/c50f7feda0ee360f7bcca7f004bf6fb22abde533) o posterior. +Requiere revisión [eb91bbf](https://github.com/azerothcore/azerothcore-wotlk/commit/eb91bbfc5627ca3d410cdef5a08e7baf23f6452f)) o posterior. ## Cómo instalar diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 3773413..eb4d339 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -503,40 +503,36 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo) if (player->duel) { - if ((clientSpeedRate > speedRate * 1.25f) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING)) + if ((clientSpeedRate > speedRate) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING)) { - if (!player->CanTeleport()) - { - Player* opponent = player->duel->Opponent; - std::string str = "|cFFFFFC00[DUEL CHEAT ALERT Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Speed Hack Detected! While Dueling [|cFF60FF00" + std::string(opponent->GetName().c_str()) + "|cFF00FFFF]"; - WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); - data << str; - sWorld->SendGlobalGMMessage(&data); + Player* opponent = player->duel->Opponent; + std::string str = "|cFFFFFC00[DUEL CHEAT ALERT Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Speed Hack Detected! While Dueling [|cFF60FF00" + std::string(opponent->GetName().c_str()) + "|cFF00FFFF]"; + WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); + data << str; + sWorld->SendGlobalGMMessage(&data); - sWorld->SendGMText(LANG_ANTICHEAT_DUEL, player->GetName().c_str(), opponent->GetName().c_str()); - if (sConfigMgr->GetOption("Anticheat.WriteLog", true)) - { - LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Speed-Hack detected player {} ({}) while dueling {}", player->GetName(), player->GetGUID().ToString(), opponent->GetName()); - LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Speed-Hack detected player {} ({}) while dueling {}", opponent->GetName(), opponent->GetGUID().ToString(), player->GetName()); - } - BuildReport(player, SPEED_HACK_REPORT); - BuildReport(opponent, SPEED_HACK_REPORT); + sWorld->SendGMText(LANG_ANTICHEAT_DUEL, player->GetName().c_str(), opponent->GetName().c_str()); + if (sConfigMgr->GetOption("Anticheat.WriteLog", true)) + { + LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Speed-Hack detected player {} ({}) while dueling {}", player->GetName(), player->GetGUID().ToString(), opponent->GetName()); + LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Speed-Hack detected player {} ({}) while dueling {}", opponent->GetName(), opponent->GetGUID().ToString(), player->GetName()); } + BuildReport(player, SPEED_HACK_REPORT); + BuildReport(opponent, SPEED_HACK_REPORT); + return; } } // We did the (uint32) cast to accept a margin of tolerance // We check the last MovementInfo for the falling flag since falling down a hill and sliding a bit triggered a false positive - if ((clientSpeedRate > speedRate * 1.25f) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING)) + if ((clientSpeedRate > speedRate) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING)) { - if (!player->CanTeleport()) + if (sConfigMgr->GetOption("Anticheat.WriteLog", true)) { - if (sConfigMgr->GetOption("Anticheat.WriteLog", true)) - { - LOG_INFO("module", "AnticheatMgr:: Speed-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString()); - } - BuildReport(player, SPEED_HACK_REPORT); + LOG_INFO("module", "AnticheatMgr:: Speed-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString()); } + BuildReport(player, SPEED_HACK_REPORT); + return; } }