2015-02-24 05:03:10 +08:00
|
|
|
From 0f98d5f5793dde56cee3130d5d418e28d2412fdb Mon Sep 17 00:00:00 2001
|
2015-01-30 05:25:50 +08:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
2014-11-28 09:17:45 +08:00
|
|
|
Date: Fri, 28 Nov 2014 01:33:25 -0600
|
2014-07-11 21:17:54 +08:00
|
|
|
Subject: [PATCH] Toggle for player interact limiter
|
2014-07-03 13:57:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2015-02-24 05:03:10 +08:00
|
|
|
index a09e793..a7c629b 100644
|
2014-07-03 13:57:36 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2014-12-08 03:29:55 +08:00
|
|
|
@@ -626,7 +626,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
2014-11-28 09:17:45 +08:00
|
|
|
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.u());
|
|
|
|
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
2014-07-03 13:57:36 +08:00
|
|
|
boolean throttled = false;
|
2014-07-25 11:21:57 +08:00
|
|
|
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
2014-08-06 07:45:22 +08:00
|
|
|
+ // PaperSpigot - Allow disabling the player interaction limiter
|
|
|
|
+ if (org.github.paperspigot.PaperSpigotConfig.interactLimitEnabled && lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
2014-07-03 13:57:36 +08:00
|
|
|
throttled = true;
|
2014-07-25 11:21:57 +08:00
|
|
|
} else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 )
|
2014-07-03 13:57:36 +08:00
|
|
|
{
|
|
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
2014-08-06 07:45:22 +08:00
|
|
|
index 2cc159b..25a94a6 100644
|
2014-07-03 13:57:36 +08:00
|
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
2014-08-06 07:45:22 +08: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" );
|
2014-07-03 13:57:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
2014-07-11 21:17:54 +08:00
|
|
|
+ public static boolean interactLimitEnabled;
|
|
|
|
+ private static void interactLimitEnabled()
|
2014-07-03 13:57:36 +08:00
|
|
|
+ {
|
2014-07-11 21:17:54 +08:00
|
|
|
+ interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true );
|
2014-08-06 07:45:22 +08:00
|
|
|
+ if (!interactLimitEnabled) {
|
|
|
|
+ Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
|
|
|
|
+ }
|
2014-07-03 13:57:36 +08:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2015-01-30 05:26:20 +08:00
|
|
|
1.9.5.msysgit.0
|
2014-07-03 13:57:36 +08:00
|
|
|
|