From 31c987ad8a585be66223b867171240d91ff1b519 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 13 Jun 2014 17:56:44 +0200 Subject: Core/Battle.net: Fixed scripts linking by adding a completely unrelated function to a completely unrelated file in game project --- src/server/game/Accounts/BattlenetAccountMgr.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/server/game/Accounts/BattlenetAccountMgr.cpp') diff --git a/src/server/game/Accounts/BattlenetAccountMgr.cpp b/src/server/game/Accounts/BattlenetAccountMgr.cpp index 4f4d78591f9..ca05ffd6141 100644 --- a/src/server/game/Accounts/BattlenetAccountMgr.cpp +++ b/src/server/game/Accounts/BattlenetAccountMgr.cpp @@ -118,3 +118,26 @@ std::string Battlenet::AccountMgr::CalculateShaPassHash(std::string const& name, return ByteArrayToHexStr(sha.GetDigest(), sha.GetLength(), true); } + +bool Battlenet::AccountMgr::GetAccountIdAndIndex(std::string const& account, uint32* battlenetAccountId, uint8* battlenetAccountIndex) +{ + Tokenizer tokens(account, '#'); + if (tokens.size() != 2) + return false; + + if (!battlenetAccountId) + return false; + + *battlenetAccountId = atol(tokens[0]); + if (!*battlenetAccountId) + return false; + + if (battlenetAccountIndex) + { + *battlenetAccountIndex = atol(tokens[1]); + if (!*battlenetAccountIndex) + return false; + } + + return true; +} -- cgit v1.2.3