From 141ada19b00fb9d0dd1a260d86d97bbb709a0f5e Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Sat, 30 May 2020 15:43:54 +0000 Subject: Cherry pick some db commits (#24713) * Core/DBLayer: Implement async transaction completion callbacks (cherry picked from commit 0f0ca3a9194d76afa0227943e86469ad8368c5e2) # Conflicts: # src/server/bnetserver/REST/LoginRESTService.cpp # src/server/bnetserver/Server/Session.cpp # src/server/bnetserver/Server/Session.h # src/server/database/Database/Transaction.cpp # src/server/game/Handlers/CharacterHandler.cpp # src/server/game/Handlers/SpellHandler.cpp # src/server/game/Server/WorldSession.cpp # src/server/game/Server/WorldSocket.cpp # src/server/game/Server/WorldSocket.h * Core/Misc: Fixed char enum packet sometimes not showing newly created character when client latency is too low (cherry picked from commit fc9d2e728e5c21bd2a1645a29be60d0e280ad940) # Conflicts: # src/server/game/Handlers/CharacterHandler.cpp * Fix no-pch build * Core/Player: Wait for correct transaction on character creation (cherry picked from commit 01c68b2aa2ed25ea9b4c007f238a0e958f6525b1) # Conflicts: # src/server/game/Entities/Player/Player.cpp * Fix warning * Remove unused login transaction Co-authored-by: Shauren --- src/server/authserver/Server/AuthSession.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/server/authserver/Server/AuthSession.cpp') diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp index 0cf0f83d346..60167564f35 100644 --- a/src/server/authserver/Server/AuthSession.cpp +++ b/src/server/authserver/Server/AuthSession.cpp @@ -175,7 +175,7 @@ void AuthSession::Start() LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO); stmt->setString(0, ip_address); - _queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::CheckIpCallback, this, std::placeholders::_1))); + _queryProcessor.AddCallback(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::CheckIpCallback, this, std::placeholders::_1))); } bool AuthSession::Update() @@ -183,7 +183,7 @@ bool AuthSession::Update() if (!AuthSocket::Update()) return false; - _queryProcessor.ProcessReadyQueries(); + _queryProcessor.ProcessReadyCallbacks(); return true; } @@ -308,7 +308,7 @@ bool AuthSession::HandleLogonChallenge() LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGONCHALLENGE); stmt->setString(0, login); - _queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::LogonChallengeCallback, this, std::placeholders::_1))); + _queryProcessor.AddCallback(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::LogonChallengeCallback, this, std::placeholders::_1))); return true; } @@ -736,7 +736,7 @@ bool AuthSession::HandleReconnectChallenge() LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RECONNECTCHALLENGE); stmt->setString(0, login); - _queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::ReconnectChallengeCallback, this, std::placeholders::_1))); + _queryProcessor.AddCallback(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::ReconnectChallengeCallback, this, std::placeholders::_1))); return true; } @@ -820,7 +820,7 @@ bool AuthSession::HandleRealmList() LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALM_CHARACTER_COUNTS); stmt->setUInt32(0, _accountInfo.Id); - _queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::RealmListCallback, this, std::placeholders::_1))); + _queryProcessor.AddCallback(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::RealmListCallback, this, std::placeholders::_1))); _status = STATUS_WAITING_FOR_REALM_LIST; return true; } -- cgit v1.2.3