Merge branch '318-sanction0ed' into 'dev'

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

See merge request morningstar/Arcturus-Community!85
This commit is contained in:
Alejandro 2020-01-27 18:36:51 -05:00
commit 2ee6332aed
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()) {
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);

View File

@ -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);

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);
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 {

View File

@ -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);