apply a couple network patches

This commit is contained in:
Jake Potrebic
2023-06-08 09:09:43 -07:00
parent 8ca7fa95c0
commit e516ecfd45
5 changed files with 5 additions and 24 deletions

View File

@@ -28,9 +28,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -0,0 +0,0 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
private static boolean enableExplicitFlush = Boolean.getBoolean("paper.explicit-flush");
// Paper end
}
}
// Paper end - allow controlled flushing
+ // Paper start - packet limiter
+ protected final Object PACKET_LIMIT_LOCK = new Object();
+ protected final @Nullable io.papermc.paper.util.IntervalledCounter allPacketCounts = io.papermc.paper.configuration.GlobalConfiguration.get().packetLimiter.allPackets.isEnabled() ? new io.papermc.paper.util.IntervalledCounter(
@@ -47,10 +47,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.stopReadingPackets = true;
+ }
+ // Paper end - packet limiter
+
public Connection(PacketFlow side) {
this.receiving = side;
}
@@ -0,0 +0,0 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
protected void channelRead0(ChannelHandlerContext channelhandlercontext, Packet<?> packet) {