mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 00:58:35 +00:00
add (cm\conf): Speed hack countermeasures
Added new countermeasure and counter measure conf. Speed Hack
This commit is contained in:
@@ -224,6 +224,16 @@ Anticheat.CM.ADVJUMPHACK = 0
|
|||||||
|
|
||||||
Anticheat.CM.IGNOREZ = 0
|
Anticheat.CM.IGNOREZ = 0
|
||||||
|
|
||||||
|
#
|
||||||
|
# Anticheat.CM.SPEEDHACK
|
||||||
|
#
|
||||||
|
# Description: Sets player back to allowed server rate speed when speed hack is detected
|
||||||
|
# Default: 0 - (Disabled)
|
||||||
|
# 1 - (Enabled)
|
||||||
|
#
|
||||||
|
|
||||||
|
Anticheat.CM.SPEEDHACK = 0
|
||||||
|
|
||||||
#
|
#
|
||||||
# Anticheat.CM.WriteLog
|
# Anticheat.CM.WriteLog
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ enum Spells
|
|||||||
LFG_SPELL_DUNGEON_DESERTER = 71041,
|
LFG_SPELL_DUNGEON_DESERTER = 71041,
|
||||||
BG_SPELL_DESERTER = 26013,
|
BG_SPELL_DESERTER = 26013,
|
||||||
SILENCED = 23207,
|
SILENCED = 23207,
|
||||||
RESURRECTION_SICKNESS = 15007
|
RESURRECTION_SICKNESS = 15007,
|
||||||
|
SLOWDOWN = 61458
|
||||||
};
|
};
|
||||||
|
|
||||||
AnticheatMgr::AnticheatMgr()
|
AnticheatMgr::AnticheatMgr()
|
||||||
@@ -287,6 +288,28 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
|
|||||||
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
|
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
|
||||||
LOG_INFO("anticheat.module", "AnticheatMgr:: Speed-Hack (Speed Movement at {}% above allowed Server Set rate {}%.) detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", clientSpeedRate, speedRate, player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
|
LOG_INFO("anticheat.module", "AnticheatMgr:: Speed-Hack (Speed Movement at {}% above allowed Server Set rate {}%.) detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", clientSpeedRate, speedRate, player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
|
||||||
}
|
}
|
||||||
|
if (sConfigMgr->GetOption<bool>("Anticheat.CM.SPEEDHACK", true))
|
||||||
|
{ // display warning at the center of the screen, hacky way?
|
||||||
|
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] SPEED HACK COUNTER MEASURE ALERT";
|
||||||
|
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
|
||||||
|
data << str;
|
||||||
|
sWorld->SendGlobalGMMessage(&data);
|
||||||
|
|
||||||
|
if (Aura* slowcheater = player->AddAura(SLOWDOWN, player))// SLOWDOWN
|
||||||
|
{
|
||||||
|
slowcheater->SetDuration(1000);
|
||||||
|
}
|
||||||
|
BuildReport(player, SPEED_HACK_REPORT);
|
||||||
|
if (sConfigMgr->GetOption<bool>("Anticheat.CM.WriteLog", true))
|
||||||
|
{
|
||||||
|
LOG_INFO("anticheat.module", "ANTICHEAT COUNTER MEASURE:: {} Speed Hack Countered and has been set to Server Rate.", player->GetName());
|
||||||
|
}
|
||||||
|
if (sConfigMgr->GetOption<bool>("Anticheat.CM.ALERTCHAT", true))
|
||||||
|
{
|
||||||
|
std::string str = "|cFFFFFC00 SPEED HACK COUNTER MEASURE ALERT";
|
||||||
|
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
BuildReport(player, SPEED_HACK_REPORT);
|
BuildReport(player, SPEED_HACK_REPORT);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user