diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-01-03 13:04:19 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2025-01-03 18:05:04 +0100 |
commit | 5da556b9a4094da461a4c88249fb0359172d72d2 (patch) | |
tree | a18f013ee77e9f2bb9397c63d240cc4e49b12f6e /src/server/game/Accounts/AccountMgr.cpp | |
parent | a7587de5ede4da43cdc87a98322e2002093985bf (diff) |
Core/Database: Added std::span based functions to Field and PreparedStatement
(cherry picked from commit 27860c3316b7354c6bf17cac82992085d2905934)
# Conflicts:
# src/server/game/Entities/Player/Player.cpp
Diffstat (limited to 'src/server/game/Accounts/AccountMgr.cpp')
-rw-r--r-- | src/server/game/Accounts/AccountMgr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 2055bf437c6..c0297cafb7e 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -63,7 +63,7 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass stmt->setString(0, username); auto [salt, verifier] = Trinity::Crypto::SRP6::MakeRegistrationData<AccountSRP6>(username, password); stmt->setBinary(1, salt); - stmt->setBinary(2, verifier); + stmt->setBinary(2, std::move(verifier)); stmt->setString(3, email); stmt->setString(4, email); @@ -188,7 +188,7 @@ AccountOpResult AccountMgr::ChangeUsername(uint32 accountId, std::string newUser auto [salt, verifier] = Trinity::Crypto::SRP6::MakeRegistrationData<AccountSRP6>(newUsername, newPassword); stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGON); stmt->setBinary(0, salt); - stmt->setBinary(1, verifier); + stmt->setBinary(1, std::move(verifier)); stmt->setUInt32(2, accountId); LoginDatabase.Execute(stmt); @@ -217,7 +217,7 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGON); stmt->setBinary(0, salt); - stmt->setBinary(1, verifier); + stmt->setBinary(1, std::move(verifier)); stmt->setUInt32(2, accountId); LoginDatabase.Execute(stmt); @@ -288,7 +288,7 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai uint32 AccountMgr::GetId(std::string_view username) { LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ID_BY_USERNAME); - stmt->setStringView(0, username); + stmt->setString(0, username); PreparedQueryResult result = LoginDatabase.Query(stmt); return (result) ? (*result)[0].GetUInt32() : 0; |