Fixed CCM in AntiHack

This commit is contained in:
Jonathan Williams 2014-12-01 03:01:26 -08:00
parent e7cf4eb51d
commit 0540168af7

View File

@ -297,8 +297,10 @@ public class AntiHack extends MiniPlugin
synchronized (_antiHackLock)
{
for (Player player : _offense.keySet())
for (Iterator<Player> 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);