Skip to content

Commit

Permalink
Set the RAK_GUID properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Jul 16, 2024
1 parent 6172b13 commit 6b73e3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6b73e3f

Please sign in to comment.