本文整理汇总了C++中RemoveAuction函数的典型用法代码示例。如果您正苦于以下问题:C++ RemoveAuction函数的具体用法?C++ RemoveAuction怎么用?C++ RemoveAuction使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RemoveAuction函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveAuction
void AuctionHouseObject::Update()
{
time_t curTime = sWorld.GetGameTime();
///- Handle expired auctions
AuctionEntryMap::iterator next;
for (AuctionEntryMap::iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); itr = next)
{
next = itr;
++next;
if (itr->second->moneyDeliveryTime)
{
if (curTime > itr->second->moneyDeliveryTime)
{
sAuctionMgr.SendAuctionSuccessfulMail(itr->second);
itr->second->DeleteFromDB();
sAuctionMgr.RemoveAItem(itr->second->itemGuidLow);
delete itr->second;
RemoveAuction(itr->first);
}
}
else
{
if (curTime > itr->second->expireTime)
{
///- Either cancel the auction if there was no bidder
if (itr->second->bidder == 0)
{
sAuctionMgr.SendAuctionExpiredMail(itr->second);
}
///- Or perform the transaction
else
{
itr->second->moneyDeliveryTime = time(NULL) + HOUR;
sAuctionMgr.SendAuctionWonMail(itr->second);
continue;
}
///- In any case clear the auction
itr->second->DeleteFromDB();
sAuctionMgr.RemoveAItem(itr->second->itemGuidLow);
delete itr->second;
RemoveAuction(itr->first);
}
}
}
}
示例2: RemoveAuction
void AuctionHouseObject::Update()
{
time_t curTime = sWorld.GetGameTime();
///- Handle expired auctions
AuctionEntryMap::iterator next;
for (AuctionEntryMap::iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); itr = next)
{
next = itr;
++next;
if (curTime > (itr->second->expireTime))
{
///- Either cancel the auction if there was no bidder
if (itr->second->bidder == 0)
{
sAuctionMgr.SendAuctionExpiredMail(itr->second);
}
///- Or perform the transaction
else
{
//we should send an "item sold" message if the seller is online
//we send the item to the winner
//we send the money to the seller
sAuctionMgr.SendAuctionSuccessfulMail(itr->second);
sAuctionMgr.SendAuctionWonMail(itr->second);
}
///- In any case clear the auction
itr->second->DeleteFromDB();
sAuctionMgr.RemoveAItem(itr->second->itemGuidLow);
delete itr->second;
RemoveAuction(itr->first);
}
}
}
示例3: MANGOS_ASSERT
void AuctionHouseObject::Update()
{
time_t curTime = sWorld.GetGameTime();
///- Handle expired auctions
AuctionEntryMap::iterator next;
for (AuctionEntryMap::iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); itr = next)
{
next = itr;
++next;
if (itr->second->moneyDeliveryTime)
{
if (curTime > itr->second->moneyDeliveryTime)
{
sAuctionMgr.SendAuctionSuccessfulMail(itr->second);
itr->second->DeleteFromDB();
MANGOS_ASSERT(!itr->second->itemGuidLow); // already removed or send in mail at won
delete itr->second;
RemoveAuction(itr->first);
}
}
else
{
if (curTime > itr->second->expireTime)
{
///- perform the transaction if there was bidder
if (itr->second->bid)
itr->second->AuctionBidWinning();
///- cancel the auction if there was no bidder and clear the auction
else
{
sAuctionMgr.SendAuctionExpiredMail(itr->second);
itr->second->DeleteFromDB();
delete itr->second;
RemoveAuction(itr->first);
}
}
}
}
}
示例4: GetAuction
void AuctionHouseObject::Update()
{
time_t curTime = sWorld->GetGameTime();
///- Handle expired auctions
// If storage is empty, no need to update. next == NULL in this case.
if (AuctionsMap.empty())
return;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_BY_TIME);
stmt->setUInt32(0, (uint32)curTime+60);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
return;
do
{
// from auctionhousehandler.cpp, creates auction pointer & player pointer
AuctionEntry* auction = GetAuction(result->Fetch()->GetUInt32());
if (!auction)
continue;
SQLTransaction trans = CharacterDatabase.BeginTransaction();
///- Either cancel the auction if there was no bidder
if (auction->bidder == 0)
{
sAuctionMgr->SendAuctionExpiredMail(auction, trans);
sScriptMgr->OnAuctionExpire(this, auction);
}
///- Or perform the transaction
else
{
//we should send an "item sold" message if the seller is online
//we send the item to the winner
//we send the money to the seller
sAuctionMgr->SendAuctionSuccessfulMail(auction, trans);
sAuctionMgr->SendAuctionWonMail(auction, trans);
sScriptMgr->OnAuctionSuccessful(this, auction);
}
uint32 itemEntry = auction->itemEntry;
///- In any case clear the auction
auction->DeleteFromDB(trans);
CharacterDatabase.CommitTransaction(trans);
sAuctionMgr->RemoveAItem(auction->itemGUIDLow);
RemoveAuction(auction, itemEntry);
}
while (result->NextRow());
}
示例5: assert
void AuctionHouse::UpdateDeletionQueue()
{
removalLock.Acquire();
Auction * auct;
list<Auction*>::iterator it = removalList.begin();
for(; it != removalList.end(); ++it)
{
auct = *it;
assert(auct->Deleted);
RemoveAuction(auct);
}
removalList.clear();
removalLock.Release();
}