From 3fca39094f6db357d603916ec3cfa860c24a37c2 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Wed, 14 Dec 2022 18:30:57 -0500 Subject: [PATCH] Apply motd change that wasn't possible during merge --- .../geysermc/geyser/network/netty/GeyserServer.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java b/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java index 4be10f896..afb3bff3a 100644 --- a/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java +++ b/core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java @@ -166,6 +166,10 @@ public final class GeyserServer { pong.maximumPlayerCount(config.getMaxPlayers()); } + // https://github.com/GeyserMC/Geyser/issues/3388 + pong.motd(pong.motd().replace(';', ':')); + pong.subMotd(pong.subMotd().replace(';', ':')); + // Fallbacks to prevent errors and allow Bedrock to see the server if (pong.motd() == null || pong.motd().isBlank()) { pong.motd(GeyserImpl.NAME); @@ -193,6 +197,14 @@ public final class GeyserServer { } } + if (config.isPassthroughPlayerCounts() && pingInfo != null) { + pong.playerCount(pingInfo.getPlayers().getOnline()); + pong.maximumPlayerCount(pingInfo.getPlayers().getMax()); + } else { + pong.playerCount(geyser.getSessionManager().getSessions().size()); + pong.maximumPlayerCount(config.getMaxPlayers()); + } + //Bedrock will not even attempt a connection if the client thinks the server is full //so we have to fake it not being full if (pong.playerCount() >= pong.maximumPlayerCount()) {