Skip to content

Commit 115a3f0

Browse files
committed
Fix issue #1246
1 parent 4dd6b9a commit 115a3f0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ public void run() {
167167
return;
168168
}
169169

170+
// Set the UUID for the player login from floodgate.
171+
if (isLinked && profile.isOnlinemodePreferred()) {
172+
profile.setId(floodgatePlayer.getCorrectUniqueId());
173+
core.getPlugin().getLog().info(
174+
"Player {} login as a Floodgate linked premium user (UUID: {})",
175+
username, floodgatePlayer.getCorrectUniqueId());
176+
}
170177
//start Bukkit/Bungee specific tasks
171178
startLogin();
172179

core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ public void run() {
8080
if (success) {
8181
//update only on success to prevent corrupt data
8282
if (playerProfile != null) {
83-
playerProfile.setId(session.getUuid());
83+
if (session.getUuid() == null) {
84+
// Set session ID from floodgatePlayer.getCorrectUniqueId()
85+
session.setUuid(playerProfile.getId());
86+
} else {
87+
// Set player UUID to session UUID
88+
playerProfile.setId(session.getUuid());
89+
}
8490
playerProfile.setOnlinemodePreferred(true);
8591
storage.save(playerProfile);
8692
}

0 commit comments

Comments
 (0)