From b668bfd99a2d5484025d92fb78dfba64fef43301 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 23 Mar 2022 03:15:25 -0500 Subject: [PATCH] add moodlight color config --- sqlupdates/3_0_0 to 3_0_1.sql | 3 +++ .../incoming/rooms/items/MoodLightSaveSettingsEvent.java | 2 +- 2 files changed, 4 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 248827a8..e48d67a3 100644 --- a/sqlupdates/3_0_0 to 3_0_1.sql +++ b/sqlupdates/3_0_0 to 3_0_1.sql @@ -80,3 +80,6 @@ ALTER TABLE `permissions` ADD COLUMN `acc_calendar_force` enum('0','1') NULL DEF ALTER TABLE `permissions` ADD `cmd_update_calendar` ENUM('0', '1') NOT NULL DEFAULT '0'; INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.description.cmd_update_calendar', ':update_calendar'), ('commands.keys.cmd_update_calendar', 'update_calendar'); 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 diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoodLightSaveSettingsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoodLightSaveSettingsEvent.java index 731e6490..894e83c9 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoodLightSaveSettingsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoodLightSaveSettingsEvent.java @@ -30,7 +30,7 @@ public class MoodLightSaveSettingsEvent extends MessageHandler { int brightness = this.packet.readInt(); boolean apply = this.packet.readBoolean(); - if (!MOODLIGHT_AVAILABLE_COLORS.contains(color)) { + if (Emulator.getConfig().getBoolean("moodlight.color_check.enabled", true) && !MOODLIGHT_AVAILABLE_COLORS.contains(color)) { ScripterManager.scripterDetected(this.client, "User tried to set a moodlight to a non-whitelisted color: " + color); return; }