Use legacy DefaultEventLoopGroup constructor; label Geyser <-> Spigot connection thread

This commit is contained in:
Camotoy 2021-08-16 22:33:14 -04:00
parent 61d95200e3
commit 76399881a3
No known key found for this signature in database
GPG Key ID: 7EEFB66FE798081F
2 changed files with 4 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import com.viaversion.viaversion.bukkit.handlers.BukkitChannelInitializer;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.*;
import io.netty.channel.local.LocalAddress;
import io.netty.util.concurrent.DefaultThreadFactory;
import org.bukkit.Bukkit;
import org.geysermc.connector.bootstrap.GeyserBootstrap;
import org.geysermc.connector.common.GeyserInjector;
@ -117,7 +118,7 @@ public class GeyserSpigotInjector extends GeyserInjector {
initChannel.invoke(childHandler, ch);
}
})
.group(new DefaultEventLoopGroup())
.group(new DefaultEventLoopGroup(0, new DefaultThreadFactory("Geyser Spigot connection thread")))
.localAddress(LocalAddress.ANY))
.bind()
.syncUninterruptibly();

View File

@ -58,7 +58,8 @@ public class ConnectorServerEventHandler implements BedrockServerEventHandler {
private static final int MAGIC_RAKNET_LENGTH = 338;
private final GeyserConnector connector;
private final DefaultEventLoopGroup eventLoopGroup = new DefaultEventLoopGroup(new DefaultThreadFactory("Geyser player thread"));
// There is a constructor that doesn't require inputting threads, but older Netty versions don't have it
private final DefaultEventLoopGroup eventLoopGroup = new DefaultEventLoopGroup(0, new DefaultThreadFactory("Geyser player thread"));
public ConnectorServerEventHandler(GeyserConnector connector) {
this.connector = connector;