mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Raise packet tolerance in spam threshold patch
Fixes GH-462
This commit is contained in:
parent
c0aeab4cf9
commit
f0acdb8df6
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue