Add system property Geyser.RakSendCookie to allow disabling cookie send (#4598)

This commit is contained in:
Kas-tle 2024-04-24 06:56:15 -07:00 committed by GitHub
parent c19b4ad306
commit 2471de100b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -228,6 +228,9 @@ public final class GeyserServer {
int rakGlobalPacketLimit = positivePropOrDefault("Geyser.RakGlobalPacketLimit", DEFAULT_GLOBAL_PACKET_LIMIT); int rakGlobalPacketLimit = positivePropOrDefault("Geyser.RakGlobalPacketLimit", DEFAULT_GLOBAL_PACKET_LIMIT);
this.geyser.getLogger().debug("Setting RakNet global packet limit to " + rakGlobalPacketLimit); this.geyser.getLogger().debug("Setting RakNet global packet limit to " + rakGlobalPacketLimit);
boolean rakSendCookie = Boolean.parseBoolean(System.getProperty("Geyser.RakSendCookie", "true"));
this.geyser.getLogger().debug("Setting RakNet send cookie to " + rakSendCookie);
return new ServerBootstrap() return new ServerBootstrap()
.channelFactory(RakChannelFactory.server(TRANSPORT.datagramChannel())) .channelFactory(RakChannelFactory.server(TRANSPORT.datagramChannel()))
.group(group, childGroup) .group(group, childGroup)
@ -235,7 +238,7 @@ public final class GeyserServer {
.option(RakChannelOption.RAK_MAX_MTU, this.geyser.getConfig().getMtu()) .option(RakChannelOption.RAK_MAX_MTU, this.geyser.getConfig().getMtu())
.option(RakChannelOption.RAK_PACKET_LIMIT, rakPacketLimit) .option(RakChannelOption.RAK_PACKET_LIMIT, rakPacketLimit)
.option(RakChannelOption.RAK_GLOBAL_PACKET_LIMIT, rakGlobalPacketLimit) .option(RakChannelOption.RAK_GLOBAL_PACKET_LIMIT, rakGlobalPacketLimit)
.option(RakChannelOption.RAK_SEND_COOKIE, true) .option(RakChannelOption.RAK_SEND_COOKIE, rakSendCookie)
.childHandler(serverInitializer); .childHandler(serverInitializer);
} }