itzg / mc-image-helper

This tool does the complicated bits for the itzg/minecraft-server image
MIT License
59 stars 26 forks source link

[Request] Support non-Java users for whitelist #448

Open kaysond opened 4 months ago

kaysond commented 4 months ago

I want to use env vars in docker-minecraft-server to manage my whitelist, but it makes the container fail to start up because mc-image-helper chokes on the usernames and UUIDs provided by floodgate. It looks like the API endpoint is hardcoded to minecraft here:

https://github.com/itzg/mc-image-helper/blob/a0b85215944f72cae65ab8d94dea2e01dfe781a1/src/main/java/me/itzg/helpers/users/PlayerdbUserApi.java#L26

playerdb does support xbox and steam accounts via dedicated endpoints, though there seems to be some conversion needed for the floodgate uuid (see https://wiki.geysermc.org/floodgate/faq/#obtaining-uuids-for-floodgate-players)

It would probably need some kind of marker in the env var to indicate a different account type, and maybe there's a reason this can't be supported, but it would be nice to have!

itzg commented 4 months ago

Thanks, I had only used/tested with Java usernames of players connected to Xbox user.

The feature gap wasn't intended. Yes, perhaps a prefix like "xbox:" or "floodgate:" on the username could trigger the new lookup?

kaysond commented 4 months ago

Thanks, I had only used/tested with Java usernames of players connected to Xbox user.

The feature gap wasn't intended. Yes, perhaps a prefix like "xbox:" or "floodgate:" on the username could trigger the new lookup?

Yeah I was thinking something like that. The env var makes things way easier than having to manually lookup/convert the floodgate names to UUIDs!

FYI - one complication is that it seems you have to specify the user's name with the floodgate prefix. It defaults to . but can be changed in the config:

image Source: https://wiki.geysermc.org/geyser/faq/

kaysond commented 4 months ago

There also seems to be some conversion of spaces in a gamertag, for example, to underscores. But in playerdb, it returns the name without spaces (even if you send the request with a space)