Solved Mojang UUID & Bukkit UUID

Discussion in 'Plugin Development' started by Puharesource, Jan 2, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Puharesource

    So I've been trying to rebuild my server's database using UUID's. First, I tried to use the inbuilt UUID api, in Bukkit, but when I checked for it, I realised that it was not the same, as all of the other UUID checkers out there (e.g. fishbans and other tools).

    So I moved over to http://dev.bukkit.org/bukkit-plugins/identifierapi/ but whenever a player logs onto the server (This is where the server gets all of the data of the player), the server then lags for about 1-2 seconds, while it's getting the UUID which is a quite a big problem.

    So I'd just like to ask if there's a lot more simple way of doing this, which wont make the server lag, whenever it checks for the UUID. Thanks.
     
  2. Offline

    Nateb1121

  3. Offline

    Puharesource


    I always test my plugins in offline mode, so that I can join with multiple players at once. Let me just try to use .getUniqueId() again. If it still wont work, I'll give you my code :)
     
  4. Offline

    Nateb1121


    Ahh, ya, if you run in Offline it just returns an MD5 hash of the username, I believe. If your production server is in Offline Mode you're going to have to find another way besides UUID's :(
     
  5. Offline

    Puharesource

    Thanks for your help, it works now :) Now I've got to think of a different way of testing the plugins before they go live though >.<
     
  6. Offline

    Garris0n

    Hm this will lead to problems for Bungee servers...
     
  7. Offline

    Puharesource

    As far as I know, Bungeecord forwards the UUID's to Spigot, this was added about a week ago.
     
  8. Offline

    Aqgorn

    You're going to get this closed by speaking of unofficial builds however, UUID would come in a lot more handy if it set one for a computer with minecraft on it so all accounts owned by someone had the same and their alt accounts wouldn't bypass their ban or suspension on a different account.
     
  9. Offline

    Puharesource

    The problem really is that Mojang, has said that they will soon allow for people to change their ingame names. This will have a big conflict with permissions, people's custom coded databases etc.. Since if someone, like a mod changes their username without notifying an administrator, who can quickly change that players rank over, another player who might of realised this, will be able to change their name to the modetator's old name and cause grief on the server.

    But I do like the PC UUID part, the only problem here, is that that has been done before, not with Minecraft, but with a few other things, and there are spoofers out there than can bypass that.
     
    Aqgorn and Garris0n like this.
  10. Offline

    Garris0n

    Hm, I guess we'll either be switching to Spigot or making a custom patch in the near future...it's a shame Bukkit can't be nicer to BungeeCord.
     
    joshwenke likes this.
  11. Offline

    joshwenke

    Good idea. It is a shame.
     
  12. Offline

    Aqgorn

    Puharesource The PC UUID would work if Minecraft implemented their own hack prevention system checking for modified jars etc. However Mojang won't do this anytime soon, so if PC UUID's come we'd be better off sticking with IP's.
     
  13. Offline

    CubieX

    Is this really true?
    I'm using the official "Mojang Accounts Client Library" for retrieving the UUID.
    I tried to get the UUID in offline- and online-mode. And both times the same value was delivered. And it was not the MD5 hash.
    What should the UUID have to do with the online-setting of the server anyway? One could retrieve the UUID by not using a Bukkit plugin at all, but a stand-alone Java program.
     
  14. Offline

    Garris0n

    The server only gets the UUID if the server is in online mode. You could use that, but personally I'd rather have the method built into player and the server take care of it as it was designed to.
     
    CubieX likes this.
  15. Offline

    Nateb1121


    If your server is in offline mode it it doesn't authenticate with Mojang servers, so the UUID might not match the Mojang UUID. I think the issue come when you use a random user name on an offline server that isn't a valid Mojang account. If what you say is true, it returns the same for both on/offline, then what would nonvalid accounts return? That's what leads me to believe that it could be an MD5, or some other way, but it surely wouldn't be a valid MojangUUID for a non valid Mojang account.
     
  16. Offline

    RawCode

    mojang UUID for online mode only, planned to provide ability to change names at profile and still able to track players.
     
  17. Offline

    CubieX

    When testing I figured this out:
    The Mojang Accounts Client can get the UUID even if a player is offline.
    If the player is not valid, it returns an empty Profile[]. Otherwise it has one (or possibly more entries if two players with the same name exist. I guess this is allowed then...)
    The "more entries" thing would be a problem. Because how are we supposed to know which "physical" player stands behind which UUID then if they both have the same name?
    Ideas? :confused:

    And Bukkit can only get the UUID for online players and also the other way round to get a player by it's UUID is only possible for online players, because you need the player list to match the UUID with.

    And what do you do if two players have the same name on a server?
    Then practically every plugin today is screwed.
    We need to completely shift over player handling to UUIDs. The name may only be handled as an attribute like every other one. This will also demand Bukkit to provide methods that rely on UUIDs rather than player names like today.
    And the above mentioned case "two players with same name" is still problematic then.
    With this, Mojang basicly broke the whole player handling for each and every plugin out there.
    Old, not updated plugins will be useless in the future, once this goes live.
    Btw. I'm not moaning. :p I just say there's a looooot of work coming up for us. ;)
     
    MarioG1 and regaw_leinad like this.
  18. Offline

    Janmm14

    Mojang doesn't allow doubled names.
     
  19. Offline

    CubieX

    Yeah. I also red the PSA with those infos.
    This prevents a complete desaster. But it will still cause many plugins to fail and to be exchanged with alternatives.
    Because I doubt that all developers will switch over to UUIDs in time.
    It's nothing which can be done by "plug and play". It means a complete overhaul of each plugin.
    Especially for the "get UUID for offline player" part, which will lag the server if done synchronously.
    It makes stuff complicated if a player is offline and for example has to be mailed or something.

    I for myself have about 15 private plugins running on my public server which I wrote myself
    and I simply do not have the time to work them over immediately.
    So there will be cutbacks during the transition period.
     
Thread Status:
Not open for further replies.

Share This Page