Refactor accounts to not use a player uid

This commit is contained in:
Melledy
2022-05-27 00:22:55 -07:00
parent 880d177034
commit 243ad3abe5
12 changed files with 144 additions and 133 deletions

View File

@@ -52,7 +52,7 @@ public final class AccountCommand implements CommandHandler {
account.addPermission("*");
account.save(); // Save account to database.
CommandHandler.sendMessage(null, translate(sender, "commands.account.create", Integer.toString(account.getPlayerUid())));
CommandHandler.sendMessage(null, translate(sender, "commands.account.create", Integer.toString(account.getReservedPlayerUid())));
}
return;
case "delete":
@@ -63,10 +63,10 @@ public final class AccountCommand implements CommandHandler {
CommandHandler.sendMessage(null, translate(sender, "commands.account.no_account"));
return;
}
// Get the player for the account.
// If that player is currently online, we kick them before proceeding with the deletion.
Player player = Grasscutter.getGameServer().getPlayerByUid(toDelete.getPlayerUid());
Player player = Grasscutter.getGameServer().getPlayerByAccountId(toDelete.getId());
if (player != null) {
player.getSession().close();
}