diff --git a/src/main/java/emu/grasscutter/database/DatabaseHelper.java b/src/main/java/emu/grasscutter/database/DatabaseHelper.java index 466cedc6b..fdd9c289e 100644 --- a/src/main/java/emu/grasscutter/database/DatabaseHelper.java +++ b/src/main/java/emu/grasscutter/database/DatabaseHelper.java @@ -38,10 +38,18 @@ public final class DatabaseHelper { if (reservedId == GameConstants.SERVER_CONSOLE_UID) { return null; } + + // Make sure not other accounts has that id as its reservedPlayerId exists = DatabaseHelper.getAccountByPlayerId(reservedId); if (exists != null) { return null; } + + // Make sure no existing player already has this id. + Player existsPlayer = DatabaseHelper.getPlayerByUid(reservedId); + if (existsPlayer != null) { + return null; + } } // Account diff --git a/src/main/resources/languages/en-US.json b/src/main/resources/languages/en-US.json index c747742bd..f18729700 100644 --- a/src/main/resources/languages/en-US.json +++ b/src/main/resources/languages/en-US.json @@ -103,7 +103,7 @@ "account": { "modify": "Modify user accounts", "invalid": "Invalid UID.", - "exists": "Account already exists.", + "exists": "An account with this username and/or UID already exists.", "create": "Account created with UID %s.", "delete": "Account deleted.", "no_account": "Account not found.",