Geyser icon indicating copy to clipboard operation
Geyser copied to clipboard

Can't get UUID from offline players that have Spaces/Underscores on their names.

Open yLordMagnus opened this issue 3 years ago • 9 comments

Describe the bug

I mean, it is possible to get it, but it is a gamble.

Suppose my GamerTag is yLorD Magnus, geyser/floodgate converts to -yLorD_Magnus

If I'm offline and try to use the FloodGateAPI (as dependency of my plugin)/GeyserAPI (https://api.geysermc.org/) at max I can filter out the prefix -, ending up with yLorD_Magnus but then, since the UUID retrieval for offline players is based on the original GamerTag I have no way of knowing if the original GamerTag was yLorD Magnus or yLorD_Magnus, one will work, the other will just spit out an error or I might get the wrong profile.

This problem can get bigger and bigger depending on the amount of underscores/spaces the original gamertag had.

To Reproduce

  1. Gamble?

Expected behaviour

  1. Getting the player UUID 100% and not gamble.

Screenshots / Videos

No response

Server Version and Plugins

No response

Geyser Dump

No response

Geyser Version

2.1.0-SNAPSHOT (git-master-f9705c1)

Minecraft: Bedrock Edition Device/Version

No response

Additional Context

No response

yLordMagnus avatar Feb 15 '23 02:02 yLordMagnus

well, what you're describing though is an inherent gamble How is the Geyser API supposed to know whether a player where the _ replacement, that coincides with another exact same java username, is or isn't a Bedrock player? Without the prefix, there is no way to tell that. heck, it's why it's even there, to avoid such username issues

I really don't see how we're supposed to "guess" without the prefix

onebeastchris avatar Feb 15 '23 02:02 onebeastchris

https://api.geysermc.org/docs#/utils/GlobalApiWeb.Api.UtilsController.get_bedrock_or_java_uuid However, if you use this endpoint with the prefix, you should probably get the correct UUID.

onebeastchris avatar Feb 15 '23 02:02 onebeastchris

https://api.geysermc.org/docs#/utils/GlobalApiWeb.Api.UtilsController.get_bedrock_or_java_uuid However, if you use this endpoint with the prefix, you should probably get the correct UUID.

it only filters out the prefix, it is unable to know if the underscores are indeed part of the gamertag or if they were introduced by Geyser

yLordMagnus avatar Feb 15 '23 02:02 yLordMagnus

I really don't see how we're supposed to "guess" without the prefix

Huh, I don't get what you are talking about here, that doesn't seem to be the same thing I mentioned on my post

yLordMagnus avatar Feb 15 '23 02:02 yLordMagnus

https://api.geysermc.org/docs#/utils/GlobalApiWeb.Api.UtilsController.get_bedrock_or_java_uuid However, if you use this endpoint with the prefix, you should probably get the correct UUID.

it only filters out the prefix, it is unable to know if the underscores are indeed part of the gamertag or if they were introduced by Geyser

From what I can tell it (that particular endpoint) uses the prefix to make a proper guess about if that's java or bedrock, and returns either a floodgate UUID for bedrock, and UUID for java players. Underscores shouldn't matter at all in that endpoint.

onebeastchris avatar Feb 15 '23 02:02 onebeastchris

I really don't see how we're supposed to "guess" without the prefix

Huh, I don't get what you are talking about here, that doesn't seem to be the same thing I mentioned on my post

Let's ask it differently then, why are you filtering out the prefix before calling the Geyser API endpoint?

onebeastchris avatar Feb 15 '23 02:02 onebeastchris

Let's ask it differently then, why are you filtering out the prefix before calling the Geyser API endpoint?

I'm not... 14_23-28-19_NUiwk

14_23-28-29_BVWi6

my gamertag is yLorD Magnus but since Geyser converts my name on the game to yLorD_Magnus it just errors out...

yLordMagnus avatar Feb 15 '23 02:02 yLordMagnus

Okay, now that is a likely a bug with that endpoint; it should probably replace all underscores back to spaces if there's a prefix present

Then again, you could probably get away with checking if there's a prefix, and if there is, replace the "_" in the name to a space; and then call that endpoint. That should work as I don't think Xbox live allows for "_" in their usernames

onebeastchris avatar Feb 15 '23 02:02 onebeastchris

Okay, now that is a likely a bug with that endpoint; it should probably replace all underscores back to spaces if there's a prefix present

Then again, you could probably get away with checking if there's a prefix, and if there is, replace the "" in the name to a space; and then call that endpoint. That should work as I don't think Xbox live allows for "" in their usernames

For some reason I was certain that I had already seen GamertTags with underscores, guess I was just wrong, after searching a bit about it, it doesn't seem to be possible to use underscores on gamertags, and I was just being stupid af, sorry bout that >.>

yLordMagnus avatar Feb 15 '23 02:02 yLordMagnus