mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 19:52:55 +01:00
8bbab87c6b
3e3ea0bd0d8 320ed92779f 612de468951
61 lines
2.4 KiB
Diff
61 lines
2.4 KiB
Diff
From 9b45bc22d574c989261a1116192e793ca5434d9a Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 0839eff..22f1300 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -951,9 +951,20 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
|
this.minecraftServer.getPlayerList().sendMessage(chatmessage1, false);
|
|
}
|
|
|
|
+ // Spigot start - spam exclusions
|
|
+ boolean counted = true;
|
|
+ for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions )
|
|
+ {
|
|
+ if ( exclude != null && s.startsWith( exclude ) )
|
|
+ {
|
|
+ counted = false;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ // Spigot end
|
|
// CraftBukkit start - replaced with thread safe throttle
|
|
// this.chatThrottle += 20;
|
|
- if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) {
|
|
+ if (counted && chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { // Spigot
|
|
if (!isSync) {
|
|
Waitable waitable = new Waitable() {
|
|
@Override
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
index f19d415..8419c28 100644
|
|
--- 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;
|
|
@@ -279,4 +280,13 @@ public class SpigotConfig
|
|
{
|
|
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"
|
|
+ } ) );
|
|
+ }
|
|
}
|
|
--
|
|
2.1.0
|
|
|