From b7ac05a0a5de7e9fb2d157c19e59d961ca524f12 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 4 Feb 2021 13:29:33 +0000 Subject: [PATCH] Improve Fabric initial connection debug --- .../fabric/listeners/FabricConnectionListener.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fabric/src/main/java/me/lucko/luckperms/fabric/listeners/FabricConnectionListener.java b/fabric/src/main/java/me/lucko/luckperms/fabric/listeners/FabricConnectionListener.java index 0a509008c..c93ece113 100644 --- a/fabric/src/main/java/me/lucko/luckperms/fabric/listeners/FabricConnectionListener.java +++ b/fabric/src/main/java/me/lucko/luckperms/fabric/listeners/FabricConnectionListener.java @@ -73,13 +73,17 @@ public class FabricConnectionListener extends AbstractConnectionListener { UUID uniqueId = PlayerEntity.getUuidFromProfile(profile); String username = profile.getName(); + if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) { + this.plugin.getLogger().info("Processing pre-login (sync phase) for " + uniqueId + " - " + username); + } + // Register with the LoginSynchronizer that we want to perform a task before the login proceeds. sync.waitFor(CompletableFuture.runAsync(() -> onPreLoginAsync(netHandler, uniqueId, username), this.plugin.getBootstrap().getScheduler().async())); } private void onPreLoginAsync(ServerLoginNetworkHandler netHandler, UUID uniqueId, String username) { if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) { - this.plugin.getLogger().info("Processing pre-login for " + uniqueId + " - " + username); + this.plugin.getLogger().info("Processing pre-login (async phase) for " + uniqueId + " - " + username); } /* Actually process the login for the connection. @@ -109,14 +113,14 @@ public class FabricConnectionListener extends AbstractConnectionListener { final ServerPlayerEntity player = netHandler.player; if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) { - this.plugin.getLogger().info("Processing login for " + player.getUuid() + " - " + player.getName()); + this.plugin.getLogger().info("Processing login for " + player.getUuid() + " - " + player.getGameProfile().getName()); } final User user = this.plugin.getUserManager().getIfLoaded(player.getUuid()); /* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */ if (user == null) { - this.plugin.getLogger().warn("User " + player.getUuid() + " - " + player.getName() + + this.plugin.getLogger().warn("User " + player.getUuid() + " - " + player.getGameProfile().getName() + " doesn't currently have data pre-loaded - denying login."); Component reason = TranslationManager.render(Message.LOADING_STATE_ERROR.build()); netHandler.disconnect(FabricSenderFactory.toNativeText(reason));