Player name -> UUID "Fetcher"

Discussion in 'Resources' started by evilmidget38, Mar 30, 2014.

Thread Status:
Not open for further replies.
  1. Yeah, I was testing with a fake player (YoloSwag69) and "".
  2. Offline


    The result gives me a different UUID then when I do p.getUniqueId()... Any ideas?
  3. Offline


    The only time it will do that is if you changed your Bukkit properties to allow offline mode clients.
    evilmidget38 likes this.
  4. Offline


    Thanks for the quick respond <3
  5. Offline



    Hey, Evil, it might be good to change the link on the original post and put a little note so that everybody knows it was updated. I'm sure not a lot of people like to search through the comments to find the updated version ;)
  6. Offline


    Staartvin Yeah, that's probably a good idea. I updated the link on the main post, but updating it is a good idea. I'll do that now.
    lukegb likes this.
  7. Offline


    Any chance you could make this not case sensitive?
  8. Offline


    Dang mojang makes your code erro' when it's down.

    [21:02:50] [pool-3-thread-3/WARN]: Server returned HTTP response code: 400 for URL:
    [21:02:50] [pool-3-thread-3/WARN]:at Source)
    [21:02:50] [pool-3-thread-3/WARN]:at Source)
    [21:02:50] [pool-3-thread-3/WARN]:at
    [21:02:50] [pool-3-thread-3/WARN]:at com.worldcretornica.plotme.SqlManager$
    [21:02:50] [pool-3-thread-3/WARN]:at
    [21:02:50] [pool-3-thread-3/WARN]:at
    [21:02:50] [pool-3-thread-3/WARN]:at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    [21:02:50] [pool-3-thread-3/WARN]:at java.util.concurrent.ThreadPoolExecutor$ Source)
    [21:02:50] [pool-3-thread-3/WARN]:at Source)
    I just tested and it's case insensitive. I can send names with wrong capitals and it works.

    Edit: ohhh... I see what you mean. I checked and what it saved doesn't work. But I don't think he can fix that.

    Edit2: I just tested and yes its case insensitive. Mojang will return the correct spelling too.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
  9. Getting:
    Using NameFetcher from like 1 week ago - code for using it:
    NameFetcher nameFetcher = new NameFetcher(uuidList);[/S]
    Map<UUID, String> nameFetcherResults =;[/S]
    for (Entry<UUID, String> uuidEntry : nameFetcherResults.entrySet())[/S]
        this.playerUUIDs.put(uuidEntry.getValue(), uuidEntry.getKey());[/S]
    Edit: Nvm - Fixed it by re-downloading the code from NameFetcher.
  10. Offline


  11. Offline


    I'm adding in support for UUIDs containing - in them.

    I am currently working on a branch of my UUID/Name conversion pages so that they can send more than 1 name per request. Currently I just need to figure out how I could do such a thing in PHP.
  12. Offline


    I would assume it not to be hard. You just need to create a request that contains a json array. I don't know how that is done though.

    A POST request with the content-type "application/json" and it would contain for example :

    You'll get back this :
  13. Offline


    Got it working with some help from turt2live.

    This was a 100 person test which had no delay at all.

    Not 100% sure if that format is easy for devs though since I can't test in Java since I don't understand that language.
  14. Offline


    Yive There's a library for json org.json.simple

    Edit: I'm wondering what the use of a list of uuids was though?
  15. Offline


    Apparently people need to send more than one username for converting their database or something. Not 100% sure.
    KingFaris11 is making something which needs to send more than 1 player name in a request, most likely to convert names to uuids or something.
  16. Offline


    Yive what i meant is that if you send multiple uuid, you need to also include the username ;)
  17. Offline


    Ah, my misunderstanding. I just added that in, I also plan on allowing the API to accept POST requests.
  18. Offline


    Is the Gson version of the code still available? evilmidget38
  19. Offline


    StaticJava likes this.
  20. Offline


  21. Offline


    evilmidget38 Great Code!

    I have one question though: the MAX_SEARCH value in your UUID-Fetcher is set to 100. Is this a mojang restriction, or could I change it to be around 5000?

    Edit: never mind, I was using an old version
  22. I made a small program that will rename playerfiles. This might come in handy for renaming all those playerfiles :p. You can choose the filter (first argument) and if you want the filter to be replaced by just .yml. I thought this would be better than renaming 20k userfiles myself.
    KingFaris11 likes this.
  23. Offline


    I noticed the same problem, specifically for looking up a single UUID on a name where the case returned isn't the same as what was sent, resulting in a null value being returned by the getUUIDOf() method. For my own purposes to work around it, since I only need to look up a single name at a time, I standardized it to lowercase. I modified this:
    1. uuidMap.put(name, uuid);
    1. uuidMap.put(name.toLowerCase(), uuid);
    And this:
    1. return new UUIDFetcher(Arrays.asList(name)).call().get(name);
    1. return new UUIDFetcher(Arrays.asList(name)).call().get(name.toLowerCase());

    That might pose a minor problem when reading out a list rather than just using getUUIDOf(). You'd need to make sure to use lowercase for the key name when using get(name) on the array, like so (based on example code in the first post):
    1. UUID uuid = response.get(playerName.toLowerCase());

    If just using UUIDFetcher.getUUIDOf(String name), you don't need to worry about case after the above changes.
  24. Offline


  25. Offline


    evilmidget38 how would you get the Name of a player using Namefetcher?
    MBon29 likes this.
  26. Offline


    I need help with this too. Does anyone have an example? Something like getting one name would help me understand.
  27. Offline


    Hrm, doesn't seem to be working. :\
    I am getting a String from user input (command), and doing:
    1. UUID u = null;
    2. try {
    3. u = UUIDFetcher.getUUIDOf(args[1]);
    4. } catch (Exception e) {
    5. // TODO Auto-generated catch block
    6. e.printStackTrace();
    7. }

    And When I check to see if it's null
    if(u == null){
    It triggers, so it doesn't seem to be getting it.
    Am I using it wrong?

    The NameFetcher seems to be working fine for me.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
  28. Offline


Thread Status:
Not open for further replies.

Share This Page