From a9bfef6c01b987b6e3639b1988f3a0bbd3b98b48 Mon Sep 17 00:00:00 2001 From: Petr Ilin Date: Wed, 30 Mar 2022 21:39:34 +0300 Subject: PreAuthorizationEvent fix --- src/main/java/net/elytrium/limboauth/LimboAuth.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main/java/net') diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java index 530076a..4ea4659 100644 --- a/src/main/java/net/elytrium/limboauth/LimboAuth.java +++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java @@ -386,6 +386,8 @@ public class LimboAuth { RegisteredPlayer registeredPlayer = AuthSessionHandler.fetchInfo(this.playerDao, nickname); boolean onlineMode = player.isOnlineMode(); + boolean onlineModePassed = false; + if (onlineMode || isFloodgate) { if (registeredPlayer == null || registeredPlayer.getHash().isEmpty()) { registeredPlayer = AuthSessionHandler.fetchInfo(this.playerDao, player.getUniqueId()); @@ -422,8 +424,7 @@ public class LimboAuth { } }); - this.factory.passLoginLimbo(player); - return; + onlineModePassed = true; } } } @@ -433,7 +434,13 @@ public class LimboAuth { this.server.getEventManager().fire(new PreRegisterEvent(player, eventConsumer)).thenAcceptAsync(eventConsumer); } else { Consumer eventConsumer = (event) -> this.sendPlayer(event, ((PreAuthorizationEvent) event).getPlayerInfo()); - this.server.getEventManager().fire(new PreAuthorizationEvent(player, registeredPlayer, eventConsumer)).thenAcceptAsync(eventConsumer); + TaskEvent event = new PreAuthorizationEvent(player, registeredPlayer, eventConsumer); + + if (onlineModePassed) { + event.setResult(TaskEvent.Result.BYPASS); + } + + this.server.getEventManager().fire(event).thenAcceptAsync(eventConsumer); } } -- cgit