Revert removing strict anticheat

This commit is contained in:
samczsun 2017-01-06 21:18:33 -05:00 committed by cnr
parent cdc4f3debd
commit ac63985419
3 changed files with 29 additions and 0 deletions

View File

@ -147,6 +147,7 @@ public class AntiHack extends MiniPlugin
// These are the GWEN checks to ignore when handling PlayerViolationEvent
private HashSet<Class<? extends Check>> _ignoredChecks = new HashSet<>();
private boolean _strict;
private AntiHack()
{
@ -468,4 +469,14 @@ public class AntiHack extends MiniPlugin
ThreadLocalRandom.current().nextBytes(holder);
return DatatypeConverter.printHexBinary(holder);
}
public boolean isStrict()
{
return _strict;
}
public void setStrict(boolean strict)
{
this._strict = strict;
}
}

View File

@ -270,6 +270,14 @@ public class PunishPage extends CraftInventoryCustom implements Listener
int flightSeverity = 2;
try
{
if (Managers.get(AntiHack.class).isStrict())
{
flightSeverity = 3;
}
}
catch (Exception e) {}
AddButton(41, new ShopItem(Material.INK_SACK, (byte)1, "Severity 3",new String[]
{

View File

@ -1231,6 +1231,16 @@ public class GameFlagManager implements Listener
}
}
@EventHandler
public void AntiHackStrict(GameStateChangeEvent event)
{
if (event.GetState() == GameState.Prepare || event.GetState() == GameState.Live)
Managers.get(AntiHack.class).setStrict(event.GetGame().StrictAntiHack);
else
Managers.get(AntiHack.class).setStrict(true);
}
@EventHandler
public void PlayerKillCommandCancel(PlayerCommandPreprocessEvent event)
{