Fixes bnet account create command.
This commit is contained in:
@@ -30,10 +30,10 @@ namespace Game
|
||||
{
|
||||
gameAccountName = "";
|
||||
|
||||
if (email.Length > 320)
|
||||
if (email.IsEmpty() || email.Length > 320)
|
||||
return AccountOpResult.NameTooLong;
|
||||
|
||||
if (password.Length > 16)
|
||||
if (password.IsEmpty() || password.Length > 16)
|
||||
return AccountOpResult.PassTooLong;
|
||||
|
||||
if (GetId(email) != 0)
|
||||
|
||||
@@ -30,28 +30,15 @@ namespace Game.Chat
|
||||
{
|
||||
List<object> arguments = new();
|
||||
arguments.Add(handler);
|
||||
for (var i = 1; i < parameterTypes.Length; i++)
|
||||
arguments.Add(default);
|
||||
|
||||
//for each arg we need to see if its a:
|
||||
//1: hyperlink
|
||||
//2: Optional arg
|
||||
//3: reg arg.
|
||||
int index = 1;
|
||||
while (index < parameterTypes.Length)
|
||||
for (var i = 1; i < parameterTypes.Length; i++)
|
||||
{
|
||||
int oldPos = args.GetCurrentPosition();
|
||||
if (!ParseArgument(out dynamic value, parameterTypes[i], args))
|
||||
break;
|
||||
|
||||
if (ParseArgument(out dynamic value, parameterTypes[index], args))
|
||||
index++;
|
||||
|
||||
if (args.IsAtEnd() && index < parameterTypes.Length)
|
||||
{
|
||||
//We found a optional arg and we dont have the correct amount of args
|
||||
args.SetCurrentPosition(oldPos);
|
||||
arguments.Add(default);
|
||||
index++;
|
||||
}
|
||||
else
|
||||
arguments.Add(value);
|
||||
arguments[i] = value;
|
||||
}
|
||||
|
||||
return arguments.ToArray();
|
||||
@@ -123,7 +110,7 @@ namespace Game.Chat
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Game.Chat.Commands
|
||||
[Command("create", RBACPermissions.CommandBnetAccountCreate, true)]
|
||||
static bool HandleAccountCreateCommand(CommandHandler handler, string accountName, string password, bool? createGameAccount)
|
||||
{
|
||||
if (!accountName.Contains('@'))
|
||||
if (accountName.IsEmpty() || !accountName.Contains('@'))
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.AccountInvalidBnetName);
|
||||
return false;
|
||||
@@ -38,7 +38,7 @@ namespace Game.Chat.Commands
|
||||
switch (Global.BNetAccountMgr.CreateBattlenetAccount(accountName, password, createGameAccount.GetValueOrDefault(true), out gameAccountName))
|
||||
{
|
||||
case AccountOpResult.Ok:
|
||||
if (createGameAccount.Value)
|
||||
if (createGameAccount.HasValue && createGameAccount.Value)
|
||||
handler.SendSysMessage(CypherStrings.AccountCreatedBnetWithGame, accountName, gameAccountName);
|
||||
else
|
||||
handler.SendSysMessage(CypherStrings.AccountCreated, accountName);
|
||||
|
||||
@@ -879,7 +879,7 @@ namespace Game.Chat
|
||||
return false;
|
||||
}
|
||||
|
||||
if (state == 0)
|
||||
if (!state.HasValue)
|
||||
{
|
||||
// reset all states
|
||||
for (AuraStateType s = 0; s < AuraStateType.Max; ++s)
|
||||
|
||||
Reference in New Issue
Block a user