PaperMC/paper-server/nms-patches/net/minecraft/server/network/ServerConnection.patch
CraftBukkit/Spigot f8db65033c Update to Minecraft 1.19.1
By: md_5 <git@md-5.net>
2022-07-28 04:00:00 +10:00

29 lines
1.5 KiB
Diff

--- a/net/minecraft/server/network/ServerConnection.java
+++ b/net/minecraft/server/network/ServerConnection.java
@@ -98,14 +98,24 @@
int j = ServerConnection.this.server.getRateLimitPacketsPerSecond();
Object object = j > 0 ? new NetworkManagerServer(j) : new NetworkManager(EnumProtocolDirection.SERVERBOUND);
- ServerConnection.this.connections.add(object);
+ ServerConnection.this.connections.add((NetworkManager) object); // CraftBukkit - decompile error
channel.pipeline().addLast("packet_handler", (ChannelHandler) object);
((NetworkManager) object).setListener(new HandshakeListener(ServerConnection.this.server, (NetworkManager) object));
}
- }).group((EventLoopGroup) lazyinitvar.get()).localAddress(inetaddress, i)).bind().syncUninterruptibly());
+ }).group((EventLoopGroup) lazyinitvar.get()).localAddress(inetaddress, i)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit
}
}
+ // CraftBukkit start
+ public void acceptConnections() {
+ synchronized (this.channels) {
+ for (ChannelFuture future : this.channels) {
+ future.channel().config().setAutoRead(true);
+ }
+ }
+ }
+ // CraftBukkit end
+
public SocketAddress startMemoryChannel() {
List list = this.channels;
ChannelFuture channelfuture;