AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "AuctionHouseMgr.h"
Public Types | |
typedef std::unordered_map< ObjectGuid, Item * > | ItemMap |
Public Member Functions | |
AuctionHouseObject * | GetAuctionsMap (uint32 factionTemplateId) |
AuctionHouseObject * | GetAuctionsMapByHouseId (uint8 auctionHouseId) |
Item * | GetAItem (ObjectGuid itemGuid) |
void | SendAuctionWonMail (AuctionEntry *auction, CharacterDatabaseTransaction trans, bool sendNotification=true, bool updateAchievementCriteria=true, bool sendMail=true) |
void | SendAuctionSalePendingMail (AuctionEntry *auction, CharacterDatabaseTransaction trans, bool sendMail=true) |
void | SendAuctionSuccessfulMail (AuctionEntry *auction, CharacterDatabaseTransaction trans, bool sendNotification=true, bool updateAchievementCriteria=true, bool sendMail=true) |
void | SendAuctionExpiredMail (AuctionEntry *auction, CharacterDatabaseTransaction trans, bool sendNotification=true, bool sendMail=true) |
void | SendAuctionOutbiddedMail (AuctionEntry *auction, uint32 newPrice, Player *newBidder, CharacterDatabaseTransaction trans, bool sendNotification=true, bool sendMail=true) |
void | SendAuctionCancelledToBidderMail (AuctionEntry *auction, CharacterDatabaseTransaction trans, bool sendMail=true) |
void | LoadAuctionItems () |
void | LoadAuctions () |
void | AddAItem (Item *it) |
bool | RemoveAItem (ObjectGuid itemGuid, bool deleteFromDB=false, CharacterDatabaseTransaction *trans=nullptr) |
void | Update () |
Static Public Member Functions | |
static AuctionHouseMgr * | instance () |
static uint32 | GetAuctionDeposit (AuctionHouseEntry const *entry, uint32 time, Item *pItem, uint32 count) |
static AuctionHouseEntry const * | GetAuctionHouseEntry (uint32 factionTemplateId) |
static AuctionHouseEntry const * | GetAuctionHouseEntryFromHouse (uint8 houseId) |
Private Member Functions | |
AuctionHouseMgr () | |
~AuctionHouseMgr () | |
Private Attributes | |
AuctionHouseObject | _hordeAuctions |
AuctionHouseObject | _allianceAuctions |
AuctionHouseObject | _neutralAuctions |
ItemMap | _mAitems |
typedef std::unordered_map<ObjectGuid, Item*> AuctionHouseMgr::ItemMap |
|
private |
|
private |
References _mAitems.
void AuctionHouseMgr::AddAItem | ( | Item * | it | ) |
References _mAitems, ASSERT, and Object::GetGUID().
Referenced by LoadAuctionItems().
|
inline |
References _mAitems.
Referenced by SendAuctionExpiredMail(), and SendAuctionWonMail().
|
static |
References AH_MINIMUM_DEPOSIT, CalculatePct(), AuctionHouseEntry::depositPercent, Item::GetTemplate(), LOG_DEBUG, RATE_AUCTION_DEPOSIT, ItemTemplate::SellPrice, and sWorld.
|
static |
References AUCTIONHOUSE_ALLIANCE, AUCTIONHOUSE_HORDE, AUCTIONHOUSE_NEUTRAL, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, FACTION_MASK_ALLIANCE, FACTION_MASK_HORDE, FactionTemplateEntry::ourMask, sAuctionHouseStore, sFactionTemplateStore, and sWorld.
Referenced by WorldSession::HandleAuctionSellItem(), and WorldSession::SendAuctionHello().
|
static |
References AUCTIONHOUSE_NEUTRAL, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, sAuctionHouseStore, and sWorld.
Referenced by AuctionEntry::LoadFromDB().
AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap | ( | uint32 | factionTemplateId | ) |
References _allianceAuctions, _hordeAuctions, _neutralAuctions, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, FACTION_MASK_ALLIANCE, FACTION_MASK_HORDE, FactionTemplateEntry::ourMask, sFactionTemplateStore, and sWorld.
AuctionHouseObject * AuctionHouseMgr::GetAuctionsMapByHouseId | ( | uint8 | auctionHouseId | ) |
References _allianceAuctions, _hordeAuctions, _neutralAuctions, AUCTIONHOUSE_ALLIANCE, AUCTIONHOUSE_HORDE, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, and sWorld.
Referenced by LoadAuctions().
|
static |
void AuctionHouseMgr::LoadAuctionItems | ( | ) |
References _mAitems, AddAItem(), CHAR_SEL_AUCTION_ITEMS, CharacterDatabase, ObjectGuid::Empty, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), Item::LoadFromDB(), LOG_ERROR, LOG_INFO, LOG_WARN, NewItemOrBag(), and sObjectMgr.
void AuctionHouseMgr::LoadAuctions | ( | ) |
References AuctionHouseObject::AddAuction(), CHAR_SEL_AUCTIONS, CharacterDatabase, AuctionEntry::DeleteFromDB(), GetAuctionsMapByHouseId(), getMSTime(), GetMSTimeDiffToNow(), AuctionEntry::houseId, AuctionEntry::LoadFromDB(), LOG_INFO, and LOG_WARN.
bool AuctionHouseMgr::RemoveAItem | ( | ObjectGuid | itemGuid, |
bool | deleteFromDB = false , |
||
CharacterDatabaseTransaction * | trans = nullptr |
||
) |
References _mAitems, ASSERT, and ITEM_REMOVED.
void AuctionHouseMgr::SendAuctionCancelledToBidderMail | ( | AuctionEntry * | auction, |
CharacterDatabaseTransaction | trans, | ||
bool | sendMail = true |
||
) |
References MailDraft::AddMoney(), AUCTION_CANCELLED_TO_BIDDER, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailBody(), AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::buyout, AuctionEntry::deposit, ObjectAccessor::FindConnectedPlayer(), ObjectGuid::GetCounter(), MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sCharacterCache, MailDraft::SendMailTo(), and sScriptMgr.
void AuctionHouseMgr::SendAuctionExpiredMail | ( | AuctionEntry * | auction, |
CharacterDatabaseTransaction | trans, | ||
bool | sendNotification = true , |
||
bool | sendMail = true |
||
) |
References MailDraft::AddItem(), AUCTION_EXPIRED, AuctionEntry::BuildAuctionMailBody(), AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::buyout, AuctionEntry::deposit, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayer(), GetAItem(), ObjectGuid::GetCounter(), Player::GetSession(), AuctionEntry::item_guid, MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sAuctionMgr, sCharacterCache, WorldSession::SendAuctionOwnerNotification(), MailDraft::SendMailTo(), and sScriptMgr.
void AuctionHouseMgr::SendAuctionOutbiddedMail | ( | AuctionEntry * | auction, |
uint32 | newPrice, | ||
Player * | newBidder, | ||
CharacterDatabaseTransaction | trans, | ||
bool | sendNotification = true , |
||
bool | sendMail = true |
||
) |
References MailDraft::AddMoney(), AUCTION_OUTBIDDED, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailBody(), AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::buyout, AuctionEntry::deposit, ObjectAccessor::FindConnectedPlayer(), AuctionEntry::GetAuctionCut(), AuctionEntry::GetAuctionOutBid(), ObjectGuid::GetCounter(), Object::GetGUID(), AuctionEntry::GetHouseId(), Player::GetSession(), AuctionEntry::Id, AuctionEntry::item_template, MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sCharacterCache, WorldSession::SendAuctionBidderNotification(), MailDraft::SendMailTo(), and sScriptMgr.
void AuctionHouseMgr::SendAuctionSalePendingMail | ( | AuctionEntry * | auction, |
CharacterDatabaseTransaction | trans, | ||
bool | sendMail = true |
||
) |
References ByteBuffer::AppendPackedTime(), AUCTION_SALE_PENDING, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailBody(), AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::buyout, CONFIG_MAIL_DELIVERY_DELAY, AuctionEntry::deposit, ObjectAccessor::FindConnectedPlayer(), AuctionEntry::GetAuctionCut(), ObjectGuid::GetCounter(), GameTime::GetGameTime(), MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, ByteBuffer::read(), sCharacterCache, MailDraft::SendMailTo(), sScriptMgr, and sWorld.
void AuctionHouseMgr::SendAuctionSuccessfulMail | ( | AuctionEntry * | auction, |
CharacterDatabaseTransaction | trans, | ||
bool | sendNotification = true , |
||
bool | updateAchievementCriteria = true , |
||
bool | sendMail = true |
||
) |
References ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, MailDraft::AddMoney(), AUCTION_SUCCESSFUL, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailBody(), AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::buyout, CharacterDatabase, CONFIG_MAIL_DELIVERY_DELAY, AuctionEntry::deposit, ObjectAccessor::FindConnectedPlayer(), AuctionEntry::GetAuctionCut(), ObjectGuid::GetCounter(), WorldSession::GetRemoteAddress(), Player::GetSession(), GOLD, AuctionEntry::item_template, AuctionEntry::itemCount, MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sAchievementMgr, sCharacterCache, WorldSession::SendAuctionOwnerNotification(), MailDraft::SendMailTo(), sScriptMgr, sWorld, and Player::UpdateAchievementCriteria().
void AuctionHouseMgr::SendAuctionWonMail | ( | AuctionEntry * | auction, |
CharacterDatabaseTransaction | trans, | ||
bool | sendNotification = true , |
||
bool | updateAchievementCriteria = true , |
||
bool | sendMail = true |
||
) |
References ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, MailDraft::AddItem(), AUCTION_WON, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailBody(), AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::buyout, CHAR_UPD_ITEM_OWNER, CharacterDatabase, ObjectAccessor::FindConnectedPlayer(), WorldSession::GetAccountId(), GetAItem(), ObjectGuid::GetCounter(), Object::GetGUID(), AuctionEntry::GetHouseId(), Player::GetSession(), AuctionEntry::Id, AuctionEntry::item_guid, AuctionEntry::item_template, MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sAchievementMgr, sAuctionMgr, sCharacterCache, WorldSession::SendAuctionBidderNotification(), MailDraft::SendMailTo(), PreparedStatementBase::SetData(), sScriptMgr, and Player::UpdateAchievementCriteria().
void AuctionHouseMgr::Update | ( | ) |
References _allianceAuctions, _hordeAuctions, _neutralAuctions, sScriptMgr, and AuctionHouseObject::Update().
|
private |
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().
|
private |
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().
|
private |
Referenced by AddAItem(), GetAItem(), LoadAuctionItems(), RemoveAItem(), and ~AuctionHouseMgr().
|
private |
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().