Duel Exploit Detection

Mind Controling a victim in a duel then using teleport hack to either set up the the opponent or exploit for own personal gain. Both Players will be flagged for cheating, Alerts sent out. Let the GM's sort it out.
This commit is contained in:
MDIC
2022-04-19 16:17:28 -04:00
parent d589615a87
commit 9d0123ba5a
2 changed files with 53 additions and 2 deletions

View File

@@ -25,6 +25,7 @@
#define LANG_ANTICHEAT_ALERT 30087
#define LANG_ANTICHEAT_TELEPORT 30088
#define LANG_ANTICHEAT_IGNORECONTROL 30089
#define LANG_ANTICHEAT_DUEL 30090
enum Spells
{
@@ -297,6 +298,31 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn
float xDiff = fabs(lastX - newX);
float yDiff = fabs(lastY - newY);
if (player->duel)
{
if ((xDiff >= 50.0f || yDiff >= 50.0f) && !player->CanTeleport())
{
Player* opponent = player->duel->Opponent;
std::string str = "|cFFFFFC00[DUEL ALERT Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Teleport 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<bool>("Anticheat.WriteLog", true))
{
LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Teleport-Hack detected player {} ({}) while dueling {}", player->GetName(), player->GetGUID().ToString(), opponent->GetName());
LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Teleport-Hack detected player {} ({}) while dueling {}", opponent->GetName(), opponent->GetGUID().ToString(), player->GetName());
}
BuildReport(player, TELEPORT_HACK_REPORT);
BuildReport(opponent, TELEPORT_HACK_REPORT);
}
else if (player->CanTeleport())
player->SetCanTeleport(false);
}
if ((xDiff >= 50.0f || yDiff >= 50.0f) && !player->CanTeleport())
{
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
@@ -475,6 +501,30 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
// this is the distance doable by the player in 1 sec, using the time done to move to this point.
uint32 clientSpeedRate = distance2D * 1000 / timeDiff;
if (player->duel)
{
if ((clientSpeedRate > speedRate * 1.25f) && !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);
sWorld->SendGMText(LANG_ANTICHEAT_DUEL, player->GetName().c_str(), opponent->GetName().c_str());
if (sConfigMgr->GetOption<bool>("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))