diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-04-20 20:36:24 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-04-20 20:36:24 +0200 |
commit | aced88b09bd918b0ed17b6c5e8a6048788600d9d (patch) | |
tree | 80f699e135bdb890f12be5db99f49caec9e373cb /src/server/game/Handlers/CharacterHandler.cpp | |
parent | 7ef9acd765feeecb3752359958f717896bcbe37a (diff) |
Core/AuctionHouse: After taking a break at the start of patch 8.3 auction house is now back in business.
Diffstat (limited to 'src/server/game/Handlers/CharacterHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 8a33b26cf8b..355a3078b30 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -20,6 +20,7 @@ #include "ArenaTeam.h" #include "ArenaTeamMgr.h" #include "ArtifactPackets.h" +#include "AuctionHousePackets.h" #include "AuthenticationPackets.h" #include "Battleground.h" #include "BattlegroundPackets.h" @@ -1085,6 +1086,33 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) // Place character in world (and load zone) before some object loading pCurrChar->LoadCorpse(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_CORPSE_LOCATION)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_FAVORITE_AUCTIONS); + stmt->setUInt64(0, pCurrChar->GetGUID().GetCounter()); + GetQueryProcessor().AddCallback(CharacterDatabase.AsyncQuery(stmt)).WithPreparedCallback([this](PreparedQueryResult favoriteAuctionResult) + { + WorldPackets::AuctionHouse::AuctionFavoriteItems favoriteItems; + if (favoriteAuctionResult) + { + favoriteItems.Items.reserve(favoriteAuctionResult->GetRowCount()); + + do + { + Field* fields = favoriteAuctionResult->Fetch(); + + favoriteItems.Items.emplace_back(); + WorldPackets::AuctionHouse::AuctionFavoriteInfo& item = favoriteItems.Items.back(); + item.Order = fields[0].GetUInt32(); + item.ItemID = fields[1].GetUInt32(); + item.ItemLevel = fields[2].GetUInt32(); + item.BattlePetSpeciesID = fields[3].GetUInt32(); + item.SuffixItemNameDescriptionID = fields[4].GetUInt32(); + + } while (favoriteAuctionResult->NextRow()); + + } + SendPacket(favoriteItems.Write()); + }); + // setting Ghost+speed if dead if (pCurrChar->m_deathState != ALIVE) { |