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

Offline users are not included in stats #79

Closed woduda closed 4 years ago

woduda commented 4 years ago

Offline users are ignored in stats processing. It's caused by getting player name only from Mojang service (online/premium player). But if the player is offline then the continue statement is reached: https://github.com/pdinklag/MinecraftStats/blob/7476f8e7007329d8b3776fcaf186e0fec9838edc/update.py#L210

pdinklag commented 4 years ago

What do you mean by "offline"?

That continue line is reached only if Mojang returns an empty profile for a UUID. If that's the case, the player is invalid. I don't know when it happens, but then it's a bug on Mojang's side or the account is deleted or doesn't exist for other reasons. It has nothing to do with "offline".

Or do you have an example UUID where it should work but doesn't?

woduda commented 4 years ago

Offline = cracked/non-premium player. That kind of player doesn't have Mojang account but can play on servers with online-mode set to false.

pdinklag commented 4 years ago

I see, never thought of that to be honest.

OK, well, their profile is retrieved from the Mojang servers because that's how I find out their player name and skin. The player name could be retrieved from the server's user cache, so that could be solved. I suppose "non-premium" players are unable to use skins? So that wouldn't matter.

pdinklag commented 4 years ago

Can you give the offline_players branch a try? It should use the usercache.json file of your server to lookup offline players.

woduda commented 4 years ago

Change from offine_players has reverted my stats to previous state where offline users are also included. Thanks for fix

pdinklag commented 4 years ago

Good to know, I'll merge it into the master then. Thanks! :+1: