feat(Script/Commands): allow to pass email in account create (#22310)

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
SHIHUANG214
2025-06-27 21:30:21 +08:00
committed by GitHub
parent 5311717a89
commit 989b64cb3d
5 changed files with 16 additions and 4 deletions

View File

@@ -271,10 +271,15 @@ public:
///- %Parse the command line arguments
char* accountName = strtok((char*)args, " ");
char* password = strtok(nullptr, " ");
char* email = strtok(nullptr, " ");
if (!accountName || !password)
return false;
AccountOpResult result = AccountMgr::CreateAccount(std::string(accountName), std::string(password));
// if email is not specified, use empty string
std::string emailStr = email ? email : "";
AccountOpResult result = AccountMgr::CreateAccount(std::string(accountName), std::string(password), emailStr);
switch (result)
{
case AOR_OK: