mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 13:37:42 +00:00
Make sure no player already has the reserved UID when creating and account.
This commit is contained in:
parent
3312a894ff
commit
f6d0192818
@ -38,10 +38,18 @@ public final class DatabaseHelper {
|
|||||||
if (reservedId == GameConstants.SERVER_CONSOLE_UID) {
|
if (reservedId == GameConstants.SERVER_CONSOLE_UID) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure not other accounts has that id as its reservedPlayerId
|
||||||
exists = DatabaseHelper.getAccountByPlayerId(reservedId);
|
exists = DatabaseHelper.getAccountByPlayerId(reservedId);
|
||||||
if (exists != null) {
|
if (exists != null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure no existing player already has this id.
|
||||||
|
Player existsPlayer = DatabaseHelper.getPlayerByUid(reservedId);
|
||||||
|
if (existsPlayer != null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account
|
// Account
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
"account": {
|
"account": {
|
||||||
"modify": "Modify user accounts",
|
"modify": "Modify user accounts",
|
||||||
"invalid": "Invalid UID.",
|
"invalid": "Invalid UID.",
|
||||||
"exists": "Account already exists.",
|
"exists": "An account with this username and/or UID already exists.",
|
||||||
"create": "Account created with UID %s.",
|
"create": "Account created with UID %s.",
|
||||||
"delete": "Account deleted.",
|
"delete": "Account deleted.",
|
||||||
"no_account": "Account not found.",
|
"no_account": "Account not found.",
|
||||||
|
Loading…
Reference in New Issue
Block a user