From 0540168af722addcee7a6cafd98555db18512e1e Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 1 Dec 2014 03:01:26 -0800 Subject: [PATCH] Fixed CCM in AntiHack --- .../src/mineplex/core/antihack/AntiHack.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 390dbd0a4..78779093b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -297,8 +297,10 @@ public class AntiHack extends MiniPlugin synchronized (_antiHackLock) { - for (Player player : _offense.keySet()) + for (Iterator playerIterator = _offense.keySet().iterator(); playerIterator.hasNext();) { + Player player = playerIterator.next(); + String out = ""; int total = 0; @@ -332,6 +334,9 @@ public class AntiHack extends MiniPlugin //Send Report sendReport(player, out, severity); + + if (severity.equalsIgnoreCase("Extreme")) + playerIterator.remove(); } } } @@ -340,7 +345,7 @@ public class AntiHack extends MiniPlugin { if (severity.equals("Extreme")) { - ResetAll(player); + ResetAll(player, false); //Staff boolean handled = false; @@ -416,6 +421,11 @@ public class AntiHack extends MiniPlugin } private void ResetAll(Player player) + { + ResetAll(player, true); + } + + private void ResetAll(Player player, boolean removeOffenses) { synchronized (_antiHackLock) { @@ -423,8 +433,8 @@ public class AntiHack extends MiniPlugin _velocityEvent.remove(player); _lastMoveEvent.remove(player); - - _offense.remove(player); + if (removeOffenses) + _offense.remove(player); for (Detector detector : _movementDetectors) detector.Reset(player);