diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java index 374ac8e3..2327c6c7 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java @@ -2,19 +2,11 @@ package com.github.games647.fastlogin.bukkit.hooks; import com.github.games647.fastlogin.bukkit.FastLoginBukkit; import com.github.games647.fastlogin.core.hooks.AuthPlugin; -import com.google.common.collect.Sets; import fr.xephi.authme.api.v3.AuthMeApi; -import fr.xephi.authme.events.RestoreSessionEvent; - -import java.util.Set; -import java.util.UUID; import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerQuitEvent; /** * Github: https://github.com/Xephi/AuthMeReloaded/ @@ -27,29 +19,16 @@ import org.bukkit.event.player.PlayerQuitEvent; */ public class AuthMeHook implements AuthPlugin, Listener { - private final Set sessionLogins = Sets.newConcurrentHashSet(); private final FastLoginBukkit plugin; public AuthMeHook(FastLoginBukkit plugin) { this.plugin = plugin; } - @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) - public void onRestoreSession(RestoreSessionEvent restoreSessionEvent) { - UUID uniqueId = restoreSessionEvent.getPlayer().getUniqueId(); - sessionLogins.add(uniqueId); - } - - @EventHandler - public void onPlayerQuit(PlayerQuitEvent quitEvent) { - UUID uniqueId = quitEvent.getPlayer().getUniqueId(); - sessionLogins.remove(uniqueId); - } - @Override public boolean forceLogin(Player player) { //skips registration and login - if (AuthMeApi.getInstance().isAuthenticated(player) || sessionLogins.contains(player.getUniqueId())) { + if (AuthMeApi.getInstance().isAuthenticated(player)) { return false; } else { AuthMeApi.getInstance().forceLogin(player); diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeListener.java index 2eec7d4d..cb2d5fc5 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeListener.java @@ -65,6 +65,8 @@ public class BungeeListener implements PluginMessageListener { //fail if BungeeCord support is disabled (id = null) if (proxyIds.contains(sourceId)) { readMessage(checkedPlayer, subChannel, playerName, player); + } else { + plugin.getLog().warn("Received proxy id: {} that doesn't exist in the proxy whitelist file", sourceId); } } } @@ -76,9 +78,9 @@ public class BungeeListener implements PluginMessageListener { BukkitLoginSession playerSession = new BukkitLoginSession(playerName, true); playerSession.setVerified(true); plugin.getLoginSessions().put(id, playerSession); - Bukkit.getScheduler().runTaskAsynchronously(plugin, new ForceLoginTask(plugin.getCore(), player)); + Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new ForceLoginTask(plugin.getCore(), player), 20L); } else if ("AUTO_REGISTER".equalsIgnoreCase(subChannel)) { - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, () -> { AuthPlugin authPlugin = plugin.getCore().getAuthPluginHook(); try { //we need to check if the player is registered on Bukkit too @@ -91,7 +93,7 @@ public class BungeeListener implements PluginMessageListener { } catch (Exception ex) { plugin.getLog().error("Failed to query isRegistered", ex); } - }); + }, 20L); } } diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java index f44979b7..0a377fe0 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java @@ -26,8 +26,7 @@ import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventPriority; /** - * Enables online mode logins for specified users and sends - * plugin message to the Bukkit version of this plugin in + * Enables online mode logins for specified users and sends plugin message to the Bukkit version of this plugin in * order to clear that the connection is online mode. */ public class ConnectListener implements Listener {