diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-09-20 02:50:38 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-02-27 20:08:41 +0100 |
commit | 3fd2eb126cbed36292fa5defc024c2b93e8d8671 (patch) | |
tree | 6068f6e874d7552fcf00a92ca75a85381323a038 /src/server/game/Accounts/BattlenetAccountMgr.cpp | |
parent | 7a2c3af98831364988db25dd1bdd8ca10464c641 (diff) |
[3.3.5] ChatCommands, the other half: chat command resolution refactor (PR #25463)
(cherry picked from commit 1eca51b417678b9a48b28552925d5694105f82bb)
Diffstat (limited to 'src/server/game/Accounts/BattlenetAccountMgr.cpp')
-rw-r--r-- | src/server/game/Accounts/BattlenetAccountMgr.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Accounts/BattlenetAccountMgr.cpp b/src/server/game/Accounts/BattlenetAccountMgr.cpp index a726fdf5c7d..a204e99f337 100644 --- a/src/server/game/Accounts/BattlenetAccountMgr.cpp +++ b/src/server/game/Accounts/BattlenetAccountMgr.cpp @@ -90,7 +90,7 @@ bool Battlenet::AccountMgr::CheckPassword(uint32 accountId, std::string password return LoginDatabase.Query(stmt) != nullptr; } -AccountOpResult Battlenet::AccountMgr::LinkWithGameAccount(std::string const& email, std::string const& gameAccountName) +AccountOpResult Battlenet::AccountMgr::LinkWithGameAccount(std::string_view email, std::string_view gameAccountName) { uint32 bnetAccountId = GetId(email); if (!bnetAccountId) @@ -111,7 +111,7 @@ AccountOpResult Battlenet::AccountMgr::LinkWithGameAccount(std::string const& em return AccountOpResult::AOR_OK; } -AccountOpResult Battlenet::AccountMgr::UnlinkGameAccount(std::string const& gameAccountName) +AccountOpResult Battlenet::AccountMgr::UnlinkGameAccount(std::string_view gameAccountName) { uint32 gameAccountId = GameAccountMgr::GetId(gameAccountName); if (!gameAccountId) @@ -128,10 +128,10 @@ AccountOpResult Battlenet::AccountMgr::UnlinkGameAccount(std::string const& game return AccountOpResult::AOR_OK; } -uint32 Battlenet::AccountMgr::GetId(std::string const& username) +uint32 Battlenet::AccountMgr::GetId(std::string_view username) { LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_ID_BY_EMAIL); - stmt->setString(0, username); + stmt->setStringView(0, username); if (PreparedQueryResult result = LoginDatabase.Query(stmt)) return (*result)[0].GetUInt32(); @@ -172,7 +172,7 @@ uint8 Battlenet::AccountMgr::GetMaxIndex(uint32 accountId) return 0; } -std::string Battlenet::AccountMgr::CalculateShaPassHash(std::string const& name, std::string const& password) +std::string Battlenet::AccountMgr::CalculateShaPassHash(std::string_view name, std::string_view password) { Trinity::Crypto::SHA256 email; email.UpdateData(name); |