From 3bc368277115436d3e693f5331eba01d45f41c33 Mon Sep 17 00:00:00 2001 From: David Silva Date: Tue, 21 Jan 2020 15:22:19 +0100 Subject: [PATCH 1/2] fix(ModToolSanctionInfoComposer): small patch regarding time --- .../modtool/ModToolSanctionInfoComposer.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java index 5acfeaf3..b90266d0 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java @@ -31,8 +31,6 @@ public class ModToolSanctionInfoComposer extends MessageComposer { Date probationEndTime; Date probationStartTime = null; - long numberOfDaysProbation = 0; - long numberOfHoursProbation = 0; if (modToolSanctionItems != null && modToolSanctionItems.size() > 0) { ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1); @@ -44,9 +42,6 @@ public class ModToolSanctionInfoComposer extends MessageComposer { if (item.probationTimestamp > 0) { probationEndTime = new Date((long) item.probationTimestamp * 1000); - long diff = probationEndTime.getTime() - Emulator.getDate().getTime(); - numberOfDaysProbation = diff / 1000 / 60 / 60 / 24; - numberOfHoursProbation = diff / 1000 / 60 / 60; probationStartTime = new DateTime(probationEndTime).minusDays(modToolSanctions.getProbationDays(modToolSanctionLevelItem)).toDate(); @@ -63,11 +58,11 @@ public class ModToolSanctionInfoComposer extends MessageComposer { this.response.appendBoolean(prevItem); // has prev sanction this.response.appendBoolean(item.probationTimestamp >= Emulator.getIntUnixTimestamp()); // is on probation this.response.appendString(modToolSanctions.getSanctionType(modToolSanctionLevelItem)); // current sanction type - this.response.appendInt(Math.toIntExact(numberOfDaysProbation)); // probation days left + this.response.appendInt(modToolSanctions.getTimeOfSanction(modToolSanctionLevelItem)); // time of current sanction this.response.appendInt(30); // unused? this.response.appendString(item.reason.equals("") ? "cfh.reason.EMPTY" : item.reason); // reason this.response.appendString(probationStartTime == null ? Emulator.getDate().toString() : probationStartTime.toString()); // probation start time - this.response.appendInt(Math.toIntExact(numberOfHoursProbation)); // days of probation in hours? + this.response.appendInt(0); // unused? this.response.appendString(modToolSanctions.getSanctionType(nextModToolSanctionLevelItem)); // next sanction type this.response.appendInt(modToolSanctions.getTimeOfSanction(nextModToolSanctionLevelItem)); // time to be applied in next sanction (in hours) this.response.appendInt(30); // unused? @@ -80,11 +75,11 @@ public class ModToolSanctionInfoComposer extends MessageComposer { this.response.appendBoolean(false); // has prev sanction this.response.appendBoolean(false); // is on probation this.response.appendString("ALERT"); // last sanction type - this.response.appendInt(0); // probation days left + this.response.appendInt(0); // time of current sanction this.response.appendInt(30); // unused? this.response.appendString("cfh.reason.EMPTY"); // reason this.response.appendString(Emulator.getDate().toString()); // probation start time - this.response.appendInt(0); // days of probation in hours? + this.response.appendInt(0); // unused? this.response.appendString("ALERT"); // next sanction type this.response.appendInt(0); // time to be applied in next sanction (in hours) this.response.appendInt(30); // unused? From f1e3a3126a102ea46be4f38a19ede92307ccf446 Mon Sep 17 00:00:00 2001 From: David Silva Date: Tue, 21 Jan 2020 09:25:55 -0500 Subject: [PATCH 2/2] Update ModToolSanctionInfoComposer.java --- .../modtool/ModToolSanctionInfoComposer.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java index b90266d0..288d2ff9 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java @@ -59,13 +59,13 @@ public class ModToolSanctionInfoComposer extends MessageComposer { this.response.appendBoolean(item.probationTimestamp >= Emulator.getIntUnixTimestamp()); // is on probation this.response.appendString(modToolSanctions.getSanctionType(modToolSanctionLevelItem)); // current sanction type this.response.appendInt(modToolSanctions.getTimeOfSanction(modToolSanctionLevelItem)); // time of current sanction - this.response.appendInt(30); // unused? + this.response.appendInt(30); // TODO: unused? this.response.appendString(item.reason.equals("") ? "cfh.reason.EMPTY" : item.reason); // reason this.response.appendString(probationStartTime == null ? Emulator.getDate().toString() : probationStartTime.toString()); // probation start time - this.response.appendInt(0); // unused? + this.response.appendInt(0); // TODO: unused? this.response.appendString(modToolSanctions.getSanctionType(nextModToolSanctionLevelItem)); // next sanction type this.response.appendInt(modToolSanctions.getTimeOfSanction(nextModToolSanctionLevelItem)); // time to be applied in next sanction (in hours) - this.response.appendInt(30); // unused? + this.response.appendInt(30); // TODO: unused? this.response.appendBoolean(item.isMuted); // muted this.response.appendString(tradeLockedUntil == null ? "" : tradeLockedUntil.toString()); // trade locked until @@ -76,13 +76,13 @@ public class ModToolSanctionInfoComposer extends MessageComposer { this.response.appendBoolean(false); // is on probation this.response.appendString("ALERT"); // last sanction type this.response.appendInt(0); // time of current sanction - this.response.appendInt(30); // unused? + this.response.appendInt(30); // TODO: unused? this.response.appendString("cfh.reason.EMPTY"); // reason this.response.appendString(Emulator.getDate().toString()); // probation start time - this.response.appendInt(0); // unused? + this.response.appendInt(0); // TODO: unused? this.response.appendString("ALERT"); // next sanction type this.response.appendInt(0); // time to be applied in next sanction (in hours) - this.response.appendInt(30); // unused? + this.response.appendInt(30); // TODO: unused? this.response.appendBoolean(false); // muted this.response.appendString(""); // trade locked until