Fixed horribly working blink check

This commit is contained in:
Rammelkast committed 2016-06-01 16:48:04 +02:00
1 parent ebd46db8a2
commit 0b731e10b5
1 file changed
+6 -2
@@ -33,7 +33,7 @@ public class BlinkCheck {
if (AntiCheat.getManager().getCheckManager().checkInWorld(p) && !AntiCheat.getManager().getCheckManager().isOpExempt(p) && AntiCheat.getManager().getCheckManager().isExempt(p, CheckType.BLINK)) if (AntiCheat.getManager().getCheckManager().checkInWorld(p) && !AntiCheat.getManager().getCheckManager().isOpExempt(p) && AntiCheat.getManager().getCheckManager().isExempt(p, CheckType.BLINK))
if (MOVE_COUNT.containsKey(p.getUniqueId())) if (MOVE_COUNT.containsKey(p.getUniqueId()))
if (MOVE_COUNT.get(p.getUniqueId()) > AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET()) { if (MOVE_COUNT.get(p.getUniqueId()) > AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET()) {
EventListener.log(new CheckResult(CheckResult.Result.FAILED, p.getName() + " failed Blink, sent " + MOVE_COUNT.get(p.getUniqueId()) + "packets in one second (max=" + AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET() + ")").getMessage(), p, CheckType.KILLAURA); EventListener.log(new CheckResult(CheckResult.Result.FAILED, p.getName() + " failed Blink, sent " + MOVE_COUNT.get(p.getUniqueId()) + "packets in one second (max=" + AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET() + ")").getMessage(), p, CheckType.BLINK);
} }
MOVE_COUNT.remove(p.getUniqueId()); MOVE_COUNT.remove(p.getUniqueId());
} }
@@ -50,10 +50,14 @@ public class BlinkCheck {
MOVE_COUNT.put(p.getUniqueId(), 1); MOVE_COUNT.put(p.getUniqueId(), 1);
else { else {
MOVE_COUNT.put(p.getUniqueId(), MOVE_COUNT.get(p.getUniqueId()) + 1); MOVE_COUNT.put(p.getUniqueId(), MOVE_COUNT.get(p.getUniqueId()) + 1);
if (MOVE_COUNT.get(p.getUniqueId()) > AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET()) if (AntiCheat.getManager().getCheckManager().checkInWorld(p) && !AntiCheat.getManager().getCheckManager().isOpExempt(p) && !AntiCheat.getManager().getCheckManager().isExempt(p, CheckType.BLINK))
if (MOVE_COUNT.get(p.getUniqueId()) > AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET()) {
EventListener.log(new CheckResult(CheckResult.Result.FAILED, p.getName() + " failed Blink, sent " + MOVE_COUNT.get(p.getUniqueId()) + "packets in one second (max=" + AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET() + ")").getMessage(), p, CheckType.BLINK);
MOVE_COUNT.remove(p.getUniqueId());
e.setCancelled(true); e.setCancelled(true);
} }
} }
}
}); });
} }