Skip to content

Commit ce6bd1e

Browse files
committed
Migrate Floodgate players at join time to v2 database
1 parent a28cdca commit ce6bd1e

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,24 @@ public void run() {
8585
// linked players are stored as Java (= not Floodgate) players
8686
profile.setFloodgate(!isLinked);
8787
} else {
88-
if (!profile.isFloodgate() && !isLinked) {
89-
core.getPlugin().getLog().warn("Player {} is already stored by FastLogin as a Java Edition player",
88+
if (!profile.isFloodgateMigrated()) {
89+
if (isLinked) {
90+
profile.setFloodgate(false);
91+
core.getPlugin().getLog().info(
92+
"Player {} will be migrated to the v2 database schema as a JAVA (linked Floodgate) user",
93+
username);
94+
} else {
95+
profile.setFloodgate(true);
96+
core.getPlugin().getLog().info(
97+
"Player {} will be migrated to the v2 database schema as a Floodgate user", username);
98+
}
99+
} else if (!profile.isFloodgate() && !isLinked) {
100+
core.getPlugin().getLog().info("Player {} is already stored by FastLogin as a Java Edition player",
90101
username);
91102
return;
92103
} else if (profile.isFloodgate() && isLinked) {
93104
core.getPlugin().getLog()
94-
.warn("Player {} is already stored by FastLogin as a non-linked Bedrock Edition player",
105+
.info("Player {} is already stored by FastLogin as a non-linked Bedrock Edition player",
95106
username);
96107
return;
97108
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ public void onLogin(String username, S source) {
6767
return;
6868
}
6969

70-
if (profile.isFloodgate()) {
70+
if (!profile.isFloodgateMigrated()) {
71+
profile.setFloodgate(false);
72+
core.getPlugin().getLog().info(
73+
"Player {} will be migrated to the v2 database schema as a JAVA user", username);
74+
} else if (profile.isFloodgate()) {
7175
core.getPlugin().getLog().info("Player {} is already stored by FastLogin as a Bedrock Edition player",
7276
username);
7377
return;

0 commit comments

Comments
 (0)