Always replace spaces in usernames when using Floodgate

Bungeecord recently started checking usernames for spaces in the login start packet. To resolve this we just always send the username without spaces in the login start packet. Floodgate is still able to get the real username of the Bedrock player and Floodgate is also still in charge of the final username.
This commit is contained in:
Tim203 2021-05-30 00:22:11 +02:00
parent 934fc12b16
commit 360e2f4b9a
No known key found for this signature in database
GPG key ID: 064EE9F5BF7C3EE8

View file

@ -581,7 +581,14 @@ public class GeyserSession implements CommandSender {
protocol = new MinecraftProtocol(authenticationService.getSelectedProfile(), authenticationService.getAccessToken());
} else {
protocol = new MinecraftProtocol(username);
// always replace spaces when using Floodgate,
// as usernames with spaces cause issues with Bungeecord's login cycle
String validUsername = username;
if (remoteAuthType == AuthType.FLOODGATE) {
validUsername = username.replace(' ', '_');
}
protocol = new MinecraftProtocol(validUsername);
}
connectDownstream();