本文整理汇总了C++中AuctionHouse::SendAuctionOutBidNotificationPacket方法的典型用法代码示例。如果您正苦于以下问题:C++ AuctionHouse::SendAuctionOutBidNotificationPacket方法的具体用法?C++ AuctionHouse::SendAuctionOutBidNotificationPacket怎么用?C++ AuctionHouse::SendAuctionOutBidNotificationPacket使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuctionHouse
的用法示例。
在下文中一共展示了AuctionHouse::SendAuctionOutBidNotificationPacket方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAuctionPlaceBid
void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
{
if(!_player->IsInWorld())
{
return;
}
uint64 guid;
recv_data >> guid;
uint32 auction_id, price;
recv_data >> auction_id >> price;
Creature * pCreature = _player->GetMapMgr()->GetCreature( guid );
if(!pCreature || !pCreature->auctionHouse)
{
return;
}
// Find Item
AuctionHouse * ah = pCreature->auctionHouse;
Auction * auct = ah->GetAuction(auction_id);
if(auct == 0 || !auct->Owner || !_player)
{
SendAuctionPlaceBidResultPacket(0, AUCTION_ERROR_INTERNAL);
return;
}
if(auct->Owner == _player->GetGUID())
{
SendAuctionPlaceBidResultPacket(0, AUCTION_ERROR_BID_OWN_AUCTION);
return;
}
if(auct->HighestBid > price && price != auct->BuyoutPrice)
{
//HACK: Don't know the correct error code...
SendAuctionPlaceBidResultPacket(0, AUCTION_ERROR_INTERNAL);
return;
}
if(_player->GetGold() < price)
{
SendAuctionPlaceBidResultPacket(0, AUCTION_ERROR_MONEY);
return;
}
_player->ModGold( -((int32)price));
if(auct->HighestBidder != 0)
{
// Return the money to the last highest bidder.
char subject[100];
snprintf(subject, 100, "%u:0:0", (int)auct->pItem->GetEntry());
sMailSystem.SendAutomatedMessage(AUCTION, ah->GetID(), auct->HighestBidder, subject, "", auct->HighestBid, 0, 0, MAIL_STATIONERY_AUCTION );
// Do not send out bid notification, when current highest bidder and new bidder are the same player..
if(auct->HighestBidder != (uint32)_player->GetLowGUID())
ah->SendAuctionOutBidNotificationPacket(auct, _player->GetGUID(), price);
}
if(auct->BuyoutPrice == price)
{
auct->HighestBidder = _player->GetLowGUID();
auct->HighestBid = price;
// we used buyout on the item.
ah->QueueDeletion(auct, AUCTION_REMOVE_WON);
SendAuctionPlaceBidResultPacket(auct->Id, AUCTION_ERROR_NONE);
ah->SendAuctionBuyOutNotificationPacket(auct);
}
else
{
// update most recent bid
auct->HighestBidder = _player->GetLowGUID();
auct->HighestBid = price;
auct->UpdateInDB();
SendAuctionPlaceBidResultPacket(auct->Id, AUCTION_ERROR_NONE);
}
}