mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
e4d10a6d67
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 122289ff Add FaceAttachable interface to handle Grindstone facing in common with Switches a6db750e SPIGOT-5647: ZombieVillager entity should have getVillagerType() CraftBukkit Changes:bbe3d58e
SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException3075579f
Add FaceAttachable interface to handle Grindstone facing in common with Switches95bd4238
SPIGOT-5647: ZombieVillager entity should have getVillagerType()4d975ac3
SPIGOT-5617: setBlockData does not work when NotPlayEvent is called by redstone current
49 lines
2.3 KiB
Diff
49 lines
2.3 KiB
Diff
From 43dfe118b9c76025227c5e16d5fba88210cbed84 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
Date: Sun, 11 Sep 2016 14:30:57 -0500
|
|
Subject: [PATCH] Configurable packet in spam threshold
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
index 53f96a1576..010b17d2e7 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
@@ -243,4 +243,13 @@ public class PaperConfig {
|
|
public static boolean isProxyOnlineMode() {
|
|
return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode);
|
|
}
|
|
+
|
|
+ public static int packetInSpamThreshold = 300;
|
|
+ private static void packetInSpamThreshold() {
|
|
+ if (version < 11) {
|
|
+ int oldValue = getInt("settings.play-in-use-item-spam-threshold", 300);
|
|
+ set("settings.incoming-packet-spam-threshold", oldValue);
|
|
+ }
|
|
+ packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300);
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
index 7476f07aa1..f057ebda81 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -1204,13 +1204,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
// Spigot start - limit place/interactions
|
|
private int limitedPackets;
|
|
private long lastLimitedPacket = -1;
|
|
+ private static final int THRESHOLD = com.destroystokyo.paper.PaperConfig.packetInSpamThreshold; // Paper - Configurable threshold
|
|
|
|
private boolean checkLimit(long timestamp) {
|
|
- if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < 30 && limitedPackets++ >= 4) {
|
|
+ if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < THRESHOLD && limitedPackets++ >= 8) { // Paper - Use threshold, raise packet limit to 8
|
|
return false;
|
|
}
|
|
|
|
- if (lastLimitedPacket == -1 || timestamp - lastLimitedPacket >= 30) {
|
|
+ if (lastLimitedPacket == -1 || timestamp - lastLimitedPacket >= THRESHOLD) { // Paper
|
|
lastLimitedPacket = timestamp;
|
|
limitedPackets = 0;
|
|
return true;
|
|
--
|
|
2.25.1
|
|
|