1. Marvelord

    Marvelord New Member

    Marvelord
    MVP+
    Messages:
    10
    I tried to make a friend list function that gets a username and returns/prints the friend list.
    I managed to do it but it takes ages to get it.
    The main problem is how to get a username to UUID and back fast.
    I used "https://api.mojang.com/users/profiles/minecraft/" to get the UUID from username..
    then it takes about 1 second to get the friend list from Hypixel, but then it takes another 2 hours to transform the UUID to usernames back. (again with "https://api.mojang.com/user/profiles/")
    the functions I use are very very slow and I hope someone here has a solution
     
    #1
  2. Waitron

    Waitron Well-Known Member

    Waitron
    MVP+
    LIGHT L
    Guild Master
    Messages:
    4,042
    cool name
     
    #2
  3. Why are you transforming username to UUID and then UUID to username? Unless I'm misunderstanding, you should only need to do one and then save it for later. That way you don't need to make 2 requests to the API. I think I understand now.

    If you can provide more information then I might be able to help more, however caching is your #1 friend. Save results from the API in a variable or a file and then use them in the future when you go to make the same requests again. Making a bunch of requests for all of a users friends list can only be sped up so much, however. The bigger the friends list, the longer it will take.
     
    #3
    Last edited: Feb 11, 2019

Share This Page