From d9ecbf403714650d376728ab88aaeb7a3d3819ea Mon Sep 17 00:00:00 2001 From: Chiss Date: Thu, 17 Oct 2013 09:01:36 +1100 Subject: [PATCH 1/3] AH Update --- .../src/mineplex/core/antihack/AntiHack.java | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index fcef68103..512d50431 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -7,9 +7,11 @@ import java.util.Map.Entry; import mineplex.core.MiniPlugin; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.updater.UpdateType; @@ -35,7 +37,7 @@ public class AntiHack extends MiniPlugin private HashMap> _offenses = new HashMap>(); //Ignore Player - private HashSet _ignoreStart = new HashSet(); + private HashSet _ignoreSecondary = new HashSet(); private HashMap _ignore = new HashMap(); //Hack Data @@ -49,10 +51,10 @@ public class AntiHack extends MiniPlugin private HashMap> _speedTicks = new HashMap>(); //Ticks, PrevY //Hack Requirements - private int _floatHackTicks = 4; + private int _floatHackTicks = 6; private int _hoverHackTicks = 4; - private int _riseHackTicks = 8; - private int _speedHackTicks = 4; + private int _riseHackTicks = 6; + private int _speedHackTicks = 6; private int _freecamTime = 8000; protected AntiHack(JavaPlugin plugin) @@ -68,7 +70,8 @@ public class AntiHack extends MiniPlugin @EventHandler public void PlayerVelocity(PlayerVelocityEvent event) { - _ignoreStart.add(event.getPlayer()); + _ignore.put(event.getPlayer(), System.currentTimeMillis() + 2000); + _ignoreSecondary.add(event.getPlayer()); } @EventHandler @@ -85,10 +88,10 @@ public class AntiHack extends MiniPlugin _lastMove.put(player, System.currentTimeMillis()); //Start Ignore - if (_ignoreStart.contains(player) && event.getTo().getY() > event.getFrom().getY()) + if (_ignoreSecondary.contains(player) && event.getTo().getY() > event.getFrom().getY()) { _ignore.put(player, System.currentTimeMillis() + 2000); - _ignoreStart.remove(player); + _ignoreSecondary.remove(player); } //Allowed 'cheaty' movement @@ -135,7 +138,7 @@ public class AntiHack extends MiniPlugin if (!UtilTime.elapsed(_lastMove.get(player), _freecamTime)) continue; - player.kickPlayer(C.cGold + "Mineplex " + C.cRed + "Anti-Hack " + C.cWhite + "Kicked for Lagging / Free Cam."); + player.kickPlayer(C.cGold + "Mineplex " + C.cRed + "Anti-Hack " + C.cWhite + "Kicked for Lagging / Fly (Idle) / Free Cam."); } } @@ -145,10 +148,10 @@ public class AntiHack extends MiniPlugin Player player = event.getPlayer(); //Start Ignore - if (_ignoreStart.contains(player) && event.getTo().getY() > event.getFrom().getY()) + if (_ignoreSecondary.contains(player) && event.getTo().getY() > event.getFrom().getY()) { _ignore.put(player, System.currentTimeMillis() + 2000); - _ignoreStart.remove(player); + _ignoreSecondary.remove(player); } //Allowed 'cheaty' movement @@ -297,7 +300,7 @@ public class AntiHack extends MiniPlugin if (count > _speedHackTicks) { - AddOffense(player, "Speed"); + AddOffense(player, "Speed (Fly/Move)"); count = 0; } @@ -315,6 +318,11 @@ public class AntiHack extends MiniPlugin _offenses.get(player).put(type, previous + 1); + //Staff + for (Player other : UtilServer.getPlayers()) + if (other.isOp()) + UtilPlayer.message(other, F.main("AntiHack", F.elem(player.getName()) + " received offense for " + F.elem(type + "."))); + //Print (Debug) System.out.println("[Offense] " + player.getName() + " received offense for " + type + "."); } @@ -336,7 +344,7 @@ public class AntiHack extends MiniPlugin _speedTicks.remove(player); _ignore.remove(player); - _ignoreStart.remove(player); + _ignoreSecondary.remove(player); _offenses.remove(player); } } From 4d6a0e21339b6faa26ed418e32ed79146772c933 Mon Sep 17 00:00:00 2001 From: Chiss Date: Thu, 17 Oct 2013 09:02:52 +1100 Subject: [PATCH 2/3] Ah no kick --- .../Mineplex.Core/src/mineplex/core/antihack/AntiHack.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 512d50431..505eac5cb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -138,7 +138,8 @@ public class AntiHack extends MiniPlugin if (!UtilTime.elapsed(_lastMove.get(player), _freecamTime)) continue; - player.kickPlayer(C.cGold + "Mineplex " + C.cRed + "Anti-Hack " + C.cWhite + "Kicked for Lagging / Fly (Idle) / Free Cam."); + AddOffense(player, "Lagging / Fly (Idle) / FreeCam"); + //player.kickPlayer(C.cGold + "Mineplex " + C.cRed + "Anti-Hack " + C.cWhite + "Kicked for Lagging / Fly (Idle) / Free Cam."); } } @@ -288,7 +289,7 @@ public class AntiHack extends MiniPlugin } //Check - if (offset > limit && !UtilTime.elapsed(_speedTicks.get(player).getValue(), 200))//Counters Lag + if (offset > limit && !UtilTime.elapsed(_speedTicks.get(player).getValue(), 150))//Counters Lag { count = _speedTicks.get(player).getKey() + 1; } From 410e08b06ababf9b14164d4b745adfed40a09848 Mon Sep 17 00:00:00 2001 From: Chiss Date: Thu, 17 Oct 2013 09:05:03 +1100 Subject: [PATCH 3/3] Clearer MAC reporting to staff --- Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 505eac5cb..013ec7757 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -7,7 +7,6 @@ import java.util.Map.Entry; import mineplex.core.MiniPlugin; import mineplex.core.common.util.C; -import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; @@ -322,7 +321,7 @@ public class AntiHack extends MiniPlugin //Staff for (Player other : UtilServer.getPlayers()) if (other.isOp()) - UtilPlayer.message(other, F.main("AntiHack", F.elem(player.getName()) + " received offense for " + F.elem(type + "."))); + UtilPlayer.message(other, C.cGold + C.Bold + player.getName() + " received offense for " + type + "."); //Print (Debug) System.out.println("[Offense] " + player.getName() + " received offense for " + type + ".");