@@ -517,39 +517,39 @@ bool AuthSession::HandleLogonProof()
517
517
stmt->setString (3 , _os);
518
518
stmt->setInt16 (4 , _timezoneOffset.count ());
519
519
stmt->setString (5 , _accountInfo.Login );
520
- LoginDatabase.DirectExecute (stmt);
521
-
522
- // Finish SRP6 and send the final result to the client
523
- Trinity::Crypto::SHA1::Digest M2 = Trinity::Crypto::SRP6::GetSessionVerifier (logonProof->A , logonProof->clientM , _sessionKey);
524
-
525
- ByteBuffer packet;
526
- if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
520
+ _queryProcessor.AddCallback (LoginDatabase.AsyncQuery (stmt)
521
+ .WithPreparedCallback ([this , M2 = Trinity::Crypto::SRP6::GetSessionVerifier (logonProof->A , logonProof->clientM , _sessionKey)](PreparedQueryResult const &)
527
522
{
528
- sAuthLogonProof_S proof;
529
- proof.M2 = M2;
530
- proof.cmd = AUTH_LOGON_PROOF;
531
- proof.error = 0 ;
532
- proof.AccountFlags = 0x00800000 ; // 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament)
533
- proof.SurveyId = 0 ;
534
- proof.LoginFlags = 0 ; // 0x1 = has account message
535
-
536
- packet.resize (sizeof (proof));
537
- std::memcpy (packet.contents (), &proof, sizeof (proof));
538
- }
539
- else
540
- {
541
- sAuthLogonProof_S_Old proof;
542
- proof.M2 = M2;
543
- proof.cmd = AUTH_LOGON_PROOF;
544
- proof.error = 0 ;
545
- proof.unk2 = 0x00 ;
546
-
547
- packet.resize (sizeof (proof));
548
- std::memcpy (packet.contents (), &proof, sizeof (proof));
549
- }
523
+ // Finish SRP6 and send the final result to the client
524
+ ByteBuffer packet;
525
+ if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
526
+ {
527
+ sAuthLogonProof_S proof;
528
+ proof.M2 = M2;
529
+ proof.cmd = AUTH_LOGON_PROOF;
530
+ proof.error = 0 ;
531
+ proof.AccountFlags = 0x00800000 ; // 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament)
532
+ proof.SurveyId = 0 ;
533
+ proof.LoginFlags = 0 ; // 0x1 = has account message
534
+
535
+ packet.resize (sizeof (proof));
536
+ std::memcpy (packet.contents (), &proof, sizeof (proof));
537
+ }
538
+ else
539
+ {
540
+ sAuthLogonProof_S_Old proof;
541
+ proof.M2 = M2;
542
+ proof.cmd = AUTH_LOGON_PROOF;
543
+ proof.error = 0 ;
544
+ proof.unk2 = 0x00 ;
545
+
546
+ packet.resize (sizeof (proof));
547
+ std::memcpy (packet.contents (), &proof, sizeof (proof));
548
+ }
550
549
551
- SendPacket (packet);
552
- _status = STATUS_AUTHED;
550
+ SendPacket (packet);
551
+ _status = STATUS_AUTHED;
552
+ }));
553
553
}
554
554
else
555
555
{
0 commit comments