diff --git a/CHANGELOG.md b/CHANGELOG.md index 21981f0b..9c3ff0bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Added API methods for plugins to set their own password generator * Added API methods for plugins to set their own auth plugin hook +=> Added support for AdvancedLogin ######1.1 diff --git a/README.md b/README.md index 002edfd0..9bbf7a96 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ So they don't need to enter passwords. This is also called auto login (auto-logi * [AuthMe](http://dev.bukkit.org/bukkit-plugins/authme-reloaded/) * [xAuth](http://dev.bukkit.org/bukkit-plugins/xauth/) +* [AdvancedLogin (Paid)](https://www.spigotmc.org/resources/advancedlogin.10510/) * [CrazyLogin](http://dev.bukkit.org/bukkit-plugins/crazylogin/) * [LoginSecurity](http://dev.bukkit.org/bukkit-plugins/loginsecurity/) * [RoyalAuth](http://dev.bukkit.org/bukkit-plugins/royalauth/) diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java index e7be8564..9910577d 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java @@ -99,10 +99,10 @@ public class FastLoginBukkit extends JavaPlugin { if (bungeeCord) { getLogger().info("BungeeCord setting detected. No auth plugin is required"); } else if (!hookFound) { - getLogger().info("No auth plugin were found and bungeecord is deactivated. " + getLogger().warning("No auth plugin were found by this plugin " + + "(other plugins could hook into this after the intialization of this plugin)" + + "and bungeecord is deactivated. " + "Either one or both of the checks have to pass in order to use this plugin"); - setEnabled(false); - return; } if (bungeeCord) { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtocolSupportListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtocolSupportListener.java index 99c7f6de..00ad311b 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtocolSupportListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtocolSupportListener.java @@ -34,6 +34,11 @@ public class ProtocolSupportListener implements Listener { //remove old data every time on a new login in order to keep the session only for one person plugin.getSessions().remove(username); + BukkitAuthPlugin authPlugin = plugin.getAuthPlugin(); + if (authPlugin == null) { + return; + } + PlayerProfile playerProfile = plugin.getStorage().getProfile(username, true); if (playerProfile != null) { if (playerProfile.isPremium()) { @@ -42,7 +47,6 @@ public class ProtocolSupportListener implements Listener { } } else if (playerProfile.getUserId() == -1) { //user not exists in the db - BukkitAuthPlugin authPlugin = plugin.getAuthPlugin(); try { if (plugin.getConfig().getBoolean("autoRegister") && !authPlugin.isRegistered(username)) { UUID premiumUUID = plugin.getApiConnector().getPremiumUUID(username); diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/StartPacketListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/StartPacketListener.java index b5cb209b..dc683b21 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/StartPacketListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/StartPacketListener.java @@ -75,6 +75,11 @@ public class StartPacketListener extends PacketAdapter { plugin.getLogger().log(Level.FINER, "Player {0} with {1} connecting to the server" , new Object[]{sessionKey, username}); + BukkitAuthPlugin authPlugin = plugin.getAuthPlugin(); + if (authPlugin == null) { + return; + } + PlayerProfile playerProfile = plugin.getStorage().getProfile(username, true); if (playerProfile != null) { if (playerProfile.isPremium()) { @@ -83,7 +88,6 @@ public class StartPacketListener extends PacketAdapter { } } else if (playerProfile.getUserId() == -1) { //user not exists in the db - BukkitAuthPlugin authPlugin = plugin.getAuthPlugin(); try { if (plugin.getConfig().getBoolean("autoRegister") && !authPlugin.isRegistered(username)) { UUID premiumUUID = plugin.getApiConnector().getPremiumUUID(username);