From 2622140d5a0cb56aaf34390df5372773610b44f4 Mon Sep 17 00:00:00 2001 From: David Silva Date: Fri, 24 Jan 2020 22:57:18 +0100 Subject: [PATCH] fix(ModToolSanctionEvents): run if timestamp is back to 0 --- .../incoming/modtool/ModToolSanctionAlertEvent.java | 2 ++ .../messages/incoming/modtool/ModToolSanctionBanEvent.java | 2 ++ .../messages/incoming/modtool/ModToolSanctionMuteEvent.java | 6 ++++++ .../incoming/modtool/ModToolSanctionTradeLockEvent.java | 2 ++ 4 files changed, 12 insertions(+) diff --git a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionAlertEvent.java b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionAlertEvent.java index 98e27cc6..c0f8bae8 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionAlertEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionAlertEvent.java @@ -36,6 +36,8 @@ public class ModToolSanctionAlertEvent extends MessageHandler { if (item != null && item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) { modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0); + } else { + modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0); } } else { modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0); diff --git a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionBanEvent.java b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionBanEvent.java index 59e05e89..c3035034 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionBanEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionBanEvent.java @@ -60,6 +60,8 @@ public class ModToolSanctionBanEvent extends MessageHandler { if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) { modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0); + } else { + modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0); } } else { modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0); diff --git a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java index cdd18350..c99eee68 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java @@ -41,6 +41,12 @@ public class ModToolSanctionMuteEvent extends MessageHandler { int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000); + modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp); + } else { + ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel); + + int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000); + modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp); } } else { diff --git a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionTradeLockEvent.java b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionTradeLockEvent.java index 1969da0f..48e14a38 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionTradeLockEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionTradeLockEvent.java @@ -36,6 +36,8 @@ public class ModToolSanctionTradeLockEvent extends MessageHandler { if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) { modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, duration, false, 0); + } else { + modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, duration, false, 0); } } else { modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, duration, false, 0);