mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 00:58:35 +00:00
Update (detections/conf): Speed Hack Precision
New conf:
# Anticheat.SpeedLimitTolerance
# Description: Speed Limit Tolerance allows a certain whole percentage of tolerance to speed
# hack logging and detection.
#
# Example: AnticheatMgr:: Speed-Hack (Speed Movement at 12% above allowed Server Set rate 8%.)
# will be detected since its 4 (default) and higher, but anything 3 and lower will not be flagged.
# Default: 4 - (Default)
#
Anticheat.SpeedLimitTolerance = 4
Created a conf to establish a speed limit tolerance over server rate set speed
This is done so we can ignore minor violations that are not false positives such as going 1 or 2 over the speed limit
This commit is contained in:
@@ -101,6 +101,17 @@ Anticheat.StricterFlyHackCheck = 0
|
|||||||
|
|
||||||
Anticheat.StricterDetectJumpHack = 0
|
Anticheat.StricterDetectJumpHack = 0
|
||||||
|
|
||||||
|
# Anticheat.SpeedLimitTolerance
|
||||||
|
# Description: Speed Limit Tolerance allows a certain whole percentage of tolerance to speed
|
||||||
|
# hack logging and detection.
|
||||||
|
#
|
||||||
|
# Example: AnticheatMgr:: Speed-Hack (Speed Movement at 12% above allowed Server Set rate 8%.)
|
||||||
|
# will be detected since its 4 (default) and higher, but anything 3 and lower will not be flagged.
|
||||||
|
# Default: 4 - (Default)
|
||||||
|
#
|
||||||
|
|
||||||
|
Anticheat.SpeedLimitTolerance = 4
|
||||||
|
|
||||||
# Automatic Moderation Features
|
# Automatic Moderation Features
|
||||||
#
|
#
|
||||||
# Anticheat.KickPlayer
|
# Anticheat.KickPlayer
|
||||||
|
|||||||
@@ -222,22 +222,32 @@ 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.
|
// 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;
|
uint32 clientSpeedRate = distance2D * 1000 / timeDiff;
|
||||||
|
|
||||||
// We did the (uint32) cast to accept a margin of tolerance
|
// we create a diff speed in uint32 for further precision checking to avoid legit fall and slide
|
||||||
|
uint32 diffspeed = clientSpeedRate - speedRate;
|
||||||
|
|
||||||
|
// create a conf to establish a speed limit tolerance over server rate set speed
|
||||||
|
// this is done so we can ignore minor violations that are not false positives such as going 1 or 2 over the speed limit
|
||||||
|
_assignedspeeddiff = sConfigMgr->GetOption<uint32>("Anticheat.SpeedLimitTolerance", 4);
|
||||||
|
|
||||||
|
// We did the (uint32) cast to accept a margin of tolerance for seasonal spells and buffs such as sugar rush
|
||||||
// We check the last MovementInfo for the falling flag since falling down a hill and sliding a bit triggered a false positive
|
// 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.05f) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING))
|
if ((diffspeed >= _assignedspeeddiff) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING))
|
||||||
{
|
{
|
||||||
if (!player->CanTeleport())
|
if ((clientSpeedRate > speedRate * 1.05f) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING))
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
if (!player->CanTeleport())
|
||||||
{
|
{
|
||||||
uint32 latency = 0;
|
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||||
latency = player->GetSession()->GetLatency();
|
{
|
||||||
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());
|
uint32 latency = 0;
|
||||||
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);
|
latency = player->GetSession()->GetLatency();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
BuildReport(player, SPEED_HACK_REPORT);
|
||||||
}
|
}
|
||||||
BuildReport(player, SPEED_HACK_REPORT);
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ class AnticheatMgr
|
|||||||
bool MustCheckTempReports(uint8 type);
|
bool MustCheckTempReports(uint8 type);
|
||||||
uint32 _counter = 0;
|
uint32 _counter = 0;
|
||||||
uint32 _alertFrequency = 0;
|
uint32 _alertFrequency = 0;
|
||||||
|
uint32 _assignedspeeddiff = 0;
|
||||||
uint32 _updateCheckTimer = 4000;
|
uint32 _updateCheckTimer = 4000;
|
||||||
AnticheatPlayersDataMap m_Players; ///< Player data
|
AnticheatPlayersDataMap m_Players; ///< Player data
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user