Skip to content
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

Add support for Floodgate UUIDs #113

Open
Novampr opened this issue Mar 6, 2024 · 7 comments
Open

Add support for Floodgate UUIDs #113

Novampr opened this issue Mar 6, 2024 · 7 comments
Labels

Comments

@Novampr
Copy link

Novampr commented Mar 6, 2024

Supporting Floodgate UUIDs would allow for java server using Floodgate/GeyserMC to have bedrock players have pronouns in the game using certain plugins/mods depending on the server, could be a nice little detail for bedrock players.

@cyyynthia
Copy link
Owner

From what I've gathered, the UUIDs are emulated by appending a bunch of zeroes in front of the xbox ID. I'm not sure how to implement it, considering this would be the first time the platform would attempt to do ID translation (to convert from the fake Minecraft UUID to an Xbox ID)

@Novampr
Copy link
Author

Novampr commented Mar 7, 2024

I'd be more than happy to help with the fake ID creation part, I just can't test as I don't have an Azure account and can't get a functional one Read this a little wrong, I actually know how in depth this goes and getting an Xbox ID is simple, the end of the UUID is a hex version of the Xbox ID, slice off the front and the Xbox ID is right there (in hex format)

For example my FUUID is 00000000-0000-0000-0009-01FA6F661C64

Remove all the 0s and -s to get 901FA6F661C64 which is 2535449912810596 in decimal :)

@Novampr
Copy link
Author

Novampr commented Mar 7, 2024

If it helps I have a bit of TypeScript code to do this conversion in a relatively quick manner

function convertFUUID(fuuid: string): string {
    return parseInt(fuuid.substring(22).replace("-", ""), 16).toString();
}

@cyyynthia
Copy link
Owner

Well the concern is not necessarily from creating the ID; the thing is that it'd be kind of a pain to store it as a real minecraft account internally as it'd show up under people's linked account (despite being a "ghost" account).

In the database the platform will most likely only have the Xbox ID stored as the user's xbox account. Performing ID translations means a platform is no longer "just" a simple lookup in the database, it may be a different set of paths to take that may eventually perform a preprocessing step.

Theoretically I could just achieve this via a simple HTTP redirect, but this is not entirely transparent to API clients so I pretty much have to do the translation/re-route internally which isn't something the current code is (easily and properly) capable of doing

@Novampr
Copy link
Author

Novampr commented Mar 8, 2024

Couldn't this be the in the same platform as Minecraft? That way you technically store the XUID for the Minecraft platform and can do a simple check after either it's a FUUID or a regular UUID, then you could do the needed database look ups then. I could be wrong, correct me if I am but this seems doable with the current system

@cyyynthia
Copy link
Owner

Yes but the thing is: the platform doesn't have any "special handling" of any kind with platform and IDs. It just takes whatever input it gets, feeds it to the database, and gets results.

I'd preferably try to avoid having to do nasty platform-specific if/else branches in the middle of the platform-generic code and have a more generic way of specifying this type of things.

Put in other words; what the endpoint currently does is simply:

  • get ids & platform from params
  • query database
  • give results

And it does so while treating all the parameters as opaque. What I'm saying is that I don't have a clean way at this time to add between reading parameters and querying the database a transform step that'd apply the transformation required here. And I really don't want to slap an if/else branch in there since that'd quickly become a nightmare if more transformations like this are needed.

Ideally I'd have a transform function that's part of the minecraft.ts specification part and that'd transform that on-the-fly, with the function routing being dynamically handled.

Even this transform step aside, this brings a new issue since database queries may no longer be guaranteed to hit a single platform; it may need to fetch some minecraft accounts and some xbox accounts which isn't something the database abstraction is accepting at the moment...

And after that I'd still need to keep the original mapping to transform back the xbox IDs to the UUIDs used in the request (or dynamically rebuild them, alternatively...) which is a 3rd thing that needs to be taken care of 🤔

It's not very difficult, it's just a bunch of changes to the code structure that are needed 😅

@Novampr
Copy link
Author

Novampr commented Mar 9, 2024

Ah ok I think I understand now, no problems if you can't implement, thanks for being a cool developer tho 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants