aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Accounts/BattlenetAccountMgr.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-06-13 17:56:44 +0200
committerShauren <shauren.trinity@gmail.com>2014-06-13 17:56:44 +0200
commit31c987ad8a585be66223b867171240d91ff1b519 (patch)
tree4639bf54c2311dbf926c584a096940139f9a0314 /src/server/game/Accounts/BattlenetAccountMgr.cpp
parent3b940a27664555dada92f0f01927c7da8f1d51aa (diff)
Core/Battle.net: Fixed scripts linking by adding a completely unrelated function to a completely unrelated file in game project
Diffstat (limited to 'src/server/game/Accounts/BattlenetAccountMgr.cpp')
-rw-r--r--src/server/game/Accounts/BattlenetAccountMgr.cpp23
1 files changed, 23 insertions, 0 deletions
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;
+}