forked from TuxCoding/FastLogin
Remove the check for auth plugins in order to allow auth plugins to
register their hook after the initialization of FastLogin
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
* Added API methods for plugins to set their own password generator
|
* Added API methods for plugins to set their own password generator
|
||||||
* Added API methods for plugins to set their own auth plugin hook
|
* Added API methods for plugins to set their own auth plugin hook
|
||||||
|
=> Added support for AdvancedLogin
|
||||||
|
|
||||||
######1.1
|
######1.1
|
||||||
|
|
||||||
|
@@ -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/)
|
* [AuthMe](http://dev.bukkit.org/bukkit-plugins/authme-reloaded/)
|
||||||
* [xAuth](http://dev.bukkit.org/bukkit-plugins/xauth/)
|
* [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/)
|
* [CrazyLogin](http://dev.bukkit.org/bukkit-plugins/crazylogin/)
|
||||||
* [LoginSecurity](http://dev.bukkit.org/bukkit-plugins/loginsecurity/)
|
* [LoginSecurity](http://dev.bukkit.org/bukkit-plugins/loginsecurity/)
|
||||||
* [RoyalAuth](http://dev.bukkit.org/bukkit-plugins/royalauth/)
|
* [RoyalAuth](http://dev.bukkit.org/bukkit-plugins/royalauth/)
|
||||||
|
@@ -99,10 +99,10 @@ public class FastLoginBukkit extends JavaPlugin {
|
|||||||
if (bungeeCord) {
|
if (bungeeCord) {
|
||||||
getLogger().info("BungeeCord setting detected. No auth plugin is required");
|
getLogger().info("BungeeCord setting detected. No auth plugin is required");
|
||||||
} else if (!hookFound) {
|
} 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");
|
+ "Either one or both of the checks have to pass in order to use this plugin");
|
||||||
setEnabled(false);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bungeeCord) {
|
if (bungeeCord) {
|
||||||
|
@@ -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
|
//remove old data every time on a new login in order to keep the session only for one person
|
||||||
plugin.getSessions().remove(username);
|
plugin.getSessions().remove(username);
|
||||||
|
|
||||||
|
BukkitAuthPlugin authPlugin = plugin.getAuthPlugin();
|
||||||
|
if (authPlugin == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PlayerProfile playerProfile = plugin.getStorage().getProfile(username, true);
|
PlayerProfile playerProfile = plugin.getStorage().getProfile(username, true);
|
||||||
if (playerProfile != null) {
|
if (playerProfile != null) {
|
||||||
if (playerProfile.isPremium()) {
|
if (playerProfile.isPremium()) {
|
||||||
@@ -42,7 +47,6 @@ public class ProtocolSupportListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else if (playerProfile.getUserId() == -1) {
|
} else if (playerProfile.getUserId() == -1) {
|
||||||
//user not exists in the db
|
//user not exists in the db
|
||||||
BukkitAuthPlugin authPlugin = plugin.getAuthPlugin();
|
|
||||||
try {
|
try {
|
||||||
if (plugin.getConfig().getBoolean("autoRegister") && !authPlugin.isRegistered(username)) {
|
if (plugin.getConfig().getBoolean("autoRegister") && !authPlugin.isRegistered(username)) {
|
||||||
UUID premiumUUID = plugin.getApiConnector().getPremiumUUID(username);
|
UUID premiumUUID = plugin.getApiConnector().getPremiumUUID(username);
|
||||||
|
@@ -75,6 +75,11 @@ public class StartPacketListener extends PacketAdapter {
|
|||||||
plugin.getLogger().log(Level.FINER, "Player {0} with {1} connecting to the server"
|
plugin.getLogger().log(Level.FINER, "Player {0} with {1} connecting to the server"
|
||||||
, new Object[]{sessionKey, username});
|
, new Object[]{sessionKey, username});
|
||||||
|
|
||||||
|
BukkitAuthPlugin authPlugin = plugin.getAuthPlugin();
|
||||||
|
if (authPlugin == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PlayerProfile playerProfile = plugin.getStorage().getProfile(username, true);
|
PlayerProfile playerProfile = plugin.getStorage().getProfile(username, true);
|
||||||
if (playerProfile != null) {
|
if (playerProfile != null) {
|
||||||
if (playerProfile.isPremium()) {
|
if (playerProfile.isPremium()) {
|
||||||
@@ -83,7 +88,6 @@ public class StartPacketListener extends PacketAdapter {
|
|||||||
}
|
}
|
||||||
} else if (playerProfile.getUserId() == -1) {
|
} else if (playerProfile.getUserId() == -1) {
|
||||||
//user not exists in the db
|
//user not exists in the db
|
||||||
BukkitAuthPlugin authPlugin = plugin.getAuthPlugin();
|
|
||||||
try {
|
try {
|
||||||
if (plugin.getConfig().getBoolean("autoRegister") && !authPlugin.isRegistered(username)) {
|
if (plugin.getConfig().getBoolean("autoRegister") && !authPlugin.isRegistered(username)) {
|
||||||
UUID premiumUUID = plugin.getApiConnector().getPremiumUUID(username);
|
UUID premiumUUID = plugin.getApiConnector().getPremiumUUID(username);
|
||||||
|
Reference in New Issue
Block a user