From 47db2c7858b38da67ae5c4d1d27c0b6a6cc3cf82 Mon Sep 17 00:00:00 2001 From: "Leo G. ~ Leoko" Date: Wed, 19 Apr 2017 14:39:27 +0200 Subject: [PATCH] Fixed AuthHook (#144) * Fixed AuthHook The setServerStarted()-Method is now also called if an extern AuthHook hooks into FastLogin via the API * Simplified if-Statement --- .../bukkit/tasks/DelayedAuthHook.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/DelayedAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/DelayedAuthHook.java index 1fa524d9..75e08c09 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/DelayedAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/DelayedAuthHook.java @@ -1,21 +1,15 @@ package com.github.games647.fastlogin.bukkit.tasks; import com.github.games647.fastlogin.bukkit.FastLoginBukkit; -import com.github.games647.fastlogin.bukkit.hooks.AuthMeHook; -import com.github.games647.fastlogin.bukkit.hooks.CrazyLoginHook; -import com.github.games647.fastlogin.bukkit.hooks.LogItHook; -import com.github.games647.fastlogin.bukkit.hooks.LoginSecurityHook; -import com.github.games647.fastlogin.bukkit.hooks.UltraAuthHook; -import com.github.games647.fastlogin.bukkit.hooks.xAuthHook; +import com.github.games647.fastlogin.bukkit.hooks.*; import com.github.games647.fastlogin.core.hooks.AuthPlugin; import com.google.common.collect.Lists; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; import java.util.List; import java.util.logging.Level; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; - public class DelayedAuthHook implements Runnable { private final FastLoginBukkit plugin; @@ -35,10 +29,14 @@ public class DelayedAuthHook implements Runnable { + "and bungeecord is deactivated. " + "Either one or both of the checks have to pass in order to use this plugin"); } + + if(hookFound) + plugin.setServerStarted(); } private boolean registerHooks() { AuthPlugin authPluginHook = null; + try { @SuppressWarnings("unchecked") List>> supportedHooks = Lists.newArrayList(AuthMeHook.class @@ -67,9 +65,8 @@ public class DelayedAuthHook implements Runnable { if (plugin.getCore().getAuthPluginHook() == null) { plugin.getCore().setAuthPluginHook(authPluginHook); - plugin.setServerStarted(); } return true; } -} +} \ No newline at end of file