Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
e1688c86
Commit
e1688c86
authored
Jun 01, 2022
by
ImmuState
Committed by
Melledy
Jun 01, 2022
Browse files
Make sure no player already has the reserved UID when creating and account.
parent
7f3e8984
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/database/DatabaseHelper.java
View file @
e1688c86
...
...
@@ -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
...
...
src/main/resources/languages/en-US.json
View file @
e1688c86
...
...
@@ -103,7 +103,7 @@
"account"
:
{
"modify"
:
"Modify user accounts"
,
"invalid"
:
"Invalid UID."
,
"exists"
:
"Account already exists."
,
"exists"
:
"A
n a
ccount
with this username and/or UID
already exists."
,
"create"
:
"Account created with UID %s."
,
"delete"
:
"Account deleted."
,
"no_account"
:
"Account not found."
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment