Merge branch 'mute-time-config' into 'dev'

Make flood time configurable

See merge request morningstar/Arcturus-Community!241
This commit is contained in:
Mike 2020-06-12 14:53:40 -04:00
commit 38cf88aeac
2 changed files with 7 additions and 3 deletions

View File

@ -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');

View File

@ -204,6 +204,7 @@ public class Room implements Comparable<Room>, 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<Room>, 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);
}
}
}