-
-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace spaces in username with _ #264
Conversation
This should probably be in Floodgate because that handles the usernames |
Not everyone is using Floodgate and offline servers without Floodgate should still be able to use Geyser |
This must be in the standalone, as it's important, not only floodgate. |
It has to be in both |
Floodgate will still have the correct name even if this is merged. |
Couldn't that break things relying on the Bedrock username and confuse contributors by splitting the username logic across 2 different codebases? |
Oh, never mind, I think I misunderstood you |
Yes, it'll be in Floodgate too after account linking is merged |
|
Juse make an option if to be enabled or not in config and everyone can enable or not lol |
It's still a question of where is best to apply it since I'm not 100% sure my position is best. I'll take a look at where @RednedEpic mentioned to apply the change and am dropping this to WIP status for the moment. EDIT: After looking at that location I'm not sure it's ever called if you are not running flood gate. Ideally what you want is to log into the Java server with the translated name but then send the original name to any authentication system. So maybe changing the username here: Geyser/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java Lines 188 to 190 in 9b487d7
This way floodgate gets the original and only the java protocol has the change. |
I think this causes the chunks to not load |
And I agree with @NycuRO |
This has been merged into Floodgate, so this PR can be closed. |
What if one doesn't run floodgate? |
Like I said earlier, this shouldn't be only in Floodgate. |
Bring this to master and inventory too >:( |
What's the update on this PR? |
I've been using it fine since the beginning as I have players with spaces in the their names. I don't know how it plays with floodgate that's the only thing. |
Floodgate has this, this was talked about a while back on where its best implemented and we just left it as part of floodgate for now. |
Are people able to join Geyser if they have a space in their name? |
It feels like it should not require floodgate. |
Yes, but it causes issues with some plugins |
AuthMe for one will reject connections but tonnes of plugins can't handle it. |
Can there be a config option for this? |
I think a config option would be a requirement. Or this can be moved to a plugin, though it feels like a core feature. |
This will be closed, as it's a better fit for an extension in the future. |
After some discussion, we decided this would be better in Geyser itself. |
In my experience - on my offline Paper server with LoginSecurity (not sure which of these 2 force this behavior), when a user tries to log in with a space in username, they are not allowed to do so and are disconnected with message that their username contain an invalid character. Wouldn't it be better to follow this princinple instead of trying to convert usernames from bad characters to good ones, which indeed opens a whole new world of possible consequences? |
The issue is that if you have a space in your bedrock username you can't ever log into the paper server then through geyser unless you remap it. |
This PR does need a rebase. |
As a reminder, underscore is a valid user name character this means people can have the same name i.e. "Vala phee" (which would be "Vala_phee") and "Vala_phee", should be replaced with an invalid character like +, Vala+phee |
This is currently handled by floodgate. As for @Camotoy's comment, I'm happy to see that because the space issue is a big deal for the Public GeyserConnect's users. |
Coming back to this after some time - this is something that exists within Floodgate & we don't really have much interest bringing this across to mainline Geyser, since the only setups it would primarily benefit is offline mode which we do not support. Thanks for the PR though! |
Bedrock allows spaces but Java Edition does not (or should not). Bad things happen when a user logs in with a space.
This PR simply replaces spaces with _'s. This has the following consequences:
Potentially opens a vulnerability for a user with an _ that another user with a space (or vice versa) could log in and be treated as the same user. I'm not sure if Microsoft already disallow registering a name with an space replaced by an underscore.
It may cause other unintended effects so will need testing. One way to test if you don't have a space in your name (because why would you) is to just replace another letter.
It may also be better to move the replacement logic to where MinecraftProtocol is instantiated inside GeyserSession::authenticate so that the replaced username doesn't reach floodgate.
Closes #263
ToDo