From 58d75eda3a0fea8f64d434adb7707b2dfd953089 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 17 Jan 2015 20:02:19 +0100 Subject: Core/Commands: Added "createGameAccount" argument to .bnetaccount create command (default true) to opt out of creating the initial game account --- src/server/scripts/Commands/cs_battlenet_account.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_battlenet_account.cpp b/src/server/scripts/Commands/cs_battlenet_account.cpp index f92f541c0a2..767a75f0b36 100644 --- a/src/server/scripts/Commands/cs_battlenet_account.cpp +++ b/src/server/scripts/Commands/cs_battlenet_account.cpp @@ -21,6 +21,7 @@ #include "Language.h" #include "Player.h" #include "ScriptMgr.h" +#include "Util.h" class battlenet_account_commandscript : public CommandScript { @@ -84,7 +85,12 @@ public: return false; } - switch (Battlenet::AccountMgr::CreateBattlenetAccount(std::string(accountName), std::string(password))) + char* createGameAccountParam = strtok(NULL, " "); + bool createGameAccount = true; + if (createGameAccountParam) + createGameAccount = StringToBool(createGameAccountParam); + + switch (Battlenet::AccountMgr::CreateBattlenetAccount(std::string(accountName), std::string(password), createGameAccount)) { case AccountOpResult::AOR_OK: handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName); @@ -417,7 +423,11 @@ public: uint8 index = Battlenet::AccountMgr::GetMaxIndex(accountId) + 1; std::string accountName = std::to_string(accountId) + '#' + std::to_string(uint32(index)); - switch (sAccountMgr->CreateAccount(accountName, "DUMMY", bnetAccountName, accountId, index)) + // Generate random hex string for password, these accounts must not be logged on with GRUNT + BigNumber randPassword; + randPassword.SetRand(8 * 16); + + switch (sAccountMgr->CreateAccount(accountName, ByteArrayToHexStr(randPassword.AsByteArray().get(), randPassword.GetNumBytes()), bnetAccountName, accountId, index)) { case AccountOpResult::AOR_OK: handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName.c_str()); -- cgit v1.2.3