mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-31 11:17:33 +02:00
Fixed Java auto login/register
This commit is contained in:
@ -49,19 +49,25 @@ public class ConnectionListener implements Listener {
|
|||||||
// having the login session from the login process
|
// having the login session from the login process
|
||||||
BukkitLoginSession session = plugin.getSession(player.getAddress());
|
BukkitLoginSession session = plugin.getSession(player.getAddress());
|
||||||
|
|
||||||
|
boolean isFloodgateLogin = false;
|
||||||
if (Bukkit.getServer().getPluginManager().isPluginEnabled("floodgate")) {
|
if (Bukkit.getServer().getPluginManager().isPluginEnabled("floodgate")) {
|
||||||
FloodgatePlayer floodgatePlayer = FloodgateApi.getInstance().getPlayer(player.getUniqueId());
|
FloodgatePlayer floodgatePlayer = FloodgateApi.getInstance().getPlayer(player.getUniqueId());
|
||||||
if (floodgatePlayer != null) {
|
if (floodgatePlayer != null) {
|
||||||
|
isFloodgateLogin = true;
|
||||||
Runnable floodgateAuthTask = new FloodgateAuthTask(plugin, player, floodgatePlayer);
|
Runnable floodgateAuthTask = new FloodgateAuthTask(plugin, player, floodgatePlayer);
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, floodgateAuthTask);
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, floodgateAuthTask);
|
||||||
}
|
}
|
||||||
} else if (session == null) {
|
}
|
||||||
String sessionId = plugin.getSessionId(player.getAddress());
|
|
||||||
plugin.getLog().info("No on-going login session for player: {} with ID {}", player, sessionId);
|
if (!isFloodgateLogin) {
|
||||||
} else {
|
if (session == null) {
|
||||||
Runnable forceLoginTask = new ForceLoginTask(plugin.getCore(), player, session);
|
String sessionId = plugin.getSessionId(player.getAddress());
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, forceLoginTask);
|
plugin.getLog().info("No on-going login session for player: {} with ID {}", player, sessionId);
|
||||||
}
|
} else {
|
||||||
|
Runnable forceLoginTask = new ForceLoginTask(plugin.getCore(), player, session);
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, forceLoginTask);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
plugin.getBungeeManager().markJoinEventFired(player);
|
plugin.getBungeeManager().markJoinEventFired(player);
|
||||||
// delay the login process to let auth plugins initialize the player
|
// delay the login process to let auth plugins initialize the player
|
||||||
|
Reference in New Issue
Block a user