mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Auction: wrap item deletions from AHBot auction on a transaction
This speeds up the query execution time tremendously Refs #19182
This commit is contained in:
@@ -182,7 +182,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
else
|
||||
{
|
||||
// bidder doesn't exist, delete the item
|
||||
sAuctionMgr->RemoveAItem(auction->itemGUIDLow, true);
|
||||
sAuctionMgr->RemoveAItem(auction->itemGUIDLow, true, &trans);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti
|
||||
else
|
||||
{
|
||||
// owner doesn't exist, delete the item
|
||||
sAuctionMgr->RemoveAItem(auction->itemGUIDLow, true);
|
||||
sAuctionMgr->RemoveAItem(auction->itemGUIDLow, true, &trans);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ void AuctionHouseMgr::AddAItem(Item* it)
|
||||
mAitems[it->GetGUID().GetCounter()] = it;
|
||||
}
|
||||
|
||||
bool AuctionHouseMgr::RemoveAItem(ObjectGuid::LowType id, bool deleteItem)
|
||||
bool AuctionHouseMgr::RemoveAItem(ObjectGuid::LowType id, bool deleteItem /*= false*/, SQLTransaction* trans /*= nullptr*/)
|
||||
{
|
||||
ItemMap::iterator i = mAitems.find(id);
|
||||
if (i == mAitems.end())
|
||||
@@ -400,9 +400,9 @@ bool AuctionHouseMgr::RemoveAItem(ObjectGuid::LowType id, bool deleteItem)
|
||||
|
||||
if (deleteItem)
|
||||
{
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ASSERT(trans);
|
||||
i->second->FSetState(ITEM_REMOVED);
|
||||
i->second->SaveToDB(trans);
|
||||
i->second->SaveToDB(*trans);
|
||||
}
|
||||
|
||||
mAitems.erase(i);
|
||||
|
||||
@@ -190,7 +190,7 @@ class TC_GAME_API AuctionHouseMgr
|
||||
void LoadAuctions();
|
||||
|
||||
void AddAItem(Item* it);
|
||||
bool RemoveAItem(ObjectGuid::LowType id, bool deleteItem = false);
|
||||
bool RemoveAItem(ObjectGuid::LowType id, bool deleteItem = false, SQLTransaction* trans = nullptr);
|
||||
bool PendingAuctionAdd(Player* player, AuctionEntry* aEntry, Item* item);
|
||||
uint32 PendingAuctionCount(const Player* player) const;
|
||||
void PendingAuctionProcess(Player* player);
|
||||
|
||||
Reference in New Issue
Block a user