From a65a5f302023ddf93fabf051adf1f7136d417855 Mon Sep 17 00:00:00 2001 From: games647 Date: Tue, 13 Feb 2024 16:54:11 +0100 Subject: [PATCH] Make ignore states more verbose in Velocity --- .../fastlogin/core/shared/ForceLoginManagement.java | 2 +- .../fastlogin/velocity/listener/ConnectListener.java | 2 ++ .../fastlogin/velocity/task/ForceLoginTask.java | 10 +++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java index 20f35e06e..0f5bd2187 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java @@ -62,7 +62,7 @@ public void run() { //premium player AuthPlugin

authPlugin = core.getAuthPluginHook(); if (authPlugin == null) { - //maybe only bungeecord plugin + // maybe only bungeecord plugin onForceActionSuccess(session); } else { boolean success = true; diff --git a/velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java b/velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java index 5fd6b764a..9eef1c265 100644 --- a/velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java +++ b/velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java @@ -150,6 +150,7 @@ public void onServerConnected(ServerConnectedEvent serverConnectedEvent) { if (floodgateService != null) { FloodgatePlayer floodgatePlayer = floodgateService.getBedrockPlayer(player.getUniqueId()); if (floodgatePlayer != null) { + plugin.getLog().info("Running floodgate handling for {}", player); Runnable floodgateAuthTask = new FloodgateAuthTask(plugin.getCore(), player, floodgatePlayer, server); plugin.getScheduler().runAsync(floodgateAuthTask); return; @@ -158,6 +159,7 @@ public void onServerConnected(ServerConnectedEvent serverConnectedEvent) { VelocityLoginSession session = plugin.getSession().get(player.getRemoteAddress()); if (session == null) { + plugin.getLog().info("No active login session found on server connect for {}", player); return; } diff --git a/velocity/src/main/java/com/github/games647/fastlogin/velocity/task/ForceLoginTask.java b/velocity/src/main/java/com/github/games647/fastlogin/velocity/task/ForceLoginTask.java index b548b2895..99402a75d 100644 --- a/velocity/src/main/java/com/github/games647/fastlogin/velocity/task/ForceLoginTask.java +++ b/velocity/src/main/java/com/github/games647/fastlogin/velocity/task/ForceLoginTask.java @@ -68,6 +68,7 @@ public ForceLoginTask(FastLoginCore co @Override public void run() { if (session == null) { + core.getPlugin().getLog().info("No active login session on force handling for {}", player); return; } @@ -80,6 +81,7 @@ public void run() { @Override public boolean forceLogin(Player player) { if (session.isAlreadyLogged()) { + core.getPlugin().getLog().info("Ignoring second force login attempt for {}", player); return true; } @@ -92,11 +94,11 @@ public FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, VelocityFastLoginAutoLoginEvent event = new VelocityFastLoginAutoLoginEvent(session, profile); try { return core.getPlugin().getProxy().getEventManager().fire(event).get(); - } catch (InterruptedException e) { + } catch (InterruptedException interruptedEx) { Thread.currentThread().interrupt(); // Set the interrupt flag again return event; - } catch (ExecutionException e) { - core.getPlugin().getLog().error("Error firing event", e); + } catch (ExecutionException executionEx) { + core.getPlugin().getLog().error("Error firing event", executionEx); return event; } } @@ -114,6 +116,8 @@ public void onForceActionSuccess(LoginSession session) { type = Type.REGISTER; } + core.getPlugin().getLog().info("Sending force {} for {} towards server {}", type, player.getUsername(), server); + UUID proxyId = core.getPlugin().getProxyId(); ChannelMessage loginMessage = new LoginActionMessage(type, player.getUsername(), proxyId); core.getPlugin().sendPluginMessage(server, loginMessage);