diff --git a/src/main/java/org/geysermc/globallinkserver/bedrock/BedrockServer.java b/src/main/java/org/geysermc/globallinkserver/bedrock/BedrockServer.java index 3663590..6e1b5a9 100644 --- a/src/main/java/org/geysermc/globallinkserver/bedrock/BedrockServer.java +++ b/src/main/java/org/geysermc/globallinkserver/bedrock/BedrockServer.java @@ -25,6 +25,8 @@ package org.geysermc.globallinkserver.bedrock; import java.net.InetSocketAddress; +import java.util.concurrent.ThreadLocalRandom; + import org.cloudburstmc.protocol.bedrock.BedrockPong; import org.cloudburstmc.protocol.bedrock.BedrockServerSession; import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec; @@ -63,7 +65,8 @@ public boolean startServer(Config config) { .gameType("Survival") .ipv4Port(config.bedrockPort()) .protocolVersion(latestCodec.getProtocolVersion()) - .version(latestCodec.getMinecraftVersion()), + .version(latestCodec.getMinecraftVersion()) + .serverId(ThreadLocalRandom.current().nextLong()), new ServerInitializer()); server.bind(new InetSocketAddress(config.bindIp(), config.bedrockPort())) .awaitUninterruptibly(); diff --git a/src/main/java/org/geysermc/globallinkserver/bedrock/NettyServer.java b/src/main/java/org/geysermc/globallinkserver/bedrock/NettyServer.java index 94f7601..da3814b 100644 --- a/src/main/java/org/geysermc/globallinkserver/bedrock/NettyServer.java +++ b/src/main/java/org/geysermc/globallinkserver/bedrock/NettyServer.java @@ -47,6 +47,7 @@ public NettyServer(BedrockPong pong, BedrockServerInitializer serverInitializer) group = new NioEventLoopGroup(); bootstrap = new ServerBootstrap() .channelFactory(RakChannelFactory.server(NioDatagramChannel.class)) + .option(RakChannelOption.RAK_GUID, pong.serverId()) .option(RakChannelOption.RAK_ADVERTISEMENT, pong.toByteBuf()) .group(group) .childHandler(serverInitializer);