Skip to content

Commit

Permalink
Make ignore states more verbose in Velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
games647 committed Feb 13, 2024
1 parent 8a729e0 commit a65a5f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void run() {
//premium player
AuthPlugin<P> authPlugin = core.getAuthPluginHook();
if (authPlugin == null) {
//maybe only bungeecord plugin
// maybe only bungeecord plugin
onForceActionSuccess(session);
} else {
boolean success = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public ForceLoginTask(FastLoginCore<Player, CommandSource, FastLoginVelocity> co
@Override
public void run() {
if (session == null) {
core.getPlugin().getLog().info("No active login session on force handling for {}", player);
return;
}

Expand All @@ -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;
}

Expand All @@ -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;
}
}
Expand All @@ -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);
Expand Down

0 comments on commit a65a5f3

Please sign in to comment.