Skip to content

Commit e6e656a

Browse files
committed
Check secondary motd in extension to prevent errors
1 parent 0645544 commit e6e656a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

bootstrap/geyser/src/main/java/com/rtm516/mcxboxbroadcast/bootstrap/geyser/MCXboxBroadcastExtension.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,14 @@ public void onBedrockPing(GeyserBedrockPingEvent event) {
217217
return;
218218
}
219219

220+
// Fallback to the gamertag if the host name is empty
221+
String hostName = event.secondaryMotd();
222+
if (hostName == null || hostName.isEmpty()) {
223+
hostName = sessionManager.getGamertag();
224+
}
225+
220226
// Allows support for motd and player count passthrough
221-
sessionInfo.setHostName(event.secondaryMotd());
227+
sessionInfo.setHostName(hostName);
222228
sessionInfo.setWorldName(event.primaryMotd());
223229

224230
sessionInfo.setPlayers(event.playerCount());

0 commit comments

Comments
 (0)