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.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
|
||||
#
|
||||
# Anticheat.KickPlayer
|
||||
|
||||
@@ -222,8 +222,17 @@ 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;
|
||||
|
||||
// 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
|
||||
if ((diffspeed >= _assignedspeeddiff) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING))
|
||||
{
|
||||
if ((clientSpeedRate > speedRate * 1.05f) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING))
|
||||
{
|
||||
if (!player->CanTeleport())
|
||||
@@ -240,6 +249,7 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo)
|
||||
{
|
||||
|
||||
@@ -130,6 +130,7 @@ class AnticheatMgr
|
||||
bool MustCheckTempReports(uint8 type);
|
||||
uint32 _counter = 0;
|
||||
uint32 _alertFrequency = 0;
|
||||
uint32 _assignedspeeddiff = 0;
|
||||
uint32 _updateCheckTimer = 4000;
|
||||
AnticheatPlayersDataMap m_Players; ///< Player data
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user