aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Accounts
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-09-27 17:07:47 +0200
committerShauren <shauren.trinity@gmail.com>2022-02-28 13:56:45 +0100
commit081fa7cfc4d044d47e719d0a6880d2a9b6d30128 (patch)
tree65281c224b9dd7edb23c7559f40fc43ec1df053d /src/server/game/Accounts
parentc027912a5b3c4a1d6cd5bffaee04e77cb4e02f16 (diff)
Core/Mail: Replaced blocking db query in mail sending with async version
(cherry picked from commit 0a9e239c12ceb1d4a5ef5cdc796320a403b3da2b)
Diffstat (limited to 'src/server/game/Accounts')
-rw-r--r--src/server/game/Accounts/BattlenetAccountMgr.cpp7
-rw-r--r--src/server/game/Accounts/BattlenetAccountMgr.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Accounts/BattlenetAccountMgr.cpp b/src/server/game/Accounts/BattlenetAccountMgr.cpp
index a204e99f337..08a807b8db6 100644
--- a/src/server/game/Accounts/BattlenetAccountMgr.cpp
+++ b/src/server/game/Accounts/BattlenetAccountMgr.cpp
@@ -161,6 +161,13 @@ uint32 Battlenet::AccountMgr::GetIdByGameAccount(uint32 gameAccountId)
return 0;
}
+QueryCallback Battlenet::AccountMgr::GetIdByGameAccountAsync(uint32 gameAccountId)
+{
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT);
+ stmt->setUInt32(0, gameAccountId);
+ return LoginDatabase.AsyncQuery(stmt);
+}
+
uint8 Battlenet::AccountMgr::GetMaxIndex(uint32 accountId)
{
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_MAX_ACCOUNT_INDEX);
diff --git a/src/server/game/Accounts/BattlenetAccountMgr.h b/src/server/game/Accounts/BattlenetAccountMgr.h
index 43c60c5b006..bfeb02302f7 100644
--- a/src/server/game/Accounts/BattlenetAccountMgr.h
+++ b/src/server/game/Accounts/BattlenetAccountMgr.h
@@ -21,6 +21,7 @@
#include "Define.h"
#include <string>
+class QueryCallback;
enum class AccountOpResult : uint8;
#define MAX_BNET_EMAIL_STR 320
@@ -38,6 +39,7 @@ namespace Battlenet
TC_GAME_API uint32 GetId(std::string_view username);
TC_GAME_API bool GetName(uint32 accountId, std::string& name);
TC_GAME_API uint32 GetIdByGameAccount(uint32 gameAccountId);
+ [[nodiscard]] TC_GAME_API QueryCallback GetIdByGameAccountAsync(uint32 gameAccountId);
TC_GAME_API uint8 GetMaxIndex(uint32 accountId);
TC_GAME_API std::string CalculateShaPassHash(std::string_view name, std::string_view password);