GameProfile Fetcher

Discussion in 'Spigot Plugin Development' started by sinnlosername, May 22, 2016.

  1. Hey,

    I search some single class / copy&paste GameProfile Fetcher for fetching name and skin+cape of a uuid without getting blocked by the mojang api, like the default skin fetcher of a spigot server ^^
    pls no api's / needed librarys like gson, etc. ^^
    I don't want to add so much into my jar because of one feature ^^

    Thanks in advance!
  2. You'll be blocked, always. The only way I could possibly think to avoid it is by using another server to request the data, and submit it back to the server you need it on.
  3. But how does the server normally grep skins? Mojang can't block servers if they try to get a normal skin o_O
  4. According to this wiki there's a rate-limit that only limits you when you ask the same gameprofile more than once a minute, but no further restrictions when you ask different ones, so for efficiency I'd just cache the GameProfiles for at least a few minutes. You could also use some reflection to get a hook into the built-in GameProfile fetcher that's in spigot/minecraft-server.

    The only downside of this is that your own rate-limit checker would not verify if spigot hasn't requested the GameProfile within that same minute, so to be 100% safe it may an even better idea to look at how Spigot/Minecraft itself requests GameProfiles, and hook into that. That way you get to use Spigot's already existing caching methods.
  5. Exact path to the class? So I can search for usages in original spigot/bukkit code. :)
  6. I went through some of the server code and the existing caches I could find were username to gameprofile caches, or uuid -> gameprofile, but then only for players that have joined the server. I think the best thing to do is indeed make your own cache class using either mojang's own API or a wrapper such as mc-api.
  7. Where? I'll search for a way lel :D
  8. What are you referring to