2014-04-02 09:00:58 +02:00
|
|
|
From de99e5f686fd953184ff846ffcbf7034c8665245 Mon Sep 17 00:00:00 2001
|
2014-02-08 09:15:21 +01:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
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
|
2014-03-26 21:34:47 +01:00
|
|
|
index 28bf9d4..92f95d7 100644
|
2014-02-08 09:15:21 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2014-02-24 08:04:12 +01:00
|
|
|
@@ -848,9 +848,19 @@ public class PlayerConnection implements PacketPlayInListener {
|
2014-02-08 09:15:21 +01:00
|
|
|
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())) {
|
2014-02-12 14:48:26 +01:00
|
|
|
if (packetplayinchat.a()) {
|
2014-02-08 09:15:21 +01:00
|
|
|
Waitable waitable = new Waitable() {
|
2014-02-12 14:48:26 +01:00
|
|
|
@Override
|
2014-02-08 09:15:21 +01:00
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
2014-04-02 09:00:58 +02:00
|
|
|
index e26b964..5d65983 100644
|
2014-02-08 09:15:21 +01:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
2014-02-12 14:48:26 +01:00
|
|
|
@@ -6,6 +6,7 @@ import java.io.IOException;
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.lang.reflect.Modifier;
|
|
|
|
+import java.util.Arrays;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
2014-04-02 09:00:58 +02:00
|
|
|
@@ -262,4 +263,13 @@ public class SpigotConfig
|
2014-02-08 09:15:21 +01:00
|
|
|
{
|
|
|
|
playerShuffle = getInt( "settings.player-shuffle", 0 );
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static List<String> spamExclusions;
|
|
|
|
+ private static void spamExclusions()
|
|
|
|
+ {
|
|
|
|
+ spamExclusions = getList( "commands.spam-exclusions", Arrays.asList( new String[]
|
|
|
|
+ {
|
|
|
|
+ "/skill"
|
|
|
|
+ } ) );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2014-04-02 09:00:58 +02:00
|
|
|
1.8.3.2
|
2014-02-08 09:15:21 +01:00
|
|
|
|