Skip to content

Conversation

@Hi-ImKyle
Copy link

  • Added a check to see if WHITELIST contains a "-", if it does then parse it as a list of UUIDs rather than normal Usernames

NOTE: It's a crude fix and I am by no means good at bash. I just wanted to give it a shot.

Added a check to see if WHITELIST contains a "-", if it does then parse it as a list of UUIDs rather than normal Usernames
@Hi-ImKyle
Copy link
Author

Hi-ImKyle commented Nov 29, 2021

To make it use Mojang's API instead
Change https://playerdb.co/api/player/minecraft/{} to https://api.mojang.com/user/profile/{}
Change '.["data"]["player"] | {"uuid": .id, "name": .username}' to '. | {"uuid": .id, "name": .name}'

@Hi-ImKyle Hi-ImKyle changed the title Update start-finalExec Whitelist UUID Support Nov 29, 2021
@Hi-ImKyle
Copy link
Author

Hi-ImKyle commented Nov 29, 2021

The endpoint for Mojang to get Username from UUID is not reversible unlike PlayerDB's, so if you choose Mojang's instead you will need to add a warning to the whitelisting players section explicitly stating that it's either they use Usernames OR UUID's, not both and it NEEDS to be the dashed UUID format in order for it to pass the UUID check(idk any other way).

Wrong:
-e WHITELIST=Notch,ba2828f4f94646599543c41438e6a0e0

Wrong:
-e WHITELIST=Notch,ba2828f4-f946-4659-9543-c41438e6a0e0

Correct:
-e WHITELIST=Notch,Kyleee

Correct
-e WHITELIST=069a79f4-44e9-4726-a5be-fca90e38aaf5,ba2828f4-f946-4659-9543-c41438e6a0e0

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Yeah, let's go with the third party API since it had the flexibility of either username or UUID. If they shut down at some point it can be switched over.

Can you make a small change to the whitelist section in the docs to mention that either identifier can be used? With that I'm good to merge this.

- Includes warning to use dashed uuid variant and command example
@Hi-ImKyle
Copy link
Author

Should be enough of a note to warn users to use the dashed variant if they wish to use uuids.

@itzg itzg merged commit 75dcc74 into itzg:master Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants