Raise packet tolerance in spam threshold patch

Fixes GH-462
This commit is contained in:
Zach Brown 2016-11-04 22:31:37 -05:00
parent c0aeab4cf9
commit f0acdb8df6
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76

View file

@ -1,4 +1,4 @@
From 0e7be255474cb7e18c4eecdfd729cb55428bd0d7 Mon Sep 17 00:00:00 2001
From 84581d78245fe3ec6935a2d67cfdd4c612e964e8 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
@ -23,7 +23,7 @@ index 91546b6..211b88a 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 5cbced0..d82eec9 100644
index 5cbced0..6ed369f 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -868,13 +868,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -34,7 +34,7 @@ index 5cbced0..d82eec9 100644
private boolean checkLimit(long timestamp) {
- if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < 30 && limitedPackets++ >= 4) {
+ if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < THRESHOLD && limitedPackets++ >= 4) { // Paper
+ if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < THRESHOLD && limitedPackets++ >= 8) { // Paper - Use threshold, raise packet limit to 8
return false;
}
@ -44,5 +44,5 @@ index 5cbced0..d82eec9 100644
limitedPackets = 0;
return true;
--
2.9.3
2.10.2