From bf0cc0aa786da614ce64add4bc60ac06f5a6cf0d Mon Sep 17 00:00:00 2001 From: MDIC Date: Fri, 29 Apr 2022 09:19:32 -0400 Subject: [PATCH] update (module): Ignore control check and cs adj Included a latency check if player has bad latency which should nerf out the false hits with ignore control. Set all anticheat cmds to false for console use due to using the gm cmds on a console did nothing. --- src/AnticheatMgr.cpp | 4 +++- src/cs_anticheat.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index b8496d0..44f826e 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -186,7 +186,9 @@ void AnticheatMgr::IgnoreControlHackDetection(Player* player, MovementInfo movem if (sConfigMgr->GetOption("Anticheat.IgnoreControlHack", true)) { - if (player->HasUnitState(UNIT_STATE_ROOT) && !player->GetVehicle()) + uint32 latency = 0; + latency = player->GetSession()->GetLatency() >= 400; + if (player->HasUnitState(UNIT_STATE_ROOT) && !player->GetVehicle() && !latency) { bool unrestricted = movementInfo.pos.GetPositionX() != x || movementInfo.pos.GetPositionY() != y; if (unrestricted) diff --git a/src/cs_anticheat.cpp b/src/cs_anticheat.cpp index 603415b..3ffc51f 100644 --- a/src/cs_anticheat.cpp +++ b/src/cs_anticheat.cpp @@ -44,18 +44,18 @@ public: { static std::vector anticheatCommandTable = { - { "global", SEC_GAMEMASTER, true, &HandleAntiCheatGlobalCommand, "" }, - { "player", SEC_GAMEMASTER, true, &HandleAntiCheatPlayerCommand, "" }, - { "delete", SEC_ADMINISTRATOR, true, &HandleAntiCheatDeleteCommand, "" }, + { "global", SEC_GAMEMASTER, false, &HandleAntiCheatGlobalCommand, "" }, + { "player", SEC_GAMEMASTER, false, &HandleAntiCheatPlayerCommand, "" }, + { "delete", SEC_ADMINISTRATOR, false, &HandleAntiCheatDeleteCommand, "" }, { "jail", SEC_GAMEMASTER, false, &HandleAnticheatJailCommand, "" }, { "parole", SEC_ADMINISTRATOR, false, &HandleAnticheatParoleCommand, "" }, - { "purge", SEC_ADMINISTRATOR, true, &HandleAntiCheatPurgeCommand, "" }, - { "warn", SEC_GAMEMASTER, true, &HandleAnticheatWarnCommand, "" } + { "purge", SEC_ADMINISTRATOR, false, &HandleAntiCheatPurgeCommand, "" }, + { "warn", SEC_GAMEMASTER, false, &HandleAnticheatWarnCommand, "" } }; static std::vector commandTable = { - { "anticheat", SEC_GAMEMASTER, true, NULL, "", anticheatCommandTable}, + { "anticheat", SEC_GAMEMASTER, false, NULL, "", anticheatCommandTable}, }; return commandTable;