From 1db6571db6498d669d295a2f8578a4c50ef82232 Mon Sep 17 00:00:00 2001 From: harmonic Date: Thu, 4 Jun 2020 16:52:04 +0100 Subject: [PATCH] Runs the flood protection everytime someone talks, as well as via the room cycle, fixing a tanji exploit. --- .../java/com/eu/habbo/habbohotel/rooms/Room.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 10484daf..dfa02ad9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -3040,6 +3040,20 @@ public class Room implements Comparable, ISerialize, Runnable { if (habbo.getHabboInfo().getCurrentRoom() != this) return; + if (!habbo.hasPermission(Permission.ACC_CHAT_NO_FLOOD) && habbo.getHabboStats().chatCounter > 0) { + int chatCounter = habbo.getHabboStats().chatCounter - 1; + + if (chatCounter > 3 && !this.hasRights(habbo)) { + if (this.chatProtection == 0) { + this.floodMuteHabbo(habbo, 30); + } else if (this.chatProtection == 1 && chatCounter > 4) { + this.floodMuteHabbo(habbo, 30); + } else if (this.chatProtection == 2 && chatCounter > 5) { + this.floodMuteHabbo(habbo, 30); + } + } + } + long millis = System.currentTimeMillis(); if (HABBO_CHAT_DELAY) { if (millis - habbo.getHabboStats().lastChat < 750) {