forked from TuxCoding/FastLogin
Relocate HikariCP and slf4j too to prevent conflicts
This commit is contained in:
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-17
|
||||
Copyright (c) 2015-2018
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -20,9 +20,9 @@ import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Github: https://github.com/ST-DDT/CrazyLogin
|
||||
*
|
||||
* <p>
|
||||
* Project page:
|
||||
*
|
||||
* <p>
|
||||
* Bukkit: https://dev.bukkit.org/server-mods/crazylogin/
|
||||
*/
|
||||
public class CrazyLoginHook implements AuthPlugin<Player> {
|
||||
|
@ -13,9 +13,11 @@ import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Github: https://github.com/XziomekX/LogIt
|
||||
* <p>
|
||||
* Project page:
|
||||
*
|
||||
* <p>
|
||||
* Bukkit: Unknown
|
||||
* <p>
|
||||
* Spigot: Unknown
|
||||
*/
|
||||
public class LogItHook implements AuthPlugin<Player> {
|
||||
|
@ -12,8 +12,9 @@ import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Github: https://github.com/lenis0012/LoginSecurity-2 Project page:
|
||||
*
|
||||
* <p>
|
||||
* Bukkit: https://dev.bukkit.org/bukkit-plugins/loginsecurity/
|
||||
* <p>
|
||||
* Spigot: https://www.spigotmc.org/resources/loginsecurity.19362/
|
||||
*/
|
||||
public class LoginSecurityHook implements AuthPlugin<Player> {
|
||||
|
@ -16,9 +16,9 @@ import ultraauth.managers.PlayerManager;
|
||||
|
||||
/**
|
||||
* Project page:
|
||||
*
|
||||
* <p>
|
||||
* Bukkit: https://dev.bukkit.org/bukkit-plugins/ultraauth-aa/
|
||||
*
|
||||
* <p>
|
||||
* Spigot: https://www.spigotmc.org/resources/ultraauth.17044/
|
||||
*/
|
||||
public class UltraAuthHook implements AuthPlugin<Player> {
|
||||
|
@ -15,9 +15,9 @@ import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Github: https://github.com/LycanDevelopment/xAuth/
|
||||
*
|
||||
* <p>
|
||||
* Project page:
|
||||
*
|
||||
* <p>
|
||||
* Bukkit: https://dev.bukkit.org/bukkit-plugins/xauth/
|
||||
*/
|
||||
public class xAuthHook implements AuthPlugin<Player> {
|
||||
|
@ -26,7 +26,7 @@ public class DelayedAuthHook implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
boolean hookFound = plugin.getCore().getAuthPluginHook() != null || registerHooks();
|
||||
boolean hookFound = isHookFound();
|
||||
if (plugin.isBungeeCord()) {
|
||||
plugin.getLog().info("BungeeCord setting detected. No auth plugin is required");
|
||||
} else if (!hookFound) {
|
||||
@ -41,6 +41,10 @@ public class DelayedAuthHook implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isHookFound() {
|
||||
return plugin.getCore().getAuthPluginHook() != null || registerHooks();
|
||||
}
|
||||
|
||||
private boolean registerHooks() {
|
||||
AuthPlugin<Player> authPluginHook = getAuthHook();
|
||||
if (authPluginHook == null) {
|
||||
@ -82,10 +86,10 @@ public class DelayedAuthHook implements Runnable {
|
||||
private AuthPlugin<Player> newInstance(Class<? extends AuthPlugin<Player>> clazz)
|
||||
throws ReflectiveOperationException {
|
||||
try {
|
||||
Constructor<? extends AuthPlugin<Player>> cons = clazz.getConstructor(FastLoginBukkit.class);
|
||||
Constructor<? extends AuthPlugin<Player>> cons = clazz.getDeclaredConstructor(FastLoginBukkit.class);
|
||||
return cons.newInstance(plugin);
|
||||
} catch (NoSuchMethodException noMethodEx) {
|
||||
return clazz.newInstance();
|
||||
return clazz.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
|
||||
getProxy().getPluginManager().registerListener(this, new MessageListener(this));
|
||||
|
||||
//this is required to listen to messages from the server
|
||||
getProxy().registerChannel(getDescription().getName());
|
||||
getProxy().registerChannel(getName());
|
||||
|
||||
registerHook();
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class MessageListener implements Listener {
|
||||
@EventHandler
|
||||
public void onPluginMessage(PluginMessageEvent pluginMessageEvent) {
|
||||
String channel = pluginMessageEvent.getTag();
|
||||
if (pluginMessageEvent.isCancelled() || !plugin.getDescription().getName().equals(channel)) {
|
||||
if (pluginMessageEvent.isCancelled() || !plugin.getName().equals(channel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,14 @@
|
||||
<pattern>com.google.gson</pattern>
|
||||
<shadedPattern>fastlogin.gson</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.slf4j</pattern>
|
||||
<shadedPattern>fastlogin.slf4j</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.zaxxer.hikari</pattern>
|
||||
<shadedPattern>fastlogin.hikari</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
Reference in New Issue
Block a user