From ab5c491aa54f5d3a27bf65a92d337199465c92c4 Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Tue, 12 Apr 2022 23:03:48 -0300 Subject: [PATCH] Fix mannequin name --- sqlupdates/3_0_0 to 3_0_1.sql | 5 ++++- .../incoming/rooms/items/MannequinSaveNameEvent.java | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sqlupdates/3_0_0 to 3_0_1.sql b/sqlupdates/3_0_0 to 3_0_1.sql index 90f04e8b..b07fe18c 100644 --- a/sqlupdates/3_0_0 to 3_0_1.sql +++ b/sqlupdates/3_0_0 to 3_0_1.sql @@ -84,4 +84,7 @@ INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.description.cmd_ INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.success.cmd_update_calendar', 'Calendar updated successfully!'); -- add moodlight configuration -INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('moodlight.color_check.enabled', '1'); \ No newline at end of file +INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('moodlight.color_check.enabled', '1'); + +-- Mannequin name +INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('hotel.mannequin.name.default', 'My look'); \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MannequinSaveNameEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MannequinSaveNameEvent.java index ad09fc3c..c5c94204 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MannequinSaveNameEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MannequinSaveNameEvent.java @@ -18,6 +18,11 @@ public class MannequinSaveNameEvent extends MessageHandler { String[] data = item.getExtradata().split(":"); String name = this.packet.readString(); + + if (name.length() < 3 || name.length() > 15) { + name = Emulator.getTexts().getValue("hotel.mannequin.name.default", "My look"); + } + if (data.length == 3) { item.setExtradata(this.client.getHabbo().getHabboInfo().getGender().name().toUpperCase() + ":" + data[1] + ":" + name); } else {