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
90df06ed
Commit
90df06ed
authored
Apr 28, 2022
by
memetrollsXD
Browse files
Apply to account command
parent
5e9f4976
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/AccountCommand.java
View file @
90df06ed
package
emu.grasscutter.command.commands
;
package
emu.grasscutter.command.commands
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.database.DatabaseHelper
;
import
emu.grasscutter.database.DatabaseHelper
;
...
@@ -7,8 +8,7 @@ import emu.grasscutter.game.player.Player;
...
@@ -7,8 +8,7 @@ import emu.grasscutter.game.player.Player;
import
java.util.List
;
import
java.util.List
;
@Command
(
label
=
"account"
,
usage
=
"account <create|delete> <username> [uid]"
,
@Command
(
label
=
"account"
,
usage
=
"account <create|delete> <username> [uid]"
,
description
=
"Modify user accounts"
)
description
=
"Modify user accounts"
)
public
final
class
AccountCommand
implements
CommandHandler
{
public
final
class
AccountCommand
implements
CommandHandler
{
@Override
@Override
...
@@ -47,7 +47,13 @@ public final class AccountCommand implements CommandHandler {
...
@@ -47,7 +47,13 @@ public final class AccountCommand implements CommandHandler {
return
;
return
;
}
else
{
}
else
{
CommandHandler
.
sendMessage
(
null
,
"Account created with UID "
+
account
.
getPlayerUid
()
+
"."
);
CommandHandler
.
sendMessage
(
null
,
"Account created with UID "
+
account
.
getPlayerUid
()
+
"."
);
account
.
addPermission
(
"*"
);
// Grant the player superuser permissions.
for
(
String
permission
:
Grasscutter
.
getConfig
().
getDispatchOptions
().
defaultPermissions
)
{
if
(!
permission
.
isBlank
())
{
account
.
addPermission
(
permission
);
}
}
account
.
save
();
// Save account to database.
account
.
save
();
// Save account to database.
}
}
return
;
return
;
...
...
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