• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetCheckedAuctionHouseForAuctioneer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetCheckedRadioButton函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCharacterMovement函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap