diff options
author | Petr Ilin <hevav@hevav.dev> | 2022-03-30 21:39:34 +0300 |
---|---|---|
committer | Petr Ilin <hevav@hevav.dev> | 2022-03-30 21:39:34 +0300 |
commit | a9bfef6c01b987b6e3639b1988f3a0bbd3b98b48 (patch) | |
tree | 5851d7f0a97be6edfb1cf1cd3032b1eb1499a6ef /src/main/java/net | |
parent | 72ed13caabe733cb9ce7a97acc1255e13b5a6d3c (diff) | |
download | LimboAuth-a9bfef6c01b987b6e3639b1988f3a0bbd3b98b48.tar.gz LimboAuth-a9bfef6c01b987b6e3639b1988f3a0bbd3b98b48.tar.bz2 LimboAuth-a9bfef6c01b987b6e3639b1988f3a0bbd3b98b48.zip |
PreAuthorizationEvent fix
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/elytrium/limboauth/LimboAuth.java | 13 |
1 files changed, 10 insertions, 3 deletions
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<TaskEvent> 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); } } |