From 9bc118dc419c66dbc5fa368b3e88a42e39fcd50c Mon Sep 17 00:00:00 2001 From: cnr Date: Mon, 15 May 2017 16:37:14 -0700 Subject: [PATCH] Fix Anticheat ban lengths --- .../src/mineplex/core/antihack/AntiHack.java | 43 ++++++------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 525351b5a..79d38c111 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -233,7 +233,7 @@ public class AntiHack extends MiniPlugin _compromisedAccountManager.submitImmediateBan(player); - _punish.AddPunishment(coreClient.getName(), Category.Hacking, finalMessage, AntiHack.NAME, 3, true, getDaysBanned(player, cause), true, after); + _punish.AddPunishment(coreClient.getName(), Category.Hacking, finalMessage, AntiHack.NAME, 3, true, getHoursBanned(player, cause), true, after); }; if (coreClient.GetRank().has(Rank.TWITCH)) @@ -272,7 +272,7 @@ public class AntiHack extends MiniPlugin Consumer> doPunish = after -> { - _punish.AddPunishment(coreClient.getName(), Category.Hacking, info.getMessage(), AntiHack.NAME, 3, true, getDaysBanned(player, CheckManager.getCheckBySimpleName(info.getHackType())), true, after); + _punish.AddPunishment(coreClient.getName(), Category.Hacking, info.getMessage(), AntiHack.NAME, 3, true, getHoursBanned(player, CheckManager.getCheckBySimpleName(info.getHackType())), true, after); }; if (coreClient.GetRank().has(Rank.TWITCH)) @@ -358,7 +358,7 @@ public class AntiHack extends MiniPlugin { for (Punishment punishment : punishClient.GetPunishments().get(Category.Hacking)) { - if (punishment.GetAdmin().equalsIgnoreCase(NAME) && punishment.GetReason().contains("[GWEN]")) + if (punishment.GetAdmin().equalsIgnoreCase(NAME) && punishment.GetReason().contains("[GWEN")) { totalPunishments++; } @@ -368,37 +368,18 @@ public class AntiHack extends MiniPlugin return totalPunishments; } - public int getDaysBanned(Player player, Class check) + public int getHoursBanned(Player player, Class check) { - if (check == null) // old banwaves - { - switch (getPunishments(player)) - { - case 0: - return 5; - case 1: - return 14; - case 2: - return 30; - default: - return -1; - } - } - - switch (check.getSimpleName()) + switch (getPunishments(player)) { + case 0: + return 5 * 24; + case 1: + return 14 * 24; + case 2: + return 30 * 24; default: - switch (getPunishments(player)) - { - case 0: - return 5; - case 1: - return 14; - case 2: - return 30; - default: - return -1; - } + return -1; } }