當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetCheckedAuctionHouseForAuctioneer函數代碼示例

本文整理匯總了C++中GetCheckedAuctionHouseForAuctioneer函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetCheckedAuctionHouseForAuctioneer函數的具體用法?C++ GetCheckedAuctionHouseForAuctioneer怎麽用?C++ GetCheckedAuctionHouseForAuctioneer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetCheckedAuctionHouseForAuctioneer函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: DEBUG_LOG

void WorldSession::HandleAuctionListPendingSales( WorldPacket & recv_data )
{
    DEBUG_LOG("CMSG_AUCTION_LIST_PENDING_SALES");

    ObjectGuid auctioneerGuid;

    recv_data >> auctioneerGuid;                            // auctioneer guid

    AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid);
    if (!auctionHouseEntry)
        return;

    uint32 count = 0;

    WorldPacket data(SMSG_AUCTION_LIST_PENDING_SALES, 4);
    data << uint32(count);                                  // count
    /*for(uint32 i = 0; i < count; ++i)
    {
        data << "";                                         // string
        data << "";                                         // string
        data << uint32(0);
        data << uint32(0);
        data << float(0);
    }*/
    SendPacket(&data);
}
開發者ID:Warlord123,項目名稱:mangos-current,代碼行數:26,代碼來源:AuctionHouseHandler.cpp

示例2: DEBUG_LOG

void WorldSession::HandleAuctionListPendingSales(WorldPacket& recv_data)
{
    DEBUG_LOG("WORLD: CMSG_AUCTION_LIST_PENDING_SALES");

    ObjectGuid auctioneerGuid;

    recv_data >> auctioneerGuid;                            // auctioneer guid

    AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid);
    if (!auctionHouseEntry)
        return;

    uint32 count = 0;

    WorldPacket data(SMSG_AUCTION_LIST_PENDING_SALES, 4);
    data << uint32(count);                                  // count

    // pending list include all auction house entries for character
    for (int i = 0; i < MAX_AUCTION_HOUSE_TYPE; ++i)
        sAuctionMgr.GetAuctionsMap(AuctionHouseType(i))->BuildListPendingSales(data, _player, count);

    data.put<uint32>(0, count);
    SendPacket(&data);
    DEBUG_LOG("WORLD: Sent SMSG_AUCTION_LIST_PENDING_SALES");
}
開發者ID:Jojo2323,項目名稱:mangos3,代碼行數:25,代碼來源:AuctionHouseHandler.cpp

示例3: DEBUG_LOG

// this void is called when player clicks on search button
void WorldSession::HandleAuctionListItems(WorldPacket& recv_data)
{
    DEBUG_LOG("WORLD: HandleAuctionListItems");

    ObjectGuid auctioneerGuid;
    std::string searchedname;
    uint8 levelmin, levelmax, usable;
    uint32 listfrom, auctionSlotID, auctionMainCategory, auctionSubCategory, quality;

    recv_data >> auctioneerGuid;
    recv_data >> listfrom;                                  // start, used for page control listing by 50 elements
    recv_data >> searchedname;

    recv_data >> levelmin >> levelmax;
    recv_data >> auctionSlotID >> auctionMainCategory >> auctionSubCategory >> quality;
    recv_data >> usable;

    AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid);
    if (!auctionHouseEntry)
        return;

    // always return pointer
    AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(auctionHouseEntry);

    // DEBUG_LOG("Auctionhouse search %s list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
    //  auctioneerGuid.GetString().c_str(), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);

    WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4 + 4));
    uint32 count = 0;
    uint32 totalcount = 0;
    data << uint32(0);

    // converting string that we try to find to lower case
    std::wstring wsearchedname;
    if (!Utf8toWStr(searchedname, wsearchedname))
        return;

    wstrToLower(wsearchedname);

    auctionHouse->BuildListAuctionItems(data, _player,
                                        wsearchedname, listfrom, levelmin, levelmax, usable,
                                        auctionSlotID, auctionMainCategory, auctionSubCategory, quality,
                                        count, totalcount);

    data.put<uint32>(0, count);
    data << uint32(totalcount);
    SendPacket(data);
}
開發者ID:killerwife,項目名稱:mangos-classic,代碼行數:49,代碼來源:AuctionHouseHandler.cpp

示例4: DEBUG_LOG

void WorldSession::HandleAuctionListPendingSales( WorldPacket & recv_data )
{
    DEBUG_LOG("CMSG_AUCTION_LIST_PENDING_SALES");

    ObjectGuid auctioneerGuid;

    recv_data >> auctioneerGuid;                            // auctioneer guid

    AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid);
    if (!auctionHouseEntry)
        return;

    // always return pointer
    AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(auctionHouseEntry);

    uint32 count = 0;

    WorldPacket data(SMSG_AUCTION_LIST_PENDING_SALES, 4);
    data << uint32(count);                                  // count
    auctionHouse->BuildListPendingSales(data, _player, count);
    data.put<uint32>(0, count);
    SendPacket(&data);
}
開發者ID:xiaojie,項目名稱:mangos,代碼行數:23,代碼來源:AuctionHouseHandler.cpp

示例5: DEBUG_LOG

// this void is called when auction_owner cancels his auction
void WorldSession::HandleAuctionRemoveItem(WorldPacket& recv_data)
{
    DEBUG_LOG("WORLD: HandleAuctionRemoveItem");

    ObjectGuid auctioneerGuid;
    uint32 auctionId;
    recv_data >> auctioneerGuid;
    recv_data >> auctionId;
    // DEBUG_LOG("Cancel AUCTION AuctionID: %u", auctionId);

    AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid);
    if (!auctionHouseEntry)
        return;

    // always return pointer
    AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(auctionHouseEntry);

    // remove fake death
    if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
        GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);

    AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
    Player* pl = GetPlayer();

    if (!auction || auction->owner != pl->GetGUIDLow())
    {
        SendAuctionCommandResult(NULL, AUCTION_REMOVED, AUCTION_ERR_DATABASE);
        sLog.outError("CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", pl->GetGUIDLow(), auctionId);
        return;
    }

    Item* pItem = sAuctionMgr.GetAItem(auction->itemGuidLow);
    if (!pItem)
    {
        sLog.outError("Auction id: %u has nonexistent item (item guid : %u)!!!", auction->Id, auction->itemGuidLow);
        SendAuctionCommandResult(NULL, AUCTION_REMOVED, AUCTION_ERR_INVENTORY, EQUIP_ERR_ITEM_NOT_FOUND);
        return;
    }

    if (auction->bid)                                       // If we have a bid, we have to send him the money he paid
    {
        uint32 auctionCut = auction->GetAuctionCut();
        if (pl->GetMoney() < auctionCut)                    // player doesn't have enough money, maybe message needed
            return;

        if (auction->bidder)                                // if auction have real existed bidder send mail
            SendAuctionCancelledToBidderMail(auction);

        pl->ModifyMoney(-int32(auctionCut));
    }
    // Return the item by mail
    std::ostringstream msgAuctionCanceledOwner;
    msgAuctionCanceledOwner << auction->itemTemplate << ":" << auction->itemRandomPropertyId << ":" << AUCTION_CANCELED;

    // item will deleted or added to received mail list
    MailDraft(msgAuctionCanceledOwner.str())
    .AddItem(pItem)
    .SendMailTo(pl, auction, MAIL_CHECK_MASK_COPIED);

    // inform player, that auction is removed
    SendAuctionCommandResult(auction, AUCTION_REMOVED, AUCTION_OK);
    // Now remove the auction
    CharacterDatabase.BeginTransaction();
    auction->DeleteFromDB();
    pl->SaveInventoryAndGoldToDB();
    CharacterDatabase.CommitTransaction();
    sAuctionMgr.RemoveAItem(auction->itemGuidLow);
    // used by eluna
    sHookMgr->OnRemove(auctionHouse);
    auctionHouse->RemoveAuction(auction->Id);
    delete auction;
}
開發者ID:monstermosh,項目名稱:ZeroServer,代碼行數:73,代碼來源:AuctionHouseHandler.cpp

示例6: DEBUG_LOG

// this void is called when player clicks on search button
void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
{
    DEBUG_LOG("WORLD: HandleAuctionListItems");

    ObjectGuid auctioneerGuid;
    std::string searchedname;
    uint8 levelmin, levelmax, usable, isFull, sortCount;
    uint32 listfrom, auctionSlotID, auctionMainCategory, auctionSubCategory, quality;

    recv_data >> auctioneerGuid;
    recv_data >> listfrom;                                  // start, used for page control listing by 50 elements
    recv_data >> searchedname;

    recv_data >> levelmin >> levelmax;
    recv_data >> auctionSlotID >> auctionMainCategory >> auctionSubCategory >> quality;
    recv_data >> usable >> isFull >> sortCount;

    if (sortCount >= MAX_AUCTION_SORT)
        return;

    uint8 Sort[MAX_AUCTION_SORT];
    memset(Sort, MAX_AUCTION_SORT, MAX_AUCTION_SORT);

    // auction columns sorting
    for (uint32 i = 0; i < sortCount; ++i)
    {
        uint8 column, reversed;
        recv_data >> column;

        if (column >= MAX_AUCTION_SORT)
            return;

        recv_data >> reversed;
        Sort[i] = (reversed > 0) ? (column |= AUCTION_SORT_REVERSED) : column;
    }

    AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid);
    if (!auctionHouseEntry)
        return;

    // always return pointer
    AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(auctionHouseEntry);

    // Sort
    AuctionHouseObject::AuctionEntryMap const& aucs = auctionHouse->GetAuctions();
    std::vector<AuctionEntry*> auctions;
    auctions.reserve(aucs.size());

    for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = aucs.begin(); itr != aucs.end(); ++itr)
        auctions.push_back(itr->second);

    AuctionSorter sorter(Sort, GetPlayer());
    std::sort(auctions.begin(), auctions.end(), sorter);

    // remove fake death
    if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
        GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);

    //DEBUG_LOG("Auctionhouse search %s list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
    //  auctioneerGuid.GetString().c_str(), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);

    WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4+4+4));
    uint32 count = 0;
    uint32 totalcount = 0;
    data << uint32(0);

    // converting string that we try to find to lower case
    std::wstring wsearchedname;
    if (!Utf8toWStr(searchedname, wsearchedname))
        return;

    wstrToLower(wsearchedname);

    BuildListAuctionItems(auctions, data, wsearchedname, listfrom, levelmin, levelmax, usable,
        auctionSlotID, auctionMainCategory, auctionSubCategory, quality, count, totalcount, isFull);

    data.put<uint32>(0, count);
    data << uint32(totalcount);
    data << uint32(300);                                    // 2.3.0 delay for next isFull request?
    SendPacket(&data);
}
開發者ID:AngelX,項目名稱:mangos,代碼行數:82,代碼來源:AuctionHouseHandler.cpp


注:本文中的GetCheckedAuctionHouseForAuctioneer函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。