Skip to content
Snippets Groups Projects
Commit e1688c86 authored by ImmuState's avatar ImmuState Committed by Melledy
Browse files

Make sure no player already has the reserved UID when creating and account.

parent 7f3e8984
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -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.",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment