From c4342e20af35ae843e29c7ab8f7a46e35c7fe755 Mon Sep 17 00:00:00 2001 From: brenoepics <59066707+brenoepics@users.noreply.github.com> Date: Thu, 3 Mar 2022 16:05:43 -0300 Subject: [PATCH] fix trophies --- sqlupdates/3_0_0 to 3_0_1.sql | 2 ++ .../java/com/eu/habbo/habbohotel/catalog/CatalogManager.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/sqlupdates/3_0_0 to 3_0_1.sql b/sqlupdates/3_0_0 to 3_0_1.sql index 9cbec636..18fdd983 100644 --- a/sqlupdates/3_0_0 to 3_0_1.sql +++ b/sqlupdates/3_0_0 to 3_0_1.sql @@ -8,3 +8,5 @@ INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('console.mode', '1'); -- Youtube Api v3 key to YoutubeManager INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('youtube.apikey', ''); + +INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.trophies.length.max', '300'); \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java index 6eb01a77..93547337 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java @@ -1002,6 +1002,10 @@ public class CatalogManager { extradata = "UMAD"; } + if (extradata.length() > Emulator.getConfig().getInt("hotel.trophies.length.max", 300)) { + extradata = extradata.substring(0, Emulator.getConfig().getInt("hotel.trophies.length.max", 300)); + } + extradata = habbo.getClient().getHabbo().getHabboInfo().getUsername() + (char) 9 + Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "-" + (Calendar.getInstance().get(Calendar.MONTH) + 1) + "-" + Calendar.getInstance().get(Calendar.YEAR) + (char) 9 + Emulator.getGameEnvironment().getWordFilter().filter(extradata.replace(((char) 9) + "", ""), habbo); }