fix: resolve 11 P1 bugs from audit (leaderboard, SQL, coop, jump, lifecycle, schematics, config)

- leaderboard: parse M:SS.mmm/H:MM:SS(.mmm), switch TIME sort to long (п.25)
- sql: single Hikari pool, non-blocking connect, adaptive init order, settings JSON round-trip (п.27-30)
- coop: remove unregister recursion via session-only leave + reentrancy guard (п.24)
- jump: perpendicular jitter for diagonal heading, valid safety-fallback on retry exhaustion (п.32-33)
- lifecycle: fall threshold relative to course, lead via generated-blocks counter, one-time rewards once (п.35-37)
- schematics: catch RuntimeExceptions, validate size, 10MB file limit (п.31)
- config merge: preserve block-sequence lists and ignored sections, fix path reversal (п.26)
- tests: +31 (score, jump, schematics, config merge) = 72 total
This commit is contained in:
loki5512344 2026-08-06 10:49:05 +02:00
parent c0ca488b9d
commit fea15e61c8
Signed by: boba
GPG key ID: 253067914055423B
27 changed files with 1012 additions and 167 deletions

View file

@ -61,23 +61,32 @@ public final class UserRegistry {
}
public static void unregister(@NotNull ParkourUser user, boolean restorePreviousData, boolean kickIfBungee, boolean urgent) {
dev.loki.loparkour.adaptive.bootstrap.AdaptiveServices.unloadPlayer(user.getUUID());
new ParkourLeaveEvent(user).call();
try {
user.unregister();
resetScoreboard(user);
} catch (Exception ex) {
handleUnregisterError(user, ex);
}
if (restorePreviousData && shouldKickToBungee(kickIfBungee)) {
BungeeUtil.sendPlayerToServer(user.player, Config.CONFIG.getString("bungeecord.return_server"));
if (user.unregistering) {
return;
}
if (restorePreviousData) {
restorePreviousState(user, urgent);
user.unregistering = true;
try {
dev.loki.loparkour.adaptive.bootstrap.AdaptiveServices.unloadPlayer(user.getUUID());
new ParkourLeaveEvent(user).call();
try {
user.unregister();
resetScoreboard(user);
} catch (Exception ex) {
handleUnregisterError(user, ex);
}
if (restorePreviousData && shouldKickToBungee(kickIfBungee)) {
BungeeUtil.sendPlayerToServer(user.player, Config.CONFIG.getString("bungeecord.return_server"));
return;
}
if (restorePreviousData) {
restorePreviousState(user, urgent);
}
} finally {
user.unregistering = false;
}
}