mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Replace ; with : in motd/submotd (#3389)
This commit is contained in:
parent
592b48dbf5
commit
b1d832dded
1 changed files with 11 additions and 7 deletions
|
@ -125,13 +125,9 @@ public class ConnectorServerEventHandler implements BedrockServerEventHandler {
|
||||||
pong.setSubMotd(config.getBedrock().secondaryMotd());
|
pong.setSubMotd(config.getBedrock().secondaryMotd());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.isPassthroughPlayerCounts() && pingInfo != null) {
|
// https://github.com/GeyserMC/Geyser/issues/3388
|
||||||
pong.setPlayerCount(pingInfo.getPlayers().getOnline());
|
pong.setMotd(pong.getMotd().replace(';', ':'));
|
||||||
pong.setMaximumPlayerCount(pingInfo.getPlayers().getMax());
|
pong.setSubMotd(pong.getSubMotd().replace(';', ':'));
|
||||||
} else {
|
|
||||||
pong.setPlayerCount(geyser.getSessionManager().getSessions().size());
|
|
||||||
pong.setMaximumPlayerCount(config.getMaxPlayers());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallbacks to prevent errors and allow Bedrock to see the server
|
// Fallbacks to prevent errors and allow Bedrock to see the server
|
||||||
if (pong.getMotd() == null || pong.getMotd().isBlank()) {
|
if (pong.getMotd() == null || pong.getMotd().isBlank()) {
|
||||||
|
@ -160,6 +156,14 @@ public class ConnectorServerEventHandler implements BedrockServerEventHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.isPassthroughPlayerCounts() && pingInfo != null) {
|
||||||
|
pong.setPlayerCount(pingInfo.getPlayers().getOnline());
|
||||||
|
pong.setMaximumPlayerCount(pingInfo.getPlayers().getMax());
|
||||||
|
} else {
|
||||||
|
pong.setPlayerCount(geyser.getSessionManager().getSessions().size());
|
||||||
|
pong.setMaximumPlayerCount(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.getPlayerCount() >= pong.getMaximumPlayerCount()) {
|
if (pong.getPlayerCount() >= pong.getMaximumPlayerCount()) {
|
||||||
|
|
Loading…
Reference in a new issue