mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-02-21 06:51:34 +01:00
Improve Fabric initial connection debug
This commit is contained in:
parent
b8e044c4e3
commit
b7ac05a0a5
@ -73,13 +73,17 @@ public class FabricConnectionListener extends AbstractConnectionListener {
|
|||||||
UUID uniqueId = PlayerEntity.getUuidFromProfile(profile);
|
UUID uniqueId = PlayerEntity.getUuidFromProfile(profile);
|
||||||
String username = profile.getName();
|
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.
|
// 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()));
|
sync.waitFor(CompletableFuture.runAsync(() -> onPreLoginAsync(netHandler, uniqueId, username), this.plugin.getBootstrap().getScheduler().async()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPreLoginAsync(ServerLoginNetworkHandler netHandler, UUID uniqueId, String username) {
|
private void onPreLoginAsync(ServerLoginNetworkHandler netHandler, UUID uniqueId, String username) {
|
||||||
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
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.
|
/* Actually process the login for the connection.
|
||||||
@ -109,14 +113,14 @@ public class FabricConnectionListener extends AbstractConnectionListener {
|
|||||||
final ServerPlayerEntity player = netHandler.player;
|
final ServerPlayerEntity player = netHandler.player;
|
||||||
|
|
||||||
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
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());
|
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. */
|
/* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */
|
||||||
if (user == null) {
|
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.");
|
" doesn't currently have data pre-loaded - denying login.");
|
||||||
Component reason = TranslationManager.render(Message.LOADING_STATE_ERROR.build());
|
Component reason = TranslationManager.render(Message.LOADING_STATE_ERROR.build());
|
||||||
netHandler.disconnect(FabricSenderFactory.toNativeText(reason));
|
netHandler.disconnect(FabricSenderFactory.toNativeText(reason));
|
||||||
|
Loading…
Reference in New Issue
Block a user