2016-06-15 22:43:51 +00:00
|
|
|
From e0a86e364a8ce22e9465fdbb332de75844adfc1a Mon Sep 17 00:00:00 2001
|
2016-02-29 23:09:49 +00:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
|
|
Date: Tue, 1 Mar 2016 13:31:05 -0600
|
|
|
|
Subject: [PATCH] Toggle for player interact limiter
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2016-06-09 03:57:14 +00:00
|
|
|
index 7739e78..87bae87 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2016-05-02 03:54:08 +00:00
|
|
|
@@ -184,4 +184,12 @@ public class PaperConfig {
|
|
|
|
" - Interval: " + timeSummary(Timings.getHistoryInterval() / 20) +
|
|
|
|
" - Length: " + timeSummary(Timings.getHistoryLength() / 20));
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static boolean useInteractLimiter;
|
|
|
|
+ private static void useInteractLimiter() {
|
|
|
|
+ useInteractLimiter = getBoolean("settings.limit-player-interactions", true);
|
|
|
|
+ if (!useInteractLimiter) {
|
|
|
|
+ Bukkit.getLogger().log(Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2016-06-15 22:43:51 +00:00
|
|
|
index 1a39ba3..5bbb644 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2016-06-15 22:43:51 +00:00
|
|
|
@@ -914,7 +914,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2016-02-29 23:09:49 +00:00
|
|
|
this.player.resetIdleTimer();
|
|
|
|
// Spigot start
|
|
|
|
boolean throttled = false;
|
|
|
|
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
|
|
|
+ // Paper - Allow disabling interact limiter
|
|
|
|
+ if (com.destroystokyo.paper.PaperConfig.useInteractLimiter && lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
|
|
|
throttled = true;
|
|
|
|
} else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 )
|
|
|
|
{
|
|
|
|
--
|
2016-06-15 22:43:51 +00:00
|
|
|
2.8.3.windows.1
|
2016-02-29 23:09:49 +00:00
|
|
|
|