mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Avoid adding NetworkManager twice
The removal of `ServerConnection.this.h.add(networkmanager);` got lost in the 1.13 update, causing network managers to be registered twice. Fixes "handleDisconnection() called twice" warning spam in console.
This commit is contained in:
parent
9a1643dab4
commit
391324437a
1 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,7 @@ Subject: [PATCH] Avoid blocking on Network Manager creation
|
|||
Per Paper issue 294
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java
|
||||
index be8d07f41..ad49673c1 100644
|
||||
index be8d07f41..9808561eb 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class ServerConnection {
|
||||
|
@ -26,9 +26,10 @@ index be8d07f41..ad49673c1 100644
|
|||
public ServerConnection(MinecraftServer minecraftserver) {
|
||||
this.e = minecraftserver;
|
||||
@@ -0,0 +0,0 @@ public class ServerConnection {
|
||||
channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(ServerConnection.this)).addLast("splitter", new PacketSplitter()).addLast("decoder", new PacketDecoder(EnumProtocolDirection.SERVERBOUND)).addLast("prepender", new PacketPrepender()).addLast("encoder", new PacketEncoder(EnumProtocolDirection.CLIENTBOUND));
|
||||
NetworkManager networkmanager = new NetworkManager(EnumProtocolDirection.SERVERBOUND);
|
||||
|
||||
ServerConnection.this.g.add(networkmanager);
|
||||
- ServerConnection.this.g.add(networkmanager);
|
||||
+ pending.add(networkmanager); // Paper
|
||||
channel.pipeline().addLast("packet_handler", networkmanager);
|
||||
networkmanager.setPacketListener(new HandshakeListener(ServerConnection.this.e, networkmanager));
|
||||
|
|
Loading…
Reference in a new issue