mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Small changes to reach check, redid aimbot check, improved default config
Prepared for release.
This commit is contained in:
1 parent
67e6f0df62
commit
5c85b8717b
5 files changed
+26
-37
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
||||||
<artifactId>AntiCheatReloaded</artifactId>
|
<artifactId>AntiCheatReloaded</artifactId>
|
||||||
<version>1.10.3-PRE</version>
|
<version>1.10.3</version>
|
||||||
<name>AntiCheatReloaded</name>
|
<name>AntiCheatReloaded</name>
|
||||||
<url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url>
|
<url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url>
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -85,11 +85,11 @@ public final class KillAuraCheck {
|
|||||||
// Velocity compensation
|
// Velocity compensation
|
||||||
final double velocityMultiplier = checksConfig.getDouble(CheckType.KILLAURA, "reach", "velocityMultiplier");
|
final double velocityMultiplier = checksConfig.getDouble(CheckType.KILLAURA, "reach", "velocityMultiplier");
|
||||||
allowedReach += Math.abs(target.getVelocity().length()) * velocityMultiplier;
|
allowedReach += Math.abs(target.getVelocity().length()) * velocityMultiplier;
|
||||||
final double reachedDistance = ((LivingEntity) target).getLocation().toVector()
|
final double reachedDistance = Utilities.roundDouble(((LivingEntity) target).getLocation().toVector()
|
||||||
.distance(player.getLocation().toVector());
|
.distance(player.getLocation().toVector()), 2);
|
||||||
if (reachedDistance > allowedReach) {
|
if (reachedDistance > Utilities.roundDouble(allowedReach, 2)) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "Reach",
|
return new CheckResult(CheckResult.Result.FAILED, "Reach",
|
||||||
"reached too far (distance=" + Utilities.roundDouble(reachedDistance, 6) + ", max=" + Utilities.roundDouble(allowedReach, 6) + ")");
|
"reached too far (distance=" + reachedDistance + ", max=" + Utilities.roundDouble(allowedReach, 2) + ")");
|
||||||
}
|
}
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,12 +30,9 @@ import com.rammelkast.anticheatreloaded.util.MovementManager;
|
|||||||
import com.rammelkast.anticheatreloaded.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
/*
|
|
||||||
* TODO redo (again)
|
|
||||||
* Just go for a basic GCD check and implement optifine detection
|
|
||||||
*/
|
|
||||||
public final class AimbotCheck {
|
public final class AimbotCheck {
|
||||||
|
|
||||||
|
private static final double EXPANDER = Math.pow(2, 24);
|
||||||
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
||||||
|
|
||||||
public static CheckResult runCheck(final Player player, final EntityDamageByEntityEvent event) {
|
public static CheckResult runCheck(final Player player, final EntityDamageByEntityEvent event) {
|
||||||
@@ -49,19 +46,18 @@ public final class AimbotCheck {
|
|||||||
final MovementManager movementManager = user.getMovementManager();
|
final MovementManager movementManager = user.getMovementManager();
|
||||||
final Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
final Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
||||||
final float deltaPitch = movementManager.deltaPitch;
|
final float deltaPitch = movementManager.deltaPitch;
|
||||||
final float deltaYaw = movementManager.deltaYaw;
|
|
||||||
final float pitchAcceleration = Math.abs(deltaPitch - movementManager.lastDeltaPitch);
|
final float pitchAcceleration = Math.abs(deltaPitch - movementManager.lastDeltaPitch);
|
||||||
|
|
||||||
final double gcd = Utilities.computeGcd(deltaPitch, movementManager.lastDeltaPitch);
|
final long gcd = Utilities.getGcd((long) (deltaPitch * EXPANDER),
|
||||||
final double mod = Math.abs(player.getLocation().getPitch() % gcd);
|
(long) (movementManager.lastDeltaPitch * EXPANDER));
|
||||||
|
final double mod = Math.abs(player.getLocation().getPitch() % (gcd / EXPANDER));
|
||||||
final double minAcceleration = checksConfig.getDouble(CheckType.AIMBOT, "minAcceleration");
|
final double minAcceleration = checksConfig.getDouble(CheckType.AIMBOT, "minAcceleration");
|
||||||
final double maxMod = checksConfig.getDouble(CheckType.AIMBOT, "maxMod");
|
final double maxMod = checksConfig.getDouble(CheckType.AIMBOT, "maxMod");
|
||||||
if (mod < maxMod && pitchAcceleration > minAcceleration
|
if ((gcd > 0L && gcd < 131072L) && mod <= maxMod && pitchAcceleration > minAcceleration && deltaPitch > 5.0f) {
|
||||||
&& (deltaPitch == 0.0f || (deltaPitch > 45.0f && deltaYaw > 45.0f))) {
|
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
"failed computational check (gcd=" + Utilities.roundDouble(gcd, 4) + ", mod="
|
"failed computational check (gcd=" + gcd + ", mod="
|
||||||
+ Utilities.roundDouble(mod, 4) + ", accel=" + Utilities.roundDouble(pitchAcceleration, 4)
|
+ Utilities.roundDouble(mod, 5) + ", accel=" + Utilities.roundDouble(pitchAcceleration, 3)
|
||||||
+ ")");
|
+ ", delta=" + Utilities.roundDouble(deltaPitch, 1) + ")");
|
||||||
}
|
}
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -766,22 +766,15 @@ public final class Utilities {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the greatest common divider
|
* Calculates the greatest common divider
|
||||||
* @param a value a
|
*
|
||||||
* @param b value b
|
* @param current - The current value
|
||||||
* @return the greatest common divider of a and b
|
* @param previous - The previous value
|
||||||
|
* @return - The GCD of those two values
|
||||||
*/
|
*/
|
||||||
public static double computeGcd(final double a, final double b) {
|
public static long getGcd(final long current, final long previous) {
|
||||||
if (a < b) {
|
return (previous <= 16384L) ? current : getGcd(previous, current % previous);
|
||||||
return computeGcd(b, a);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (Math.abs(b) < 0.001) {
|
|
||||||
return a;
|
|
||||||
} else {
|
|
||||||
return computeGcd(b, a - Math.floor(a / b) * b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isCollisionPoint(final Location location, final Predicate<Material> predicate) {
|
public static boolean isCollisionPoint(final Location location, final Predicate<Material> predicate) {
|
||||||
final ArrayList<Material> materials = new ArrayList<>();
|
final ArrayList<Material> materials = new ArrayList<>();
|
||||||
for (double x = -0.3; x <= 0.3; x += 0.3) {
|
for (double x = -0.3; x <= 0.3; x += 0.3) {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ speed:
|
|||||||
# Should this part of the check be enabled?
|
# Should this part of the check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
# Base unadjusted air speed limit
|
# Base unadjusted air speed limit
|
||||||
baseLimit: 0.03125
|
baseLimit: 0.0315
|
||||||
# Prediction multiplier for custom walk speeds
|
# Prediction multiplier for custom walk speeds
|
||||||
walkSpeedMultiplier: 1.4
|
walkSpeedMultiplier: 1.4
|
||||||
# Checks movement acceleration in the air
|
# Checks movement acceleration in the air
|
||||||
@@ -67,7 +67,7 @@ speed:
|
|||||||
# Should this part of the check be enabled?
|
# Should this part of the check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
# Base unadjusted air acceleration limit
|
# Base unadjusted air acceleration limit
|
||||||
baseLimit: 0.3725
|
baseLimit: 0.375
|
||||||
# Limit multiplier for custom walk speeds
|
# Limit multiplier for custom walk speeds
|
||||||
walkSpeedMultiplier: 1.4
|
walkSpeedMultiplier: 1.4
|
||||||
# Checks movement acceleration in the air
|
# Checks movement acceleration in the air
|
||||||
@@ -157,7 +157,7 @@ killaura:
|
|||||||
# Maximum base reach distances
|
# Maximum base reach distances
|
||||||
baseMaxValue:
|
baseMaxValue:
|
||||||
# Maximum base reach value
|
# Maximum base reach value
|
||||||
normal: 3.6
|
normal: 3.5
|
||||||
# Maximum base reach value when a player has velocity
|
# Maximum base reach value when a player has velocity
|
||||||
velocitized: 4.0
|
velocitized: 4.0
|
||||||
# Settings for lag compensation
|
# Settings for lag compensation
|
||||||
@@ -167,7 +167,7 @@ killaura:
|
|||||||
# Extra allowed reach distance per millisecond of ping
|
# Extra allowed reach distance per millisecond of ping
|
||||||
pingCompensation: 0.0025
|
pingCompensation: 0.0025
|
||||||
# The multiplier of extra compensation for velocity
|
# The multiplier of extra compensation for velocity
|
||||||
velocityMultiplier: 1.2
|
velocityMultiplier: 1.3
|
||||||
# Checks if the target it within a players viewing angle
|
# Checks if the target it within a players viewing angle
|
||||||
# Debugs as 'tried to attack from an illegal angle'
|
# Debugs as 'tried to attack from an illegal angle'
|
||||||
angle:
|
angle:
|
||||||
@@ -194,9 +194,9 @@ aimbot:
|
|||||||
# Should this check be enabled?
|
# Should this check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
# Maximum pitch acceleration for check to consider aim illegal
|
# Maximum pitch acceleration for check to consider aim illegal
|
||||||
minAcceleration: 0.5
|
minAcceleration: 5.5
|
||||||
# Maximum mod value for check to consider aim illegal
|
# Maximum mod value for check to consider aim illegal
|
||||||
maxMod: 0.0001
|
maxMod: 0.001
|
||||||
# Criticals check settings
|
# Criticals check settings
|
||||||
# Checks if the player tries to do a crit without needed conditions
|
# Checks if the player tries to do a crit without needed conditions
|
||||||
criticals:
|
criticals:
|
||||||
|
|||||||
Reference in new issue
Block a user