fix(ModToolSanctionEvents): run if timestamp is back to 0

This commit is contained in:
David Silva 2020-01-24 22:57:18 +01:00
parent 72adc5325d
commit 2622140d5a
4 changed files with 12 additions and 0 deletions

View File

@ -36,6 +36,8 @@ public class ModToolSanctionAlertEvent extends MessageHandler {
if (item != null && item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) { if (item != null && item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0); 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 { } else {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0); modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);

View File

@ -60,6 +60,8 @@ public class ModToolSanctionBanEvent extends MessageHandler {
if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) { if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0); 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 { } else {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0); modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);

View File

@ -41,6 +41,12 @@ public class ModToolSanctionMuteEvent extends MessageHandler {
int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000); 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); modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp);
} }
} else { } else {

View File

@ -36,6 +36,8 @@ public class ModToolSanctionTradeLockEvent extends MessageHandler {
if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) { if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, duration, false, 0); 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 { } else {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, duration, false, 0); modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, duration, false, 0);