Commit
6fcbefe87d7d7cd52c1b8c8d7cd0b72371148828
by nossr50Keep FlatFile players unloaded when their data cannot be read at login
When a player's profile did not load at login, the loading task asked the
database for a new user. On FlatFile, newUser(Player) always returned a loaded
profile at starting levels, and saveUser writes over any row with that
player's UUID. A users file that could not be read at that moment, or a row
whose cooldowns could not be parsed, therefore wiped the player's stored
progress on the first save.
newUser(Player) now reads mcmmo.users and only returns a loaded profile when
the file was read and has no row with the player's UUID. Otherwise the profile
stays unloaded and the login keeps retrying the load, the same way the SQL
database behaves when its insert fails.
newUser(String, UUID) no longer appends a second row for a UUID that is
already stored. The load queries skip a row that fails to parse and use the
next row with the same UUID, so a fresh duplicate would be loaded in place of
a damaged original and then saved over both.
A row that fails to parse is now logged once per player, naming them, instead
of the exception being swallowed. Rows that end before the newer XP columns
load with those columns at zero, as the startup health check pads them,
instead of failing to load.
(commit: 6fcbefe)