2019-03-17 11:48:53 +11:00
|
|
|
From 08a56fde1ad2c6b49c9dcfeef572f87712459937 Mon Sep 17 00:00:00 2001
|
2014-04-12 14:18:37 +10: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
|
2019-03-17 11:48:53 +11:00
|
|
|
index 2429e30ee..0e423dfac 100644
|
2014-04-12 14:18:37 +10:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2019-03-17 11:48:53 +11:00
|
|
|
@@ -1463,9 +1463,20 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2018-07-15 10:00:00 +10:00
|
|
|
this.minecraftServer.getPlayerList().sendMessage(chatmessage, false);
|
2014-04-12 14:18:37 +10:00
|
|
|
}
|
|
|
|
|
2014-11-26 08:27:08 +11:00
|
|
|
+ // Spigot start - spam exclusions
|
2014-04-12 14:18:37 +10:00
|
|
|
+ boolean counted = true;
|
|
|
|
+ for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions )
|
|
|
|
+ {
|
|
|
|
+ if ( exclude != null && s.startsWith( exclude ) )
|
|
|
|
+ {
|
|
|
|
+ counted = false;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
2014-11-26 08:27:08 +11:00
|
|
|
+ // Spigot end
|
2014-04-12 14:18:37 +10:00
|
|
|
// CraftBukkit start - replaced with thread safe throttle
|
|
|
|
// this.chatThrottle += 20;
|
|
|
|
- if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) {
|
2014-11-26 08:27:08 +11:00
|
|
|
+ if (counted && chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { // Spigot
|
|
|
|
if (!isSync) {
|
2014-04-12 14:18:37 +10:00
|
|
|
Waitable waitable = new Waitable() {
|
|
|
|
@Override
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
2018-12-28 10:22:10 +11:00
|
|
|
index cff1da746..20a83a6fc 100644
|
2014-04-12 14:18:37 +10:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
@@ -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;
|
2018-12-28 10:22:10 +11:00
|
|
|
@@ -289,4 +290,13 @@ public class SpigotConfig
|
2014-04-12 14:18:37 +10: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"
|
|
|
|
+ } ) );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2018-11-14 14:20:34 +11:00
|
|
|
2.19.1
|
2014-04-12 14:18:37 +10:00
|
|
|
|