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
b44df66c
Commit
b44df66c
authored
Apr 20, 2022
by
Jaida Wu
Browse files
Save account to database
Signed-off-by:
Jaida Wu
<
mlgmxyysd@meowcat.org
>
parent
63cb0a81
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/CommandMap.java
View file @
b44df66c
...
@@ -129,7 +129,7 @@ public final class CommandMap {
...
@@ -129,7 +129,7 @@ public final class CommandMap {
if
(
player
!=
null
)
{
if
(
player
!=
null
)
{
String
permissionNode
=
this
.
annotations
.
get
(
label
).
permission
();
String
permissionNode
=
this
.
annotations
.
get
(
label
).
permission
();
Account
account
=
player
.
getAccount
();
Account
account
=
player
.
getAccount
();
if
(!
Objects
.
equals
(
permissionNode
,
""
)
&&
!
account
.
hasPermission
(
permissionNode
))
{
if
(!
permissionNode
.
equals
(
""
)
&&
!
account
.
hasPermission
(
permissionNode
))
{
CommandHandler
.
sendMessage
(
player
,
"You do not have permission to run this command."
);
CommandHandler
.
sendMessage
(
player
,
"You do not have permission to run this command."
);
return
;
return
;
}
}
...
...
src/main/java/emu/grasscutter/command/commands/Account.java
View file @
b44df66c
...
@@ -48,6 +48,7 @@ public class Account implements CommandHandler {
...
@@ -48,6 +48,7 @@ public class Account implements CommandHandler {
}
else
{
}
else
{
CommandHandler
.
sendMessage
(
null
,
"Account created with UID "
+
account
.
getPlayerId
()
+
"."
);
CommandHandler
.
sendMessage
(
null
,
"Account created with UID "
+
account
.
getPlayerId
()
+
"."
);
account
.
addPermission
(
"*"
);
// Grant the player superuser permissions.
account
.
addPermission
(
"*"
);
// Grant the player superuser permissions.
account
.
save
();
// Save account to database.
}
}
return
;
return
;
case
"delete"
:
case
"delete"
:
...
...
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