Remove the nasty UltraAuth fakeplayer workaround

This commit is contained in:
games647
2016-09-18 10:38:05 +02:00
parent ca42a7c19e
commit a02acd2d63
13 changed files with 13 additions and 1492 deletions

View File

@ -1,5 +1,6 @@
######1.9
* Remove the nasty UltraAuth fakeplayer workaround by using a new api method. You should UltraAuth if you have it
* Upgrade to Java 8
* Drop support for LoginSecurity 1.X since 2.X seems to be stable
* Refactored/Cleaned up a lot of code

Binary file not shown.

Binary file not shown.

View File

@ -176,7 +176,7 @@
<version>2.0.2</version>
<optional>true</optional>
<scope>system</scope>
<systemPath>${project.basedir}/lib/UltraAuth v2.0.2.jar</systemPath>
<systemPath>${project.basedir}/lib/UltraAuth v2.1.2.jar</systemPath>
</dependency>
</dependencies>
</project>

View File

@ -25,7 +25,7 @@ import org.bukkit.entity.Player;
*/
public class CrazyLoginHook implements AuthPlugin<Player> {
protected final CrazyLogin crazyLoginPlugin = CrazyLogin.getPlugin();
private final CrazyLogin crazyLoginPlugin = CrazyLogin.getPlugin();
private final PlayerListener playerListener = getListener();
@Override
@ -83,7 +83,7 @@ public class CrazyLoginHook implements AuthPlugin<Player> {
}
@Override
public boolean forceRegister(final Player player, String password) {
public boolean forceRegister(Player player, String password) {
CrazyLoginDataDatabase crazyDatabase = crazyLoginPlugin.getCrazyDatabase();
//this executes a sql query and accesses only thread safe collections so we can run it async

View File

@ -22,10 +22,10 @@ import ultraauth.managers.PlayerManager;
*/
public class UltraAuthHook implements AuthPlugin<Player> {
protected final Plugin ultraAuthPlugin = Main.main;
private final Plugin ultraAuthPlugin = Main.main;
@Override
public boolean forceLogin(final Player player) {
public boolean forceLogin(Player player) {
//not thread-safe
Future<Boolean> future = Bukkit.getScheduler().callSyncMethod(ultraAuthPlugin, () -> {
UltraAuthAPI.authenticatedPlayer(player);
@ -42,7 +42,7 @@ public class UltraAuthHook implements AuthPlugin<Player> {
@Override
public boolean isRegistered(String playerName) throws Exception {
return UltraAuthAPI.isRegisterd(new FakePlayer(playerName));
return UltraAuthAPI.isRegisterd(playerName);
}
@Override

View File

@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
*/
public class xAuthHook implements AuthPlugin<Player> {
protected final xAuth xAuthPlugin = xAuth.getPlugin();
private final xAuth xAuthPlugin = xAuth.getPlugin();
@Override
public boolean forceLogin(Player player) {

View File

@ -32,7 +32,7 @@ public class BungeeCordListener implements PluginMessageListener {
private static final String FILE_NAME = "proxy-whitelist.txt";
protected final FastLoginBukkit plugin;
private final FastLoginBukkit plugin;
//null if whitelist is empty so bungeecord support is disabled
private final Set<UUID> proxyIds;

View File

@ -16,7 +16,7 @@ import protocolsupport.api.events.PlayerPropertiesResolveEvent;
public class ProtocolSupportListener extends JoinManagement<Player, ProtocolLoginSource> implements Listener {
protected final FastLoginBukkit plugin;
private final FastLoginBukkit plugin;
public ProtocolSupportListener(FastLoginBukkit plugin) {
super(plugin.getCore(), plugin.getCore().getAuthPluginHook());

View File

@ -18,7 +18,7 @@ import org.bukkit.entity.Player;
public class ForceLoginTask implements Runnable {
private final FastLoginBukkit plugin;
protected final Player player;
private final Player player;
public ForceLoginTask(FastLoginBukkit plugin, Player player) {
this.plugin = plugin;

View File

@ -32,7 +32,7 @@ import net.md_5.bungee.event.EventPriority;
*/
public class PlayerConnectionListener implements Listener {
protected final FastLoginBungee plugin;
private final FastLoginBungee plugin;
public PlayerConnectionListener(FastLoginBungee plugin) {
this.plugin = plugin;

View File

@ -19,7 +19,7 @@ import net.md_5.bungee.event.EventHandler;
public class PluginMessageListener implements Listener {
protected final FastLoginBungee plugin;
private final FastLoginBungee plugin;
public PluginMessageListener(FastLoginBungee plugin) {
this.plugin = plugin;