From bc30623a051a671893a88069c028703b01efa552 Mon Sep 17 00:00:00 2001 From: Swirny <140-Swirny@users.noreply.git.krews.org> Date: Fri, 12 Jun 2020 14:53:40 -0400 Subject: [PATCH] Make flood time configurable --- sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql | 3 +++ src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql b/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql index 8e71d599..cd58db0d 100644 --- a/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql +++ b/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql @@ -25,3 +25,6 @@ ALTER TABLE `users_settings` ADD `tradelock_amount` INT(11) NOT NULL DEFAULT '0' -- Gift wrapping configuration INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.gifts.box_types', '0,1,2,3,4,5,6,8'); INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.gifts.ribbon_types', '0,1,2,3,4,5,6,7,8,9,10'); + +-- Configurable mute time +INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.flood.mute.time', '30'); \ 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 5251c9b5..e0dee0a1 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -204,6 +204,7 @@ public class Room implements Comparable, ISerialize, Runnable { private int idleCycles; private volatile int unitCounter; private volatile int rollerSpeed; + private int muteTime = Emulator.getConfig().getInt("hotel.flood.mute.time"); private long rollerCycle = System.currentTimeMillis(); private volatile int lastTimerReset = Emulator.getIntUnixTimestamp(); private volatile boolean muted; @@ -1209,11 +1210,11 @@ public class Room implements Comparable, ISerialize, Runnable { if (floodRights || !hasRights) { if (this.chatProtection == 0) { - this.floodMuteHabbo(habbo, 30); + this.floodMuteHabbo(habbo, muteTime); } else if (this.chatProtection == 1 && habbo.getHabboStats().chatCounter > 4) { - this.floodMuteHabbo(habbo, 30); + this.floodMuteHabbo(habbo, muteTime); } else if (this.chatProtection == 2 && habbo.getHabboStats().chatCounter > 5) { - this.floodMuteHabbo(habbo, 30); + this.floodMuteHabbo(habbo, muteTime); } } }