本文整理汇总了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);
}
示例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");
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}