Magic

Magic

190k Downloads

Camera doesn't seem to be working

SullyTheUnusual opened this issue ยท 12 comments

commented

Trying to take pictures of other players/mobs, and the map is blank. This is shown in the log:

[15:25:46 INFO]: [Magic] Loading http://skins.minecraft.net/MinecraftSkins/MHF_Creeper.png
[15:25:46 WARN]: [Magic] Failed to load map http://skins.minecraft.net/MinecraftSkins/MHF_Creeper.png: http://skins.minecraft.net/MinecraftSkins/MHF_Creeper.png

commented

Looks like skins.minecraft.net is down

http://skins.minecraft.net/MinecraftSkins/MHF_Creeper.png

Returns 404

Nothing I can do about that. If Mojang shuts that down I will probably just have to remove the camera item.

commented

Still getting a 404 there... I was hoping it was temporary but I guess not. I did some Googling but couldn't find any mention of Mojang closing down skins.minecraft.net or removing the MHF skins.

I'll maybe try asking in minecraft IRC....

commented

So Mojang has officially killed skins.minecraft.net

The alternative they want you to use is the user profile API. But this is problematic for two reasons:

  1. You have to first look up the user profile to get the texture URL, then fetch the texture. The map code is not really set up for this double-hop so it would take a good bit of rework to make that happen.

  2. The API is rate-limited, so now the map system would need to throttle itself and have a retry queue and generally this all sounds like a pain.

I'm feeling lazy about it, so I found a 3rd party API that seems to work well. I think this is low volume enough that they won't mind me using it. Thanks, https://mcskinsearch.com/

commented

Thanks for looking into this! My players were very excited at the prospect of taking "selfies" and having a wall of pictures of their friends. They'll be excited to see it work again!

commented

Ha! Yes I love walls of pictures... there's an ancient one hidden on my dev server somewhere of all the first players who helped me test out Magic :)

I just fixed some behavior with selfies in the camera, too, it should work a little better.

commented

Looks like Mojang has a new skin server...

webbukkit/dynmap#2199

commented

Ah - yeah seems like he's pulling the URL from the GameProfile:

webbukkit/dynmap@48fbeca

I considered doing that too- I probably should've, but that only works for players that are online ... which is fine for the camera item but not so much for command-line casting and the /mmap command, both of which can make a map from any arbitrary player, even if they're not online or have never been on the server.

I should probably switch to a system eventually where I use the GameProfile and then fall back to the official API, though.

commented

I suppose you could always pull the URL from the profile once in awhile when a player is connected, and just strip the player name off the end. That would give you the current skin server URL in case it ever changes, right? Right now it seems like it was changed to http://s3.amazonaws.com/MinecraftSkins/.png.

Anyway, thought this might apply to this issue. I've only made a couple basic plugins though, you're the expert. :)

commented

Well you may have misread that a bit- the aws store was actually what they used before skins.minecraft.net. It hasn't been updated in a long while though I don't think they ever emptied it out, either.

So I am still there http://s3.amazonaws.com/MinecraftSkins/NathanWolf.png

But if you try to query a newer player you'll find their skin is missing: http://s3.amazonaws.com/MinecraftSkins/AJWolf.png

Mojang doesn't add to it anymore.

To make matters more complicated, what you get in the profile isn't so simple. What you get will look like this:

http://textures.minecraft.net/texture/744e11fddeff88dd749ae5ff8fe80f46b9f659817d43d673e4af3759d59ae0

The domain part never changes, skins are now all hosted on textures.minecraft.net - but not by username or UUID.

Every unique skin is given a unique id. If you upload the same skin as I do, both of our game profiles will have that same texture URL.

So the trick is getting from a player IGN or even UUID to the texture URL, the only way to do that is to get their GameProfile. The server gets it for you automatically when you log into a server- so that's where dynmap is getting their textures.

But if a player hasn't logged in, you've got to query Mojang's API directly for an arbitrary game profile.

I wouldn't mind this so much, but they put rate limits on that API that make querying it automatically much more difficult- going back to the throttling and queueing stuff that I earlier said I am too lazy to do right now ๐Ÿ˜Ž

commented

Well, shoot- I just realized mcskinsearch's API will not look up a new user. It only works for someone who's been searched in there.

So that's not going to work out...

I guess I need to do the hard thing.

commented

Thanks for explaining that, I wasn't aware of the history of their skin server storage. It looks to me like they're just trying to optimize their skins database by eliminating duplicates. Sorry for the bad news with mcskinsearch, and that it's making fixing this harder.

commented

I did the hard thing!

Cameras should work now, they will pull from players' game profiles if online, and fetch from Mojang's API if not.