[1.7.10] Corrupted usercache.json file causes server crash
buttilda opened this issue · 2 comments
If Minecraft finds a corrupted usercache.json file (which seems from happen every now and again), the server crashes on startup.
Since it's a cache, if it was deleted, all that would happen is the server would have to re-download the player's GameProfiles and etc, which sounds better than crashing repeatedly.
This could be easily fixed with a small patch on net.minecraft.server.management.PlayerProfileCache that would catch the exception, and delete the file, instead of throwing it and blowing everything up (patch would be on methods func_152657_b and func_152658_c to be more exact).
Does this sound like something that would be accepted? I'll be more than willing to make the patch myself.
Edit: Checked if the bug was also present in 1.8 and it is.
Taking a look, 152657_b looks to be a bit of a decompilation error - the code flow looks broken in the failure case. I'm gonna see what it's supposed to look like and try and fix it..
I think that even if there's a decompile error there, a JsonParseException would still leak through and crash the game.