Fix Anticheat ban lengths

This commit is contained in:
cnr 2017-05-15 16:37:14 -07:00
parent 9cf5fda540
commit 9bc118dc41
1 changed files with 12 additions and 31 deletions

View File

@ -233,7 +233,7 @@ public class AntiHack extends MiniPlugin
_compromisedAccountManager.submitImmediateBan(player); _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)) if (coreClient.GetRank().has(Rank.TWITCH))
@ -272,7 +272,7 @@ public class AntiHack extends MiniPlugin
Consumer<Consumer<PunishmentResponse>> doPunish = after -> Consumer<Consumer<PunishmentResponse>> 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)) if (coreClient.GetRank().has(Rank.TWITCH))
@ -358,7 +358,7 @@ public class AntiHack extends MiniPlugin
{ {
for (Punishment punishment : punishClient.GetPunishments().get(Category.Hacking)) 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++; totalPunishments++;
} }
@ -368,37 +368,18 @@ public class AntiHack extends MiniPlugin
return totalPunishments; return totalPunishments;
} }
public int getDaysBanned(Player player, Class<? extends Check> check) public int getHoursBanned(Player player, Class<? extends Check> check)
{ {
if (check == null) // old banwaves switch (getPunishments(player))
{
switch (getPunishments(player))
{
case 0:
return 5;
case 1:
return 14;
case 2:
return 30;
default:
return -1;
}
}
switch (check.getSimpleName())
{ {
case 0:
return 5 * 24;
case 1:
return 14 * 24;
case 2:
return 30 * 24;
default: default:
switch (getPunishments(player)) return -1;
{
case 0:
return 5;
case 1:
return 14;
case 2:
return 30;
default:
return -1;
}
} }
} }