mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-29 18:27:36 +02:00
@ -45,7 +45,9 @@ public class ConnectionListener implements Listener {
|
||||
// cases: Paper (firing BungeeCord message before PlayerJoinEvent) or not running BungeeCord and already
|
||||
// having the login session from the login process
|
||||
BukkitLoginSession session = plugin.getSession(player.getAddress());
|
||||
if (session != null) {
|
||||
if (session == null) {
|
||||
plugin.getLog().info("No on-going login session for player: {}", player);
|
||||
} else {
|
||||
Runnable forceLoginTask = new ForceLoginTask(plugin.getCore(), player, session);
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, forceLoginTask);
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ public class ConnectListener implements Listener {
|
||||
//bungeecord will do this automatically so override it on disabled option
|
||||
if (!plugin.getCore().getConfig().get("premiumUuid", true)) {
|
||||
try {
|
||||
UUID oldPremiumId = connection.getUniqueId();
|
||||
UUID offlineUUID = UUIDAdapter.generateOfflineId(username);
|
||||
|
||||
// BungeeCord only allows setting the UUID in PreLogin events and before requesting online mode
|
||||
@ -90,6 +91,8 @@ public class ConnectListener implements Listener {
|
||||
Field idField = InitialHandler.class.getDeclaredField("uniqueId");
|
||||
idField.setAccessible(true);
|
||||
idField.set(connection, offlineUUID);
|
||||
|
||||
plugin.getLog().info("Overriding UUID to {} from {} on {}", offlineUUID, oldPremiumId, connection);
|
||||
} catch (NoSuchFieldException | IllegalAccessException ex) {
|
||||
plugin.getLog().error("Failed to set offline uuid of {}", username, ex);
|
||||
}
|
||||
|
Reference in New Issue
Block a user