AuroraLS3 / Genie

Genie Bukkit Plugin: https://www.spigotmc.org/resources/genie.43260/
GNU General Public License v3.0
0 stars 1 forks source link

"/genie give <playername>" returns player not found (in offline mode) #11

Closed s1h4d0w closed 6 years ago

s1h4d0w commented 6 years ago

I installed this plugin yesterday as it seemed like a fun little reward for people fighting mobs. However I can't seem to give lamps to players. I type "/genie give" and then use tab to autocomplete the playername, making sure it matches case etc. However the plugin returns that the player isn't found.

I'm running Genie 1.2.1 on Spigot 1.12.2 with a load of other plugins, see below. No other plugins have trouble finding players by their name. Could it be an issue with me running an offline mode server seeing as players get an UUID based on their playername and not the official one from the minecraft auth server?

List of plugins:

image

image

AuroraLS3 commented 6 years ago

Bug is caused by player not having an offical UUID (offline mode) I'll still fix it since it's an easy fix.

AuroraLS3 commented 6 years ago

Fixed in 1.2.2

s1h4d0w commented 6 years ago

I've removed the old jar and placed the new jar in the plugin folder, then restarted the server. It still gives the "Player not found" error sadly. There's no way of checking the running version of the game is there?

AuroraLS3 commented 6 years ago

That is odd, I changed it so that if UUID doesn't exist for a player it gets the player with the same name from the players that are connected - it should work

s1h4d0w commented 6 years ago

I restarted the server to see what version the console was reporting, but I seem to be running 1.2.2 of Genie so the plugin updated correctly.

I think the problem lies in the "if UUID doesn't exist" because the players do get an UUID when using a server in offline mode. Their UUID will get set to the md5 hash of their name, even if they have a premium account.

AuroraLS3 commented 6 years ago

The code uses UUIDFetcher which uses mojang's uuid service to check the UUID. If it is not found "UUID doesn't exist"

This code gets all currently online players and compares the given argument to the name of the player

getOnlinePlayers().stream().filter(player -> name.equals(player.getName())).findFirst();

The snippet is the 2nd fallback if the UUIDFetcher doesn't find an UUID.

So I'm guessing the UUID is found, but is different UUID than the md5 hash, and such the fallback doesn't run and bukkit doesn't find the player with the UUID when getPlayer(uuid) is used.

s1h4d0w commented 6 years ago

Exactly my thought. I ran into some problems with plugins but managed to get everything working with the "local" UUID.

Is this something you would be willing to implement? I could understand not wanting to do the work for such a small number of servers that would have this problem.

AuroraLS3 commented 6 years ago

Yeah, it'll probably work if I remove all other than the online player part - it's odd to check for Uuids anyway when it needs a player

AuroraLS3 commented 6 years ago

Fixed in 1.2.3