Add Channel initialization listeners

This commit is contained in:
Nassim Jahnke
2021-04-29 21:19:33 +02:00
parent 639cb2d6aa
commit 3ab2001afb
5 changed files with 123 additions and 8 deletions

View File

@@ -27,7 +27,7 @@
public ServerConnectionListener(MinecraftServer server) {
this.server = server;
@@ -100,16 +109,27 @@
@@ -100,16 +109,28 @@
Connection.configureSerialization(channelpipeline, PacketFlow.SERVERBOUND, false, (BandwidthDebugMonitor) null);
int j = ServerConnectionListener.this.server.getRateLimitPacketsPerSecond();
@@ -39,6 +39,7 @@
+ pending.add(object); // Paper - prevent blocking on adding a new connection while the server is ticking
((Connection) object).configurePacketHandler(channelpipeline);
((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object));
+ io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper - Add Channel initialization listeners
}
- }).group(eventloopgroup).localAddress(address, port)).bind().syncUninterruptibly());
+ }).group(eventloopgroup).localAddress(address, port)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit
@@ -58,7 +59,7 @@
public SocketAddress startMemoryChannel() {
List list = this.channels;
ChannelFuture channelfuture;
@@ -153,6 +173,14 @@
@@ -153,6 +174,14 @@
List list = this.connections;
synchronized (this.connections) {
@@ -73,7 +74,7 @@
Iterator<Connection> iterator = this.connections.iterator();
while (iterator.hasNext()) {
@@ -176,6 +204,10 @@
@@ -176,6 +205,10 @@
networkmanager.setReadOnly();
}
} else {