From 8d7d5264e591b84e204e2733fe8fb8447c69bb8c Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Thu, 16 May 2019 19:46:37 +0300 Subject: [PATCH] Closes #28 --- sqlupdates/2_0_0-RC-2_TO_2_0_0-RC-3.sql | 3 +++ src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/sqlupdates/2_0_0-RC-2_TO_2_0_0-RC-3.sql b/sqlupdates/2_0_0-RC-2_TO_2_0_0-RC-3.sql index f6e347dd..6769fd62 100644 --- a/sqlupdates/2_0_0-RC-2_TO_2_0_0-RC-3.sql +++ b/sqlupdates/2_0_0-RC-2_TO_2_0_0-RC-3.sql @@ -8,4 +8,7 @@ ADD COLUMN `build_hash` varchar(64) NOT NULL AFTER `version`; INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('scripter.modtool.tickets', '1'); +INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('invisible.prevent.chat', '0'); +INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('invisible.prevent.chat.error', 'While being invisible you cannot talk.'); + #END DATABASE UPDATE: 2.0.0 RC-2 -> 2.0.0 RC-3 \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 6e0243ed..66a347e5 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -3711,6 +3711,14 @@ public class Room implements Comparable, ISerialize, Runnable if (!habbo.getHabboStats().allowTalk()) return; + if (habbo.getRoomUnit().isInvisible() && Emulator.getConfig().getBoolean("invisible.prevent.chat", false)) { + if (!CommandHandler.handleCommand(habbo.getClient(), roomChatMessage.getUnfilteredMessage())) { + habbo.whisper(Emulator.getTexts().getValue("invisible.prevent.chat.error")); + } + + return; + } + habbo.getHabboStats().chatCounter += 2; if (habbo.getHabboInfo().getCurrentRoom() != this)