当前位置: 首页>>代码示例>>C++>>正文


C++ RemoveAuction函数代码示例

本文整理汇总了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);
            }
        }
    }
}
开发者ID:SparkFan,项目名称:mangos,代码行数:48,代码来源:AuctionHouseMgr.cpp

示例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);
        }
    }
}
开发者ID:cipherCOM,项目名称:mangos,代码行数:34,代码来源:AuctionHouseMgr.cpp

示例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);
                }
            }
        }
    }
}
开发者ID:Tasssadar,项目名称:mangos-arm,代码行数:42,代码来源:AuctionHouseMgr.cpp

示例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());
}
开发者ID:Ayik0,项目名称:DeathCore_5.4.8,代码行数:54,代码来源:AuctionHouseMgr.cpp

示例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();
}
开发者ID:AwkwardDev,项目名称:Descent-core-scripts-3.3.5,代码行数:16,代码来源:AuctionHouse.cpp


注:本文中的RemoveAuction函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。