本文整理匯總了C++中GetAuctionOutBid函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetAuctionOutBid函數的具體用法?C++ GetAuctionOutBid怎麽用?C++ GetAuctionOutBid使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetAuctionOutBid函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: uint32
// this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
{
Item *pItem = sAuctionMgr.GetAItem(itemGuidLow);
if (!pItem)
{
sLog.outError("auction to item, that doesn't exist !!!!");
return false;
}
data << uint32(Id);
data << uint32(pItem->GetEntry());
for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; ++i)
{
data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(i)));
data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i)));
data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i)));
}
data << uint32(pItem->GetItemRandomPropertyId()); // random item property id
data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor
data << uint32(pItem->GetCount()); // item->count
data << uint32(pItem->GetSpellCharges()); // item->charge FFFFFFF
data << uint32(0); // item flags (dynamic?) (0x04 no lockId?)
data << ObjectGuid(HIGHGUID_PLAYER, owner); // Auction->owner
data << uint32(startbid); // Auction->startbid (not sure if useful)
data << uint32(bid ? GetAuctionOutBid() : 0); // minimal outbid
data << uint32(buyout); // auction->buyout
data << uint32((expireTime-time(NULL))*IN_MILLISECONDS);// time left
data << ObjectGuid(HIGHGUID_PLAYER, bidder); // auction->bidder current
data << uint32(bid); // current bid
return true;
}
示例2: uint32
//this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
{
Item *pItem = sAuctionMgr.GetAItem(item_guidlow);
if (!pItem)
{
sLog.outError("auction to item, that doesn't exist !!!!");
return false;
}
data << uint32(Id);
data << uint32(pItem->GetEntry());
// [-ZERO] no other infos about enchantment in 1.12 [?]
//for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; ++i)
//{
data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(PERM_ENCHANTMENT_SLOT)));
// data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i)));
// data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i)));
//}
data << uint32(pItem->GetItemRandomPropertyId()); //random item property id
data << uint32(pItem->GetItemSuffixFactor()); //SuffixFactor
data << uint32(pItem->GetCount()); //item->count
data << uint32(pItem->GetSpellCharges()); //item->charge FFFFFFF
data << uint64(owner); //Auction->owner
data << uint32(startbid); //Auction->startbid (not sure if useful)
data << uint32(bid ? GetAuctionOutBid() : 0);
//minimal outbid
data << uint32(buyout); //auction->buyout
data << uint32((expire_time-time(NULL))*IN_MILISECONDS);//time left
data << uint64(bidder) ; //auction->bidder current
data << uint32(bid); //current bid
return true;
}
示例3: uint32
//this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
{
Item* item = sAuctionMgr->GetAItem(item_guidlow);
if (!item)
{
sLog->outError("AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow);
return false;
}
data << uint32(Id);
data << uint32(item->GetEntry());
for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; ++i)
{
data << uint32(item->GetEnchantmentId(EnchantmentSlot(i)));
data << uint32(item->GetEnchantmentDuration(EnchantmentSlot(i)));
data << uint32(item->GetEnchantmentCharges(EnchantmentSlot(i)));
}
data << int32(item->GetItemRandomPropertyId()); //random item property id
data << uint32(item->GetItemSuffixFactor()); //SuffixFactor
data << uint32(item->GetCount()); //item->count
data << uint32(item->GetSpellCharges()); //item->charge FFFFFFF
data << uint32(0); //Unknown
data << uint64(owner); //Auction->owner
data << uint64(startbid); //Auction->startbid (not sure if useful)
data << uint64(bid ? GetAuctionOutBid() : 0);
//minimal outbid
data << uint64(buyout); //auction->buyout
data << uint32((expire_time-time(NULL)) * IN_MILLISECONDS);//time left
data << uint64(bidder); //auction->bidder current
data << uint64(bid); //current bid
return true;
}
示例4: uint32
bool Auction::BuildAuctionInfo(WorldPacket& data)
{
if (!pItem)
{
Log.Error("AuctionHouse", "AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, pItem->GetEntry());
return false;
}
data << uint32(Id);
data << uint32(pItem->GetEntry());
for (uint8 i = 0; i < PROP_ENCHANTMENT_SLOT_0; ++i) // PROP_ENCHANTMENT_SLOT_0 = 10
{
data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(i)));
data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i)));
data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i)));
}
data << int32(pItem->GetItemRandomPropertyId()); // Random item property id
data << uint32(pItem->GetItemRandomSuffixFactor()); // SuffixFactor
data << uint32(pItem->GetStackCount()); // item->count
data << uint32(pItem->GetChargesLeft()); // item->charge FFFFFFF
data << uint32(0); // Unknown
data << uint64(Owner); // Auction->owner
data << uint64(StartingPrice); // Auction->startbid (not sure if useful)
data << uint64(HighestBid ? GetAuctionOutBid() : 0);
// Minimal outbid
data << uint64(BuyoutPrice); // Auction->buyout
data << uint32((ExpiryTime - time(NULL)) * IN_MILLISECONDS); // time left
data << uint64(HighestBidder); // auction->bidder current
data << uint64(HighestBid); // current bid
return true;
}
示例5: uint32
//this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
{
Item* item = sAuctionMgr->GetAItem(itemGUIDLow);
if (!item)
{
sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, itemGUIDLow);
return false;
}
data << uint32(Id);
data << uint32(item->GetEntry());
for (uint8 i = 0; i < PROP_ENCHANTMENT_SLOT_0; ++i) // PROP_ENCHANTMENT_SLOT_0 = 8
{
data << uint32(item->GetEnchantmentId(EnchantmentSlot(i)));
data << uint32(item->GetEnchantmentDuration(EnchantmentSlot(i)));
data << uint32(item->GetEnchantmentCharges(EnchantmentSlot(i)));
}
data << uint32(0);
data << int32(item->GetItemRandomPropertyId()); // Random item property id
data << uint32(item->GetItemSuffixFactor()); // SuffixFactor
data << uint32(item->GetCount()); // item->count
data << uint32(item->GetSpellCharges()); // item->charge FFFFFFF
data << uint32(0); // Unk
data << uint64(MAKE_NEW_GUID(owner, 0, HIGHGUID_PLAYER)); // Auction->owner
data << uint64(startbid); // Auction->startbid (not sure if useful)
data << uint64(bid ? GetAuctionOutBid() : 0);
// Minimal outbid
data << uint64(buyout); // Auction->buyout
data << uint32((expire_time - time(NULL)) * IN_MILLISECONDS); // time left
data << uint64(MAKE_NEW_GUID(bidder, 0, HIGHGUID_PLAYER)); // auction->bidder current
data << uint64(bid); // current bid
return true;
}
示例6: GetAuctionOutBid
//this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
{
Item *pItem = auctionmgr.GetAItem(item_guidlow);
if (!pItem)
{
sLog.outError("auction to item, that doesn't exist !!!!");
return false;
}
data << (uint32) Id;
data << (uint32) pItem->GetEntry();
for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; i++)
{
data << (uint32) pItem->GetEnchantmentId(EnchantmentSlot(i));
data << (uint32) pItem->GetEnchantmentDuration(EnchantmentSlot(i));
data << (uint32) pItem->GetEnchantmentCharges(EnchantmentSlot(i));
}
data << (uint32) pItem->GetItemRandomPropertyId(); //random item property id
data << (uint32) pItem->GetItemSuffixFactor(); //SuffixFactor
data << (uint32) pItem->GetCount(); //item->count
data << (uint32) pItem->GetSpellCharges(); //item->charge FFFFFFF
data << (uint32) 0; //Unknown
data << (uint64) owner; //Auction->owner
data << (uint32) startbid; //Auction->startbid (not sure if useful)
data << (uint32) (bid ? GetAuctionOutBid() : 0);
//minimal outbid
data << (uint32) buyout; //auction->buyout
data << (uint32) (expire_time - time(NULL))* 1000; //time left
data << (uint64) bidder; //auction->bidder current
data << (uint32) bid; //current bid
return true;
}
示例7: TC_LOG_ERROR
//this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
{
Item* item = sAuctionMgr->GetAItem(itemGUIDLow);
if (!item)
{
TC_LOG_ERROR("misc", "AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", autcionId, itemGUIDLow);
return false;
}
ObjectGuid ownerGUID = MAKE_NEW_GUID(owner, 0, HIGHGUID_PLAYER);
ObjectGuid bidderGUID = MAKE_NEW_GUID(bidder, 0, HIGHGUID_PLAYER);
ObjectGuid itemGUID = MAKE_NEW_GUID(itemGUIDLow, 0, HIGHGUID_ITEM);
ObjectGuid ownerAccountID = 0; // Owner Account ID -- Added in WoD
// Write Item Instances
data << uint32(item->GetEntry());
data << uint32(item->GetItemSuffixFactor());
data << uint32(item->GetItemRandomPropertyId());
data.FlushBits();
data.WriteBit(0); // HasItemBonus -- Added in WoD
data.WriteBit(0); // HasModifications -- Added in WoD
data << int32(item->GetCount());
data << int32(item->GetSpellCharges());
data << int32(PROP_ENCHANTMENT_SLOT_0);
data << int32(0); // flags -- Added in WoD???
data << int32(autcionId);
data << ownerGUID;
data << uint64(startbid);
data << uint64(bid ? GetAuctionOutBid() : 0);
data << uint64(buyout);
data << int32((expire_time - time(NULL)) * IN_MILLISECONDS);
data << uint8(0); // Delete Reason -- Added in WoD
for (uint8 i = 0; i < PROP_ENCHANTMENT_SLOT_0; ++i)
{
data << int32(item->GetEnchantmentId(EnchantmentSlot(i)));
data << uint32(item->GetEnchantmentDuration(EnchantmentSlot(i)));
data << int32(item->GetEnchantmentCharges(EnchantmentSlot(i)));
data << uint8(0); // Slot
}
data.FlushBits();
data.WriteBit(1); // ServerSideInfo -- Disable for more check
data.WriteBit(0); // BidInfo
/* ServerSideInfo Added In WoD
data << _itemGUID;
data << _ownerAccountID;
data << uint32((expire_time) * IN_MILLISECONDS);
*/
data << bidderGUID;
data << int64(bid);
return true;
}
示例8: uint32
void BlackMarketMgr::BuildBlackMarketAuctionsPacket(WorldPacket& data, uint32 guidLow)
{
uint32 count = 0;
data << uint32(time(NULL));
for (auto const &kvPair : m_bmAuctionsMap)
if (kvPair.second->IsActive())
++count;
data.WriteBits(count, 18);
ByteBuffer datas;
for (auto const &kvPair : m_bmAuctionsMap)
{
auto const auction = kvPair.second;
if (!auction->IsActive())
continue;
// Is owner
data.WriteBit(guidLow == auction->bidder);
uint64 currentBid = auction->bidder ? auction->bid : 0;
uint64 nextBidPrice = auction->bidder ? auction->bid + GetAuctionOutBid(auction->bid) : auction->bid;
uint64 upPrice = auction->bidder ? nextBidPrice - currentBid : 1;
datas << uint32(auction->bmTemplate->itemEntry);
datas << uint32(auction->bmTemplate->seller);
datas << uint32(auction->id);
datas << uint32(auction->bidderCount);
datas << uint32(auction->TimeLeft());
datas << uint64(currentBid);
datas << uint32(auction->bmTemplate->itemCount);
datas << uint32(0); // Unk
datas << uint64(nextBidPrice);
datas << uint64(upPrice);
}
data.FlushBits();
if (datas.size())
data.append(datas);
TC_LOG_DEBUG("network", ">> Sent %u BlackMarket Auctions", count);
}
示例9: uint32
void BlackMarketMgr::BuildBlackMarketAuctionsPacket(WorldPacket& data, uint32 guidLow)
{
uint32 count = 0;
ByteBuffer datas;
data << uint32(time(NULL));
for (BMAuctionEntryMap::const_iterator itr = GetAuctionsBegin(); itr != GetAuctionsEnd(); ++itr)
if (itr->second->IsActive())
++count;
data.WriteBits(count, 18);
for (BMAuctionEntryMap::const_iterator itr = GetAuctionsBegin(); itr != GetAuctionsEnd(); ++itr)
{
BMAuctionEntry* auction = itr->second;
if (!auction->IsActive())
continue;
data.WriteBit(guidLow == auction->bidder); // Is owner
uint64 currentBid = auction->bidder ? auction->bid : 0;
uint64 nextBidPrice = auction->bidder ? auction->bid + GetAuctionOutBid(auction->bid) : auction->bid;
uint64 upPrice = auction->bidder ? nextBidPrice - currentBid : 1;
datas << uint32(auction->bm_template->itemEntry);
datas << uint64(nextBidPrice);
datas << uint64(currentBid);
datas << uint32(0); // Unk
datas << uint32(auction->id);
datas << uint32(auction->bm_template->seller);
datas << uint64(upPrice);
datas << uint32(auction->TimeLeft());
datas << uint32(auction->bidderCount);
datas << uint32(auction->bm_template->itemCount);
}
data.FlushBits();
if (datas.size())
data.append(datas);
sLog->outInfo(LOG_FILTER_NETWORKIO, ">> Sent %u BlackMarket Auctions", count);
}
示例10: TC_LOG_ERROR
//this function inserts to WorldPacket auction's data
void AuctionEntry::BuildAuctionInfo(std::vector<WorldPackets::AuctionHouse::AuctionItem>& items, bool listAuctionItems) const
{
Item* item = sAuctionMgr->GetAItem(itemGUIDLow);
if (!item)
{
TC_LOG_ERROR("misc", "AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: " UI64FMTD, Id, itemGUIDLow);
return;
}
WorldPackets::AuctionHouse::AuctionItem auctionItem;
auctionItem.AuctionItemID = Id;
auctionItem.Item.Initialize(item);
auctionItem.BuyoutPrice = buyout;
auctionItem.CensorBidInfo = false;
auctionItem.CensorServerSideInfo = listAuctionItems;
auctionItem.Charges = item->GetSpellCharges();
auctionItem.Count = item->GetCount();
auctionItem.DeleteReason = 0; // Always 0 ?
auctionItem.DurationLeft = (expire_time - time(NULL)) * IN_MILLISECONDS;
auctionItem.EndTime = expire_time;
auctionItem.Flags = 0; // todo
auctionItem.ItemGuid = item->GetGUID();
auctionItem.MinBid = startbid;
auctionItem.Owner = ObjectGuid::Create<HighGuid::Player>(owner);
auctionItem.OwnerAccountID = ObjectGuid::Create<HighGuid::WowAccount>(ObjectMgr::GetPlayerAccountIdByGUID(auctionItem.Owner));
auctionItem.MinIncrement = bidder ? GetAuctionOutBid() : 0;
auctionItem.Bidder = bidder ? ObjectGuid::Create<HighGuid::Player>(bidder) : ObjectGuid::Empty;
auctionItem.BidAmount = bidder ? bid : 0;
for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; i++)
{
if (!item->GetEnchantmentId((EnchantmentSlot) i))
continue;
auctionItem.Enchantments.emplace_back(item->GetEnchantmentId((EnchantmentSlot) i), item->GetEnchantmentDuration((EnchantmentSlot) i), item->GetEnchantmentCharges((EnchantmentSlot) i), i);
}
items.emplace_back(auctionItem);
}