diff options
Diffstat (limited to 'patches/server/0985-Optimize-Network-Manager-and-add-advanced-packet-sup.patch')
-rw-r--r-- | patches/server/0985-Optimize-Network-Manager-and-add-advanced-packet-sup.patch | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/patches/server/0985-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0985-Optimize-Network-Manager-and-add-advanced-packet-sup.patch index 6ab7cbf215..2e8076eb2e 100644 --- a/patches/server/0985-Optimize-Network-Manager-and-add-advanced-packet-sup.patch +++ b/patches/server/0985-Optimize-Network-Manager-and-add-advanced-packet-sup.patch @@ -28,7 +28,7 @@ and then catch exceptions and close if they fire. Part of this commit was authored by: Spottedleaf, sandtechnology diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca68b188eb9 100644 +index c399625a342ffd61102bb96a97ac24b0669e8e17..16eb94eb1f40485daef2713f740f6e0beeb1463f 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -84,7 +84,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -51,7 +51,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 // Paper start - add utility methods public final net.minecraft.server.level.ServerPlayer getPlayer() { -@@ -375,15 +379,39 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -376,15 +380,39 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { } public void send(Packet<?> packet, @Nullable PacketSendListener callbacks, boolean flush) { @@ -97,7 +97,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 } public void runOnceConnected(Consumer<Connection> task) { -@@ -391,7 +419,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -392,7 +420,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { this.flushQueue(); task.accept(this); } else { @@ -106,7 +106,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 } } -@@ -409,6 +437,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -410,6 +438,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { } private void doSendPacket(Packet<?> packet, @Nullable PacketSendListener callbacks, boolean flush) { @@ -121,7 +121,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 ChannelFuture channelfuture = flush ? this.channel.writeAndFlush(packet) : this.channel.write(packet); if (callbacks != null) { -@@ -428,14 +464,24 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -429,14 +465,24 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { }); } @@ -147,7 +147,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 } } -@@ -468,20 +514,57 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -469,20 +515,57 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { return attributekey; } @@ -212,7 +212,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world private static int joinAttemptsThisTick; // Paper - Buffer joins to world -@@ -544,6 +627,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -545,6 +628,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { public void disconnect(Component disconnectReason) { // Spigot Start this.preparing = false; @@ -220,7 +220,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 // Spigot End if (this.channel == null) { this.delayedDisconnect = disconnectReason; -@@ -715,7 +799,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -716,7 +800,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { public void handleDisconnection() { if (this.channel != null && !this.channel.isOpen()) { if (this.disconnectionHandled) { @@ -229,7 +229,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 } else { this.disconnectionHandled = true; PacketListener packetlistener = this.getPacketListener(); -@@ -728,7 +812,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -729,7 +813,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { packetlistener1.onDisconnect(ichatbasecomponent); } @@ -238,7 +238,7 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..7f2aa5e17fe675f3404d67b1794d2ca6 // Paper start - Add PlayerConnectionCloseEvent final PacketListener packetListener = this.getPacketListener(); if (packetListener instanceof net.minecraft.server.network.ServerCommonPacketListenerImpl commonPacketListener) { -@@ -765,4 +849,93 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -766,4 +850,93 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { public void setBandwidthLogger(SampleLogger log) { this.bandwidthDebugMonitor = new BandwidthDebugMonitor(log); } |