Paper/Spigot-Server-Patches/0021-Toggle-for-player-interact-limiter.patch

42 lines
2.0 KiB
Diff
Raw Normal View History

From 2e6771696e929e2f7ed3005f221c2145fe356546 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
2014-08-06 01:45:22 +02:00
Date: Tue, 5 Aug 2014 17:56:02 -0500
Subject: [PATCH] Toggle for player interact limiter
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e8bfc41..7f7cc13 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -587,7 +587,8 @@ public class PlayerConnection implements PacketPlayInListener {
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
boolean throttled = false;
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
2014-08-06 01:45:22 +02:00
+ // PaperSpigot - Allow disabling the player interaction limiter
+ if (org.github.paperspigot.PaperSpigotConfig.interactLimitEnabled && lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
throttled = true;
} else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 )
{
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
2014-08-06 01:45:22 +02:00
index 2cc159b..25a94a6 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
2014-08-06 01:45:22 +02:00
@@ -152,4 +152,13 @@ public class PaperSpigotConfig
Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this may be bad depending on your plugins" );
}
}
+
+ public static boolean interactLimitEnabled;
+ private static void interactLimitEnabled()
+ {
+ interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true );
2014-08-06 01:45:22 +02:00
+ if (!interactLimitEnabled) {
+ Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
+ }
+ }
}
--
1.9.1