mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Merge pull request #543 from Smart123s/fix-warnings
Get rid of several warning messages
This commit is contained in:
@ -40,34 +40,32 @@ public class BukkitLoginSession extends LoginSession {
|
|||||||
|
|
||||||
private static final byte[] EMPTY_ARRAY = {};
|
private static final byte[] EMPTY_ARRAY = {};
|
||||||
|
|
||||||
private final String serverId;
|
|
||||||
private final byte[] verifyToken;
|
private final byte[] verifyToken;
|
||||||
|
|
||||||
private boolean verified;
|
private boolean verified;
|
||||||
|
|
||||||
private SkinProperty skinProperty;
|
private SkinProperty skinProperty;
|
||||||
|
|
||||||
public BukkitLoginSession(String username, String serverId, byte[] verifyToken, boolean registered
|
public BukkitLoginSession(String username, byte[] verifyToken, boolean registered
|
||||||
, StoredProfile profile) {
|
, StoredProfile profile) {
|
||||||
super(username, registered, profile);
|
super(username, registered, profile);
|
||||||
|
|
||||||
this.serverId = serverId;
|
|
||||||
this.verifyToken = verifyToken.clone();
|
this.verifyToken = verifyToken.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
//available for BungeeCord
|
//available for BungeeCord
|
||||||
public BukkitLoginSession(String username, boolean registered) {
|
public BukkitLoginSession(String username, boolean registered) {
|
||||||
this(username, "", EMPTY_ARRAY, registered, null);
|
this(username, EMPTY_ARRAY, registered, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
//cracked player
|
//cracked player
|
||||||
public BukkitLoginSession(String username, StoredProfile profile) {
|
public BukkitLoginSession(String username, StoredProfile profile) {
|
||||||
this(username, "", EMPTY_ARRAY, false, profile);
|
this(username, EMPTY_ARRAY, false, profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ProtocolSupport
|
//ProtocolSupport
|
||||||
public BukkitLoginSession(String username, boolean registered, StoredProfile profile) {
|
public BukkitLoginSession(String username, boolean registered, StoredProfile profile) {
|
||||||
this(username, "", EMPTY_ARRAY, registered, profile);
|
this(username, EMPTY_ARRAY, registered, profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,12 +36,10 @@ import org.slf4j.Logger;
|
|||||||
|
|
||||||
public class BukkitScheduler extends AsyncScheduler {
|
public class BukkitScheduler extends AsyncScheduler {
|
||||||
|
|
||||||
private final Plugin plugin;
|
|
||||||
private final Executor syncExecutor;
|
private final Executor syncExecutor;
|
||||||
|
|
||||||
public BukkitScheduler(Plugin plugin, Logger logger, ThreadFactory threadFactory) {
|
public BukkitScheduler(Plugin plugin, Logger logger, ThreadFactory threadFactory) {
|
||||||
super(logger, threadFactory);
|
super(logger, threadFactory);
|
||||||
this.plugin = plugin;
|
|
||||||
|
|
||||||
syncExecutor = r -> Bukkit.getScheduler().runTask(plugin, r);
|
syncExecutor = r -> Bukkit.getScheduler().runTask(plugin, r);
|
||||||
}
|
}
|
||||||
|
@ -48,12 +48,10 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Server.Spigot;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.geysermc.floodgate.api.FloodgateApi;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,6 @@ import com.github.games647.fastlogin.core.StoredProfile;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent;
|
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
@ -33,9 +33,7 @@ import java.util.concurrent.Future;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
import ultraauth.api.UltraAuthAPI;
|
import ultraauth.api.UltraAuthAPI;
|
||||||
import ultraauth.main.Main;
|
|
||||||
import ultraauth.managers.PlayerManager;
|
import ultraauth.managers.PlayerManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,7 +45,6 @@ import ultraauth.managers.PlayerManager;
|
|||||||
*/
|
*/
|
||||||
public class UltraAuthHook implements AuthPlugin<Player> {
|
public class UltraAuthHook implements AuthPlugin<Player> {
|
||||||
|
|
||||||
private final Plugin ultraAuthPlugin = Main.main;
|
|
||||||
private final FastLoginBukkit plugin;
|
private final FastLoginBukkit plugin;
|
||||||
|
|
||||||
public UltraAuthHook(FastLoginBukkit plugin) {
|
public UltraAuthHook(FastLoginBukkit plugin) {
|
||||||
|
@ -104,10 +104,9 @@ public class NameCheckTask extends JoinManagement<Player, CommandSender, Protoco
|
|||||||
String ip = player.getAddress().getAddress().getHostAddress();
|
String ip = player.getAddress().getAddress().getHostAddress();
|
||||||
core.getPendingLogin().put(ip + username, new Object());
|
core.getPendingLogin().put(ip + username, new Object());
|
||||||
|
|
||||||
String serverId = source.getServerId();
|
|
||||||
byte[] verify = source.getVerifyToken();
|
byte[] verify = source.getVerifyToken();
|
||||||
|
|
||||||
BukkitLoginSession playerSession = new BukkitLoginSession(username, serverId, verify, registered, profile);
|
BukkitLoginSession playerSession = new BukkitLoginSession(username, verify, registered, profile);
|
||||||
plugin.putSession(player.getAddress(), playerSession);
|
plugin.putSession(player.getAddress(), playerSession);
|
||||||
//cancel only if the player has a paid account otherwise login as normal offline player
|
//cancel only if the player has a paid account otherwise login as normal offline player
|
||||||
synchronized (packetEvent.getAsyncMarker().getProcessingLock()) {
|
synchronized (packetEvent.getAsyncMarker().getProcessingLock()) {
|
||||||
|
@ -37,7 +37,6 @@ import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
|||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
@ -59,8 +59,6 @@ import net.md_5.bungee.api.plugin.Plugin;
|
|||||||
import net.md_5.bungee.api.plugin.PluginManager;
|
import net.md_5.bungee.api.plugin.PluginManager;
|
||||||
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
|
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,8 +32,6 @@ import red.mohist.sodionauth.bungee.implementation.BungeePlayer;
|
|||||||
import red.mohist.sodionauth.core.SodionAuthApi;
|
import red.mohist.sodionauth.core.SodionAuthApi;
|
||||||
import red.mohist.sodionauth.core.exception.AuthenticatedException;
|
import red.mohist.sodionauth.core.exception.AuthenticatedException;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GitHub: https://github.com/Mohist-Community/SodionAuth
|
* GitHub: https://github.com/Mohist-Community/SodionAuth
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -58,7 +58,6 @@ import net.md_5.bungee.connection.LoginResult.Property;
|
|||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
import net.md_5.bungee.event.EventPriority;
|
import net.md_5.bungee.event.EventPriority;
|
||||||
|
|
||||||
import org.geysermc.floodgate.FloodgateAPI;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -69,17 +68,14 @@ import org.slf4j.LoggerFactory;
|
|||||||
public class ConnectListener implements Listener {
|
public class ConnectListener implements Listener {
|
||||||
|
|
||||||
private static final String UUID_FIELD_NAME = "uniqueId";
|
private static final String UUID_FIELD_NAME = "uniqueId";
|
||||||
private static final boolean initialHandlerClazzFound;
|
|
||||||
private static final MethodHandle uniqueIdSetter;
|
private static final MethodHandle uniqueIdSetter;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
MethodHandle setHandle = null;
|
MethodHandle setHandle = null;
|
||||||
boolean handlerFound = false;
|
|
||||||
try {
|
try {
|
||||||
Lookup lookup = MethodHandles.lookup();
|
Lookup lookup = MethodHandles.lookup();
|
||||||
|
|
||||||
Class.forName("net.md_5.bungee.connection.InitialHandler");
|
Class.forName("net.md_5.bungee.connection.InitialHandler");
|
||||||
handlerFound = true;
|
|
||||||
|
|
||||||
Field uuidField = InitialHandler.class.getDeclaredField(UUID_FIELD_NAME);
|
Field uuidField = InitialHandler.class.getDeclaredField(UUID_FIELD_NAME);
|
||||||
uuidField.setAccessible(true);
|
uuidField.setAccessible(true);
|
||||||
@ -94,20 +90,17 @@ public class ConnectListener implements Listener {
|
|||||||
reflectiveOperationException.printStackTrace();
|
reflectiveOperationException.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
initialHandlerClazzFound = handlerFound;
|
|
||||||
uniqueIdSetter = setHandle;
|
uniqueIdSetter = setHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final FastLoginBungee plugin;
|
private final FastLoginBungee plugin;
|
||||||
private final RateLimiter rateLimiter;
|
private final RateLimiter rateLimiter;
|
||||||
private final Property[] emptyProperties = {};
|
private final Property[] emptyProperties = {};
|
||||||
private final String floodgateVersion;
|
|
||||||
private final FloodgateHook floodgateHook;
|
private final FloodgateHook floodgateHook;
|
||||||
|
|
||||||
public ConnectListener(FastLoginBungee plugin, RateLimiter rateLimiter, String floodgateVersion) {
|
public ConnectListener(FastLoginBungee plugin, RateLimiter rateLimiter, String floodgateVersion) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.rateLimiter = rateLimiter;
|
this.rateLimiter = rateLimiter;
|
||||||
this.floodgateVersion = floodgateVersion;
|
|
||||||
|
|
||||||
// Get the appropriate floodgate api hook based on the version
|
// Get the appropriate floodgate api hook based on the version
|
||||||
if (floodgateVersion.startsWith("1")) {
|
if (floodgateVersion.startsWith("1")) {
|
||||||
|
@ -30,7 +30,6 @@ import com.github.games647.fastlogin.bungee.event.BungeeFastLoginPremiumToggleEv
|
|||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent;
|
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
Reference in New Issue
Block a user