From 3c5f2712e61f6a6ee41b6d518085e6eec8830f6a Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sat, 8 Feb 2014 08:15:21 +0000 Subject: [PATCH] Readd Spam Filter Exclusions patch --- .../0108-Spam-Filter-Exclusions.patch | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 CraftBukkit-Patches/0108-Spam-Filter-Exclusions.patch diff --git a/CraftBukkit-Patches/0108-Spam-Filter-Exclusions.patch b/CraftBukkit-Patches/0108-Spam-Filter-Exclusions.patch new file mode 100644 index 0000000000..1b9779c627 --- /dev/null +++ b/CraftBukkit-Patches/0108-Spam-Filter-Exclusions.patch @@ -0,0 +1,52 @@ +From 008bd884e078247a4aac20828ae5dd3ae2ad20e9 Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Sat, 8 Feb 2014 08:13:40 +0000 +Subject: [PATCH] Spam Filter Exclusions + + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 2b68b96..ddffc96 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -836,9 +836,19 @@ public class PlayerConnection implements PacketPlayInListener { + this.minecraftServer.getPlayerList().sendMessage(chatmessage1, false); + } + ++ // Spigot - spam exclusions ++ boolean counted = true; ++ for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions ) ++ { ++ if ( exclude != null && s.startsWith( exclude ) ) ++ { ++ counted = false; ++ break; ++ } ++ } + // CraftBukkit start - replaced with thread safe throttle + // this.chatThrottle += 20; +- if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getName())) { ++ if (counted && chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getName())) { + // CraftBukkit end + if (packetplayinchat.a()) { // Spigot - Thread safety + Waitable waitable = new Waitable() { +diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java +index 769ef2a..3122a18 100755 +--- a/src/main/java/org/spigotmc/SpigotConfig.java ++++ b/src/main/java/org/spigotmc/SpigotConfig.java +@@ -266,4 +266,13 @@ public class SpigotConfig + { + playerShuffle = getInt( "settings.player-shuffle", 0 ); + } ++ ++ public static List spamExclusions; ++ private static void spamExclusions() ++ { ++ spamExclusions = getList( "commands.spam-exclusions", Arrays.asList( new String[] ++ { ++ "/skill" ++ } ) ); ++ } + } +-- +1.8.4.msysgit.0 +