pdinklag / MinecraftStats

A Minecraft player statistics browser for the web - supports 1.13 and later!
https://discord.gg/brH5PGG8By
Other
227 stars 53 forks source link

Players' skins are not updating #3

Closed Slab30 closed 9 years ago

Slab30 commented 9 years ago

Players' skins are not updating unless $dataDir is removed and remade from scratch

JMDirksen commented 9 years ago

I've also seen this issue, it can also be fixed by running the update.php with the --update-playercache parameter to force looking up the skins from Mojang

Slab30 commented 9 years ago

Thank you, that's better than removing the folder, it's ok for me.

pdinklag commented 9 years ago

Good you found it. I should mention this in the guide, so I'm re-opening this. Note that the same issue occurs with player names (since you can change them now, I think).

In general, I'd like to have a better way to translate player UUIDs to their skins and names. RIght now I'm asking Mojang's web interface, but that's a very costy operation. That's why I introduced that cache instead of doing it every update. I'll try to find a better way.

Slab30 commented 9 years ago

That would be nice. Currently I'm updating the stats 4 times per hour and one of those updates is done with --update-playercache

pdinklag commented 9 years ago

It should be enough to do it weekly or something. If players change their skins every few minutes, it's their problem I'd say...

pdinklag commented 9 years ago

Solved. Mojang offers a more direct service to query a player's skin by his name, that's being used now. They no longer need to be queried on an update now.

In order to keep player names up to date, one little change in setup is required: copy usercache.json from the Minecraft server directory into raw as well. Minecraft servers keep UUID / name pairs in there (for a good while, at least). I updated the readme with this info.

If you do that, the --update-playercache flag should never really be needed, only if you need to update after a very long time.