mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 06:28:52 +00:00
Remove fast animation check.
Due to the networking at play here, there's no sane way to assume that animation events/packets are going to come at a certain time apart. Through testing, there have been legitimate animations come 0ms apart, which makes this check impossible, at least in its current state.
This commit is contained in:
1 parent
c6818c11f7
commit
d49e44b0ba
6 files changed
+1
-42
No files matched your search
@@ -86,8 +86,6 @@ public class Backend {
|
||||
private Map<String, Long> stepTime = new HashMap<String, Long>();
|
||||
private HashSet<Byte> transparent = new HashSet<Byte>();
|
||||
private Map<String, Long> lastFallPacket = new HashMap<String, Long>();
|
||||
private Map<String, Long> animationTime = new HashMap<String, Long>();
|
||||
private Map<String, Integer> animations = new HashMap<String, Integer>();
|
||||
|
||||
private Magic magic;
|
||||
private AnticheatManager manager = null;
|
||||
@@ -871,24 +869,6 @@ public class Backend {
|
||||
return PASS;
|
||||
}
|
||||
|
||||
public CheckResult checkFastAnimation(final Player player) {
|
||||
logAnimation(player);
|
||||
|
||||
String name = player.getName();
|
||||
int clicks = animations.containsKey(name) ? animations.get(name) + 1 : 1;
|
||||
animations.put(name, clicks);
|
||||
if (clicks == 1) {
|
||||
animationTime.put(name, System.currentTimeMillis());
|
||||
} else if (clicks == magic.ANIMATION_CHECK) {
|
||||
long time = System.currentTimeMillis() - animationTime.get(name);
|
||||
animations.put(name, 0);
|
||||
if (time < magic.ANIMATION_TIMEMIN) {
|
||||
return new CheckResult(Result.FAILED, player.getName() + " clicked " + clicks + " times in " + time + " ms (max=" + magic.ANIMATION_CHECK + " in " + magic.ANIMATION_TIMEMIN + " ms)");
|
||||
}
|
||||
}
|
||||
return PASS;
|
||||
}
|
||||
|
||||
public void logAnimation(final Player player) {
|
||||
animated.put(player.getName(), System.currentTimeMillis());
|
||||
increment(player, blockPunches, magic.BLOCK_PUNCH_MIN);
|
||||
|
||||
@@ -57,7 +57,6 @@ public enum CheckType {
|
||||
FAST_PROJECTILE(Permission.CHECK_FASTPROJECTILE),
|
||||
ITEM_SPAM(Permission.CHECK_ITEMSPAM),
|
||||
FAST_INVENTORY(Permission.CHECK_FASTINVENTORY),
|
||||
FAST_ANIMATION(Permission.CHECK_FASTANIMATION),
|
||||
AUTOTOOL(Permission.CHECK_AUTOTOOL);
|
||||
|
||||
private final Permission permission;
|
||||
|
||||
Reference in new issue
Block a user