Paper/nms-patches/ServerConnection.patch

30 lines
1.4 KiB
Diff
Raw Normal View History

--- a/net/minecraft/server/ServerConnection.java
+++ b/net/minecraft/server/ServerConnection.java
2020-08-11 23:00:00 +02:00
@@ -74,14 +74,24 @@
int j = ServerConnection.this.e.k();
Object object = j > 0 ? new NetworkManagerServer(j) : new NetworkManager(EnumProtocolDirection.SERVERBOUND);
- ServerConnection.this.connectedChannels.add(object);
+ ServerConnection.this.connectedChannels.add((NetworkManager) object); // CraftBukkit - decompile error
channel.pipeline().addLast("packet_handler", (ChannelHandler) object);
((NetworkManager) object).setPacketListener(new HandshakeListener(ServerConnection.this.e, (NetworkManager) object));
}
- }).group((EventLoopGroup) lazyinitvar.a()).localAddress(inetaddress, i)).bind().syncUninterruptibly());
+ }).group((EventLoopGroup) lazyinitvar.a()).localAddress(inetaddress, i)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit
}
}
+ // CraftBukkit start
+ public void acceptConnections() {
2020-01-21 22:00:00 +01:00
+ synchronized (this.listeningChannels) {
+ for (ChannelFuture future : this.listeningChannels) {
+ future.channel().config().setAutoRead(true);
+ }
+ }
+ }
+ // CraftBukkit end
+
public void b() {
this.c = false;
2020-01-21 22:00:00 +01:00
Iterator iterator = this.listeningChannels.iterator();