本文整理汇总了C++中AuctionHouseObject::BuildListOwnerItems方法的典型用法代码示例。如果您正苦于以下问题:C++ AuctionHouseObject::BuildListOwnerItems方法的具体用法?C++ AuctionHouseObject::BuildListOwnerItems怎么用?C++ AuctionHouseObject::BuildListOwnerItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuctionHouseObject
的用法示例。
在下文中一共展示了AuctionHouseObject::BuildListOwnerItems方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAuctionListOwnerItems
//this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
{
uint32 listfrom;
uint64 guid;
recv_data >> guid;
recv_data >> listfrom; // not used in fact (this list not have page control in client)
Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!pCreature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
}
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4));
data << (uint32) 0; // amount place holder
uint32 count = 0;
uint32 totalcount = 0;
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
data << (uint32)totalcount;
data << (uint32)300;
SendPacket(&data);
}
示例2: HandleAuctionListOwnerItems
//this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
uint32 listfrom;
ObjectGuid guid;
recvData >> guid;
recvData >> listfrom; // not used in fact (this list not have page control in client)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
TC_LOG_DEBUG("network", "WORLD: HandleAuctionListOwnerItems - %s not found or you can't interact with him.", guid.ToString().c_str());
return;
}
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4));
data << (uint32) 0; // amount place holder
uint32 count = 0;
uint32 totalcount = 0;
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
data << (uint32) totalcount;
data << (uint32) 0;
SendPacket(&data);
}
示例3: HandleAuctionListOwnerItems
// this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPacket& recv_data)
{
DEBUG_LOG("WORLD: HandleAuctionListOwnerItems");
ObjectGuid auctioneerGuid;
uint32 listfrom;
recv_data >> auctioneerGuid;
recv_data >> listfrom; // not used in fact (this list not have page control in client)
AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid);
if (!auctionHouseEntry)
return;
// always return pointer
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(auctionHouseEntry);
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4 + 4));
data << (uint32) 0; // amount place holder
uint32 count = 0;
uint32 totalcount = 0;
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
data << uint32(totalcount);
SendPacket(data);
}
示例4: HandleAuctionListOwnerItems
//this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
uint32 listfrom;
ObjectGuid auctioneer;
recvData >> auctioneer;
recvData >> listfrom; // not used in fact (this list not have page control in client)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
TC_LOG_DEBUG("network", "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
return;
}
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
uint32 count = 0;
uint32 totalcount = 0;
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, 500); // guess size
data << uint32(0); // amount place holder
data << uint32(AUCTION_SEARCH_DELAY);
data << uint32(totalcount);
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
SendPacket(&data);
}
示例5: HandleAuctionListOwnerItems
//this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
uint32 listfrom;
ObjectGuid guid;
recvData >> listfrom;
guid[5] = recvData.ReadBit();
guid[7] = recvData.ReadBit();
guid[3] = recvData.ReadBit();
guid[0] = recvData.ReadBit();
guid[2] = recvData.ReadBit();
guid[6] = recvData.ReadBit();
guid[1] = recvData.ReadBit();
guid[4] = recvData.ReadBit();
recvData.ReadByteSeq(guid[4]);
recvData.ReadByteSeq(guid[3]);
recvData.ReadByteSeq(guid[5]);
recvData.ReadByteSeq(guid[7]);
recvData.ReadByteSeq(guid[6]);
recvData.ReadByteSeq(guid[0]);
recvData.ReadByteSeq(guid[2]);
recvData.ReadByteSeq(guid[1]);
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
}
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4));
data << uint32(0); // amount place holder
uint32 count = 0;
uint32 totalcount = 0;
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
data << uint32(totalcount);
data << uint32(0);
SendPacket(&data);
}
示例6: HandleAuctionListPendingSales
void WorldSession::HandleAuctionListPendingSales(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES");
recvData.read_skip<uint64>();
WorldPacket data(SMSG_AUCTION_LIST_PENDING_SALES, 4);
data << uint32(0); // amount place holder
uint32 count = 0;
uint32 totalcount = 0;
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(GetPlayer()->getFaction());
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
data << uint32(totalcount);
data << uint32(0);
//SendPacket(&data); NEED TO FIND THE CORRECT VALUES TO SEND (HAS TO BE SOMETHING DIFFERENT THAN THE OWNER OPCODE) ...
}
示例7: HandleAuctionListOwnerItems
//this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
uint32 listfrom;
ObjectGuid guid;
recvData >> listfrom; // not used in fact (this list not have page control in client)
uint8 bitOrder[8] = { 6, 0, 7, 2, 3, 1, 5, 4 };
recvData.ReadBitInOrder(guid, bitOrder);
recvData.FlushBits();
uint8 byteOrder[8] = { 2, 5, 6, 4, 3, 7, 1, 0 };
recvData.ReadBytesSeq(guid, byteOrder);
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
}
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4 + 4 + 4));
data << uint32(0); // amount place holder
uint32 count = 0;
uint32 totalcount = 0;
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
data << uint32(totalcount);
data << uint32(0);
SendPacket(&data);
}
示例8: HandleAuctionListOwnerItems
//this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPackets::AuctionHouse::AuctionListOwnerItems& packet)
{
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(packet.Auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
TC_LOG_DEBUG("network", "WORLD: HandleAuctionListOwnerItems - %s not found or you can't interact with him.", packet.Auctioneer.ToString().c_str());
return;
}
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
WorldPackets::AuctionHouse::AuctionListOwnerItemsResult result;
auctionHouse->BuildListOwnerItems(result, _player, result.TotalCount);
result.DesiredDelay = 300;
SendPacket(result.Write());
}
示例9: HandleAuctionSellItem
//.........这里部分代码省略.........
AH->itemEntry = item->GetEntry();
AH->itemCount = item->GetCount();
AH->owner = _player->GetGUIDLow();
AH->startbid = bid;
AH->bidder = 0;
AH->bid = 0;
AH->buyout = buyout;
AH->expire_time = time(NULL) + auctionTime;
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
sAuctionMgr->AddAItem(item);
auctionHouse->AddAuction(AH);
_player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
item->DeleteFromInventoryDB(trans);
item->SaveToDB(trans);
AH->SaveToDB(trans);
_player->SaveInventoryAndGoldToDB(trans);
CharacterDatabase.CommitTransaction(trans);
SendAuctionCommandResult(AH, AUCTION_SELL_ITEM, ERR_AUCTION_OK);
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT);
data << uint32(0); // amount place holder
uint32 count = 0;
uint32 totalcount = 0;
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
data << uint32(totalcount);
data << uint32(0);
SendPacket(&data);
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
return;
}
else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size
{
Item* newItem = item->CloneItem(finalCount, _player);
if (!newItem)
{
sLog->outError(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
SendAuctionCommandResult(NULL, AUCTION_SELL_ITEM, 0, ERR_AUCTION_DATABASE_ERROR);
return;
}
if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
{
sLog->outCommand(GetAccountId(), "", GetPlayer()->GetGUIDLow(), GetPlayer()->GetName(), 0, "", 0, "",
"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount());
}
AH->itemGUIDLow = newItem->GetGUIDLow();
AH->itemEntry = newItem->GetEntry();
AH->itemCount = newItem->GetCount();
AH->owner = _player->GetGUIDLow();
AH->startbid = bid;
AH->bidder = 0;
示例10: HandleAuctionRemoveItem
//this void is called when auction_owner cancels his auction
void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_REMOVE_ITEM");
ObjectGuid auctioneer;
uint32 auctionId;
recvData >> auctionId;
auctioneer[1] = recvData.ReadBit();
auctioneer[5] = recvData.ReadBit();
auctioneer[4] = recvData.ReadBit();
auctioneer[2] = recvData.ReadBit();
auctioneer[7] = recvData.ReadBit();
auctioneer[6] = recvData.ReadBit();
auctioneer[0] = recvData.ReadBit();
auctioneer[3] = recvData.ReadBit();
recvData.ReadByteSeq(auctioneer[3]);
recvData.ReadByteSeq(auctioneer[5]);
recvData.ReadByteSeq(auctioneer[2]);
recvData.ReadByteSeq(auctioneer[7]);
recvData.ReadByteSeq(auctioneer[1]);
recvData.ReadByteSeq(auctioneer[0]);
recvData.ReadByteSeq(auctioneer[6]);
recvData.ReadByteSeq(auctioneer[4]);
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
return;
}
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
Player* player = GetPlayer();
SQLTransaction trans = CharacterDatabase.BeginTransaction();
if (auction && auction->owner == player->GetGUIDLow())
{
Item* pItem = sAuctionMgr->GetAItem(auction->itemGUIDLow);
if (pItem)
{
if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid
{
uint32 auctionCut = auction->GetAuctionCut();
if (!player->HasEnoughMoney((uint64)auctionCut)) //player doesn't have enough money, maybe message needed
return;
sAuctionMgr->SendAuctionCancelledToBidderMail(auction, trans, pItem);
player->ModifyMoney(-int64(auctionCut));
}
// item will deleted or added to received mail list
MailDraft(auction->BuildAuctionMailSubject(AUCTION_CANCELED), AuctionEntry::BuildAuctionMailBody(0, 0, auction->buyout, auction->deposit, 0))
.AddItem(pItem)
.SendMailTo(trans, player, auction, MAIL_CHECK_MASK_COPIED);
}
else
{
sLog->outError(LOG_FILTER_NETWORKIO, "Auction id: %u got non existing item (item guid : %u)!", auction->Id, auction->itemGUIDLow);
SendAuctionCommandResult(NULL, AUCTION_CANCEL, ERR_AUCTION_DATABASE_ERROR);
return;
}
}
else
{
SendAuctionCommandResult(NULL, AUCTION_CANCEL, ERR_AUCTION_DATABASE_ERROR);
//this code isn't possible ... maybe there should be assert
sLog->outError(LOG_FILTER_NETWORKIO, "CHEATER: %u tried to cancel auction (id: %u) of another player or auction is NULL", player->GetGUIDLow(), auctionId);
return;
}
//inform player, that auction is removed
SendAuctionCommandResult(auction, AUCTION_CANCEL, ERR_AUCTION_OK);
// Now remove the auction
player->SaveInventoryAndGoldToDB(trans);
auction->DeleteFromDB(trans);
CharacterDatabase.CommitTransaction(trans);
uint32 itemEntry = auction->itemEntry;
sAuctionMgr->RemoveAItem(auction->itemGUIDLow);
auctionHouse->RemoveAuction(auction, itemEntry);
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4));
data << uint32(0); // amount place holder
uint32 count = 0;
uint32 totalcount = 0;
auctionHouse->BuildListOwnerItems(data, _player, count, totalcount);
data.put<uint32>(0, count);
data << uint32(totalcount);
data << uint32(0);
//.........这里部分代码省略.........