![]() |
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 (AuctionHouseId 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) |
| AuctionHouseSearcher * | GetAuctionHouseSearcher () |
| void | LoadAuctionItems () |
| void | LoadAuctions () |
| void | AddAItem (Item *it) |
| bool | RemoveAItem (ObjectGuid itemGuid, bool deleteFromDB=false, CharacterDatabaseTransaction *trans=nullptr) |
| void | Update (uint32 const diff) |
Static Public Member Functions | |
| static AuctionHouseMgr * | instance () |
| static uint32 | GetAuctionDeposit (AuctionHouseEntry const *entry, uint32 time, Item *pItem, uint32 count) |
| static AuctionHouseFaction | GetAuctionHouseFactionFromHouseId (AuctionHouseId ahHouseId) |
| static AuctionHouseEntry const * | GetAuctionHouseEntryFromFactionTemplate (uint32 factionTemplateId) |
| static AuctionHouseEntry const * | GetAuctionHouseEntryFromHouse (AuctionHouseId ahHouseId) |
Private Member Functions | |
| AuctionHouseMgr () | |
| ~AuctionHouseMgr () | |
| typedef std::unordered_map<ObjectGuid, Item*> AuctionHouseMgr::ItemMap |
|
private |
References _updateIntervalTimer, IN_MILLISECONDS, MINUTE, IntervalTimer::SetCurrent(), and IntervalTimer::SetInterval().
|
private |
References _auctionHouseSearcher, and _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 Alliance, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, FACTION_MASK_ALLIANCE, FACTION_MASK_HORDE, Horde, Neutral, FactionTemplateEntry::ourMask, sAuctionHouseStore, sFactionTemplateStore, and sWorld.
Referenced by WorldSession::HandleAuctionListBidderItems(), WorldSession::HandleAuctionListItems(), WorldSession::HandleAuctionListOwnerItems(), WorldSession::HandleAuctionSellItem(), and WorldSession::SendAuctionHello().
|
static |
References CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, Neutral, sAuctionHouseStore, and sWorld.
Referenced by AuctionEntry::LoadFromDB().
|
static |
References Alliance, Horde, and Neutral.
Referenced by AuctionEntry::GetFactionId(), WorldSession::HandleAuctionListBidderItems(), WorldSession::HandleAuctionListItems(), and WorldSession::HandleAuctionListOwnerItems().
|
inline |
References _auctionHouseSearcher.
| 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 | ( | AuctionHouseId | auctionHouseId | ) |
References _allianceAuctions, _hordeAuctions, _neutralAuctions, Alliance, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, Horde, Neutral, 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.
Referenced by SendAuctionExpiredMail(), and SendAuctionWonMail().
| 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, RemoveAItem(), 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::CalculateAuctionOutBid(), AuctionEntry::deposit, ObjectAccessor::FindConnectedPlayer(), AuctionEntry::GetAuctionCut(), 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, RemoveAItem(), sAchievementMgr, sCharacterCache, WorldSession::SendAuctionBidderNotification(), MailDraft::SendMailTo(), PreparedStatementBase::SetData(), sScriptMgr, and Player::UpdateAchievementCriteria().
| void AuctionHouseMgr::Update | ( | uint32 const | diff | ) |
References _allianceAuctions, _auctionHouseSearcher, _hordeAuctions, _neutralAuctions, _updateIntervalTimer, IntervalTimer::Passed(), IntervalTimer::Reset(), sScriptMgr, AuctionHouseObject::Update(), AuctionHouseSearcher::Update(), and IntervalTimer::Update().
|
private |
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().
|
private |
Referenced by GetAuctionHouseSearcher(), Update(), and ~AuctionHouseMgr().
|
private |
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().
|
private |
Referenced by AddAItem(), GetAItem(), LoadAuctionItems(), RemoveAItem(), and ~AuctionHouseMgr().
|
private |
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().
|
private |
Referenced by AuctionHouseMgr(), and Update().