Permanent Skins Not Loading Updated Skin #1033

Open
Arctomium opened this Issue Jan 1, 2017 · 29 comments

Projects

None yet

5 participants

@Arctomium

So after following the tutorial on the Wiki to set skins on my NPCs by setting it on my skin and than using the /npc skin -p command to set the skin, on the Wiki it says to change your skin and repeat the process but when I change my skin to change the skin of another NPC it loads the skin from the one before and not the new one.

For example:
I have NPC A & NPC B and Skin A and Skin B, I load Skin A onto NPC A and make it permanent but when I try to set my skin as Skin B to update NPC B it loads Skin A even though I've already changed my skin to Skin B.

@mcmonkey4eva
Member

What version of Minecraft and Citizens?

@Arctomium

I'm using Citizens 2.0.21 and Spigot 1.10.2

@Arctomium

Even now after a certain amount of time the Skins completely disappear and reset to the default ones or if I use the /citizens reload command it resets them to default. Can you make the plugin save the skin images server side or something and load them on startup or reload?

@Arctomium

Think I found the problem, Citizens doesn't grab the most recent Skin unless the plugin is reloaded but then it updates to the newest skin so in order to set multiple skins on one account I would need to keep reloading the plugin but when I do it resets the skin to default and then would download the newest skin instead. Essentially your only way to solve all the skin problems is to save them server-side and load them from say in the Citizens folder.

@Ditronian
Ditronian commented Jan 4, 2017 edited

Can confirm this exists w/ Citizens 2.0.21 and spigot 1.11 as well. To actually get it to register that you changed your skin you must either restart the server or save and reload the citizens plugin (which for me often duplicates all my recent npcs with ghost npcs).

@Arctomium

This has been an issue for so long with settings skins but since mcmonkey4eva isn't going to be allowing the saving and loading of server-side skins I've hired a developer to make me a modified version of Citizens so I can save and load the skins from the server.

@mcmonkey4eva
Member

@Arctomium It's not that I "won't be allowing" it... it's that it's impossible under Mojang's system. There's not a way to do that. I hope you haven't paid whatever developer claimed they could do that.

@Arctomium

@mcmonkey4eva well then find a way so we can actually set custom skins and make them permanent, because currently you can't change your skin and set it to permanent on another NPC unless you reload the server or the plugin but that just makes the skin on the first NPC disappear.

@mcmonkey4eva
Member

There are bugs, yes, but they're being worked on... IE that's what these issues are for.

But it should be as easy as /npc skin <name> -p

@Arctomium

Also I don't see how it's impossible if you're loading skins even the permanent ones from Mojang as they just send the data of the skin images so why can't they be loaded from file instead since that's essentially what you're doing with Mojang except you'll be changing what server it's receiving the skin from.

@Arctomium

@mcmonkey4eva JESUS CHRIST CAN YOU NOT READ??? I've already said that the command like you just said does not work! It sets the same skin on every NPC...

@Ditronian

But it should be as easy as /npc skin -p

The -p attribute works fine for us, and permanently sets multiple skins, albeit after restarting the server/reloading citizens after each skin.

@mcmonkey4eva
Member

Mojang encrypts skin data.
We can't load from regular image files without matching the encryption somehow.

All we store in "permanent" mode is a reference to Mojang's skin server, which stores old-versions of skins.

@Arctomium

Read my example of what is happening again:
For example:
I have NPC A & NPC B and Skin A and Skin B, I load Skin A onto NPC A and make it permanent but when I try to set my skin as Skin B to update NPC B it loads Skin A even though I've already changed my skin to Skin B.

@mcmonkey4eva
Member

@Arctomium As I said: there are bugs, which are being worked on. Also, please maintain some professionalism in public issue postings.

@mcmonkey4eva
Member

Also, albeit after restarting the server/reloading citizens after each skin seems to be the working solution at the moment until we've gotten the caching issues cleaned up in Citizens.

@Arctomium

Yes but I've seen people having this problem and bug for most of the time Citizens has been around, so does Mojang only store 1 previous skin?

@mcmonkey4eva
Member

Citizens has been around for many many years, the skin server update happened in minecraft version 1.7.6.
Prior to that it was impossible to set a skin to anything other than the latest skin file (The skin was read from the player's username clientside, followed by a call to the Mojang servers).
Mojang stores all previous skins I do believe - the issue you're experiencing is a caching flaw somewhere in the server data, thus why restarting the server causes the skin changes to start working.

@Arctomium

Okay then so what is your solution to fix this problem?

@mcmonkey4eva
Member

A: Restart your server when you need to apply a new skin.
B: Await a code-side resolution to the caching flaw.

@Namnodorel
Namnodorel commented Jan 7, 2017 edited

The command does work for me on basically the same version. I have dozens of NPCs on my server which all wear a skin set through my MC-Account. And they keep their skin no matter how often I restart, or change my skin.

Also, please always keep a polite tone. The developers are doing lots of work to create awesome plugins like Citizens in their free time and for free, but many people can't even properly respect that. We "owe" nobody anything, being at least respectful and maybe even thankful for the work is more than appropiate.

Sorry for being a bit harsh, but people with a lack of understandinf of how much work especially plugins like Citizens are just... Get me angry.

On the technical side: Is it really just the link to the server Citizens can store? I thought it might be possible to save the actual signed skin as soon as we got it. I think CustomSkins by inventivetalent does something like that, at least on their servers

@Arctomium

I already said earlier that restarting it just wipes the skins, also they do not encrypt the skins...I just used the MojangAPI to get the URL for my skin and it leads straight to a standard image file: http://textures.minecraft.net/texture/7ae15cde98ffa34c27b674e2bb38afd80f16f626d55ffbe2e5875a03c958946

So server-side skins is completely possible.

@Arctomium

@Namnodorel what server version are you using and which version of Citizens?

@Namnodorel

I can tell you, it is.not.possible. We can store the skin on a server of course, but for a client to accept it, it needs to be signed by Mojang. And only the skins applied to a player are signed by Mojang. If it were that easy to change Skins to something serverside, everyone would do it. But it just doesn't work that easy.

Latest 1.10.2... For the exact Citizens version number I gotta look it up, but haven't the time for it now. I can tell you tomorrow if you want.

@mcmonkey4eva
Member

This is the an example of the data we receive from Mojang to pass on to clients:
eyJ0aW1lc3RhbXAiOjE0ODM3NDMwMzM0OTksInByb2ZpbGVJZCI6ImY1ODY0ZmMxMWRkZDQwM2ViODc1ZWVhZWJhMmNhNTdkIiwicHJvZmlsZU5hbWUiOiJYYW5kZXJwaXR6Ii widGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzQxZDA5NWJjYmQ0ODNhMTNiN2MyZTM4OTg1ODRlZmQ5ZTI4NzJmYzYyZj U2YzRhODdmMjY4NDM1YWFmYiJ9fX0=
That translates to this after a manual decoding (The server doesn't generally decode it)
{"timestamp":1483743033499,"profileId":"f5864fc11ddd403eb875eeaeba2ca57d","profileName":"Xanderpitz","textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/41d095bcbd483a13b7c2e3898584efd9e2872fc62f56c4a87f268435aafb"}}}
How exactly are we supposed to use this system to send a custom skin on a player?

Unfortunately, last we tested changing the skin URL from minecraft.net to a different website doesn't work, though some people have reported that it works to do that for skull head items (or did work in the past)

@Namnodorel
Namnodorel commented Jan 7, 2017 edited

If I'm right we'd have to change that URL and encrypt it again with their private key in order for it to be accepted by a client. Which we obviously don't have

@mcmonkey4eva
Member

Oh woops I neglected some information in the previous post:
There's also an encryption signature transmitted alongside it... which that copypasta should contain, but doesn't seem to 0.o
(As an aside, that data being not present means they moved it at some point, which explains an unrelated bug in our of our side plugins lol)

@mcmonkey4eva
Member

Ah, here it is. Here's a sample skin signature:
vZn+AcIKMMlD2P2e7G3rbLUqz0gn5S2a2nRO9EOBR12RUtWr3JsxfHnJ/LrD7XziLW3I40HYFLgsbq+O5P7ZLrLsbV+AT2eaLa8I+f2WolbKGTKL58rcP sDQr8CJwOJ1jmEjmMfLx6WvIS9EkuLEPOtY28i8QkKSEGjIMDI6SeWPvBMizBqtUulv9SBM+x5wlt0fvfX/Vie2tLDmkHFNZuIxXZAdH4aaHVqUqetIYHjpF53h7Eb8S4E0QWe1Z6DT0xJD6+XE1iUx/7d1QxlHE sYAyPdhOVqwxcv6cYoLK4oZULFXGqfk0isr9A4llCwl2N6UuzQ5knjyKP2nRilO+k4O97ADK51SYT5haQfwU6MplpmzbEaVdWxw2eDnMt7yJ02Aq1D49Shp1Ci+4RHF0C5No2jyS6KZrWq8QnU8Rrz1yMdX6gR8s oWoMgDf2OJ/J2nl5bh5qJ+IU9jvmPTKBdqyBIdZFC6mp1d1OKw0PDOWbnwZ/dAncOPv4ELql+6wo4JXWhx7qyU9twwFwawnITEn7sIOU8izGvS0srF4IMOe/63QYsieGeSqoZZgTqtJPfu1GRIvHI5GGaHZVf+rc UdWWh73sJKOKM6aLEROzd6XTFEA8GFVROa1dRQ2y5NRc7LKtJxoRXjWzDRdXGfIVcVNVPmMaqUNghpDUcCIIZk=

That is binary encrypted data that can be used to verify that a skin is the correct one.
It is encrypted using Mojang's private key as @Namnodorel said, and as such cannot be replicated.

@fullwall
Member
fullwall commented Jan 7, 2017

Latest build should remove the skin caching for /npc skin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment