3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-27 08:30:12 +01:00

Apply motd change that wasn't possible during merge

Dieser Commit ist enthalten in:
Konicai 2022-12-14 18:30:57 -05:00
Ursprung 2d3dd89162
Commit 3fca39094f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 710D09287708C823

Datei anzeigen

@ -166,6 +166,10 @@ public final class GeyserServer {
pong.maximumPlayerCount(config.getMaxPlayers()); 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 // Fallbacks to prevent errors and allow Bedrock to see the server
if (pong.motd() == null || pong.motd().isBlank()) { if (pong.motd() == null || pong.motd().isBlank()) {
pong.motd(GeyserImpl.NAME); 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 //Bedrock will not even attempt a connection if the client thinks the server is full
//so we have to fake it not being full //so we have to fake it not being full
if (pong.playerCount() >= pong.maximumPlayerCount()) { if (pong.playerCount() >= pong.maximumPlayerCount()) {