![]() |
TrinityCore
|
#include <AuctionHouseMgr.h>
Public Types | |
| typedef std::unordered_map< ObjectGuid::LowType, Item * > | ItemMap |
| typedef std::vector< AuctionEntry * > | PlayerAuctions |
| typedef std::pair< PlayerAuctions *, uint32 > | AuctionPair |
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 | mHordeAuctions |
| AuctionHouseObject | mAllianceAuctions |
| AuctionHouseObject | mNeutralAuctions |
| std::map< ObjectGuid, AuctionPair > | pendingAuctionMap |
| ItemMap | mAitems |
Definition at line 160 of file AuctionHouseMgr.h.
| typedef std::pair<PlayerAuctions*, uint32> AuctionHouseMgr::AuctionPair |
Definition at line 171 of file AuctionHouseMgr.h.
| typedef std::unordered_map<ObjectGuid::LowType, Item*> AuctionHouseMgr::ItemMap |
Definition at line 169 of file AuctionHouseMgr.h.
| typedef std::vector<AuctionEntry*> AuctionHouseMgr::PlayerAuctions |
Definition at line 170 of file AuctionHouseMgr.h.
|
private |
Definition at line 44 of file AuctionHouseMgr.cpp.
|
private |
Definition at line 46 of file AuctionHouseMgr.cpp.
References mAitems.
| void AuctionHouseMgr::AddAItem | ( | Item * | item | ) |
Definition at line 420 of file AuctionHouseMgr.cpp.
References ASSERT, ASSERT_WITH_SIDE_EFFECTS, ObjectGuid::GetCounter(), Object::GetGUID(), and mAitems.
Referenced by LoadAuctionItems().
|
inline |
Definition at line 176 of file AuctionHouseMgr.h.
Referenced by SendAuctionExpiredMail(), and SendAuctionWonMail().
|
static |
Definition at line 88 of file AuctionHouseMgr.cpp.
References AH_MINIMUM_DEPOSIT, CalculatePct(), AuctionHouseEntry::DepositRate, Item::GetSellPrice(), RATE_AUCTION_DEPOSIT, sWorld, and TC_LOG_DEBUG.
|
static |
Definition at line 569 of file AuctionHouseMgr.cpp.
References AUCTIONHOUSE_ALLIANCE, AUCTIONHOUSE_HORDE, AUCTIONHOUSE_NEUTRAL, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, FACTION_MASK_ALLIANCE, FACTION_MASK_HORDE, FactionTemplateEntry::FactionGroup, sAuctionHouseStore, sFactionTemplateStore, and sWorld.
Referenced by WorldSession::HandleAuctionSellItem(), and WorldSession::SendAuctionHello().
|
static |
Definition at line 592 of file AuctionHouseMgr.cpp.
References AUCTIONHOUSE_NEUTRAL, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, sAuctionHouseStore, and sWorld.
Referenced by AuctionEntry::LoadFromDB().
| AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap | ( | uint32 | factionTemplateId | ) |
Definition at line 58 of file AuctionHouseMgr.cpp.
References CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, FACTION_MASK_ALLIANCE, FACTION_MASK_HORDE, FactionTemplateEntry::FactionGroup, mAllianceAuctions, mHordeAuctions, mNeutralAuctions, sFactionTemplateStore, and sWorld.
| AuctionHouseObject * AuctionHouseMgr::GetAuctionsMapByHouseId | ( | uint8 | auctionHouseId | ) |
Definition at line 75 of file AuctionHouseMgr.cpp.
References AUCTIONHOUSE_ALLIANCE, AUCTIONHOUSE_HORDE, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, mAllianceAuctions, mHordeAuctions, mNeutralAuctions, and sWorld.
Referenced by LoadAuctions().
|
static |
| void AuctionHouseMgr::LoadAuctionItems | ( | ) |
Definition at line 306 of file AuctionHouseMgr.cpp.
References AddAItem(), CHAR_SEL_AUCTION_ITEMS, CharacterDatabase, ObjectGuid::Empty, getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), Item::LoadFromDB(), mAitems, NewItemOrBag(), sObjectMgr, TC_LOG_ERROR, and TC_LOG_INFO.
| void AuctionHouseMgr::LoadAuctions | ( | ) |
Definition at line 362 of file AuctionHouseMgr.cpp.
References AuctionHouseObject::AddAuction(), AuctionEntry::bidders, CHAR_SEL_AUCTION_BIDDERS, CHAR_SEL_AUCTIONS, CharacterDatabase, AuctionEntry::DeleteFromDB(), GetAuctionsMapByHouseId(), getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), AuctionEntry::houseId, AuctionEntry::Id, AuctionEntry::LoadFromDB(), and TC_LOG_INFO.
| bool AuctionHouseMgr::PendingAuctionAdd | ( | Player * | player, |
| AuctionEntry * | aEntry | ||
| ) |
Definition at line 443 of file AuctionHouseMgr.cpp.
References AuctionEntry::deposit, Object::GetGUID(), Player::HasEnoughMoney(), and pendingAuctionMap.
Definition at line 471 of file AuctionHouseMgr.cpp.
References Object::GetGUID(), and pendingAuctionMap.
Referenced by UpdatePendingAuctions().
| void AuctionHouseMgr::PendingAuctionProcess | ( | Player * | player | ) |
Definition at line 480 of file AuctionHouseMgr.cpp.
References CharacterDatabase, AuctionEntry::DeleteFromDB(), AuctionEntry::deposit, AuctionEntry::expire_time, GameTime::GetGameTime(), Object::GetGUID(), Player::HasEnoughMoney(), Player::ModifyMoney(), pendingAuctionMap, and AuctionEntry::SaveToDB().
Referenced by UpdatePendingAuctions().
| bool AuctionHouseMgr::RemoveAItem | ( | ObjectGuid::LowType | id, |
| bool | deleteItem = false, |
||
| CharacterDatabaseTransaction * | trans = nullptr |
||
| ) |
Definition at line 426 of file AuctionHouseMgr.cpp.
References ASSERT, ITEM_REMOVED, and mAitems.
| void AuctionHouseMgr::SendAuctionCancelledToBidderMail | ( | AuctionEntry * | auction, |
| CharacterDatabaseTransaction | trans, | ||
| Item * | item | ||
| ) |
Definition at line 287 of file AuctionHouseMgr.cpp.
References MailDraft::AddMoney(), AUCTION_CANCELLED_TO_BIDDER, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailSubject(), ObjectAccessor::FindConnectedPlayer(), Item::GetItemRandomPropertyId(), Player::GetSession(), AuctionEntry::Id, AuctionEntry::itemEntry, MAIL_CHECK_MASK_AUCTION, MAIL_CHECK_MASK_COPIED, sAuctionBotConfig, sCharacterCache, WorldSession::SendAuctionRemovedNotification(), and MailDraft::SendMailTo().
| void AuctionHouseMgr::SendAuctionExpiredMail | ( | AuctionEntry * | auction, |
| CharacterDatabaseTransaction | trans | ||
| ) |
Definition at line 237 of file AuctionHouseMgr.cpp.
References MailDraft::AddItem(), AUCTION_EXPIRED, AuctionEntry::BuildAuctionMailSubject(), ObjectAccessor::FindConnectedPlayer(), GetAItem(), Player::GetSession(), AuctionEntry::itemGUIDLow, MAIL_CHECK_MASK_AUCTION, MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sAuctionBotConfig, sAuctionMgr, sCharacterCache, WorldSession::SendAuctionOwnerNotification(), and MailDraft::SendMailTo().
| void AuctionHouseMgr::SendAuctionOutbiddedMail | ( | AuctionEntry * | auction, |
| uint32 | newPrice, | ||
| Player * | newBidder, | ||
| CharacterDatabaseTransaction | trans | ||
| ) |
Definition at line 265 of file AuctionHouseMgr.cpp.
References MailDraft::AddMoney(), AUCTION_OUTBIDDED, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailSubject(), ObjectAccessor::FindConnectedPlayer(), AuctionEntry::GetAuctionOutBid(), Object::GetGUID(), AuctionEntry::GetHouseId(), Player::GetSession(), AuctionEntry::Id, AuctionEntry::itemEntry, MAIL_CHECK_MASK_AUCTION, MAIL_CHECK_MASK_COPIED, sAuctionBotConfig, sCharacterCache, WorldSession::SendAuctionBidderNotification(), and MailDraft::SendMailTo().
| void AuctionHouseMgr::SendAuctionSalePendingMail | ( | AuctionEntry * | auction, |
| CharacterDatabaseTransaction | trans | ||
| ) |
Definition at line 190 of file AuctionHouseMgr.cpp.
References AUCTION_SALE_PENDING, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionInvoiceMailBody(), AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::buyout, CONFIG_MAIL_DELIVERY_DELAY, AuctionEntry::deposit, ObjectAccessor::FindConnectedPlayer(), AuctionEntry::GetAuctionCut(), WowTime::GetPackedTime(), Player::GetSession(), WorldSession::GetTimezoneOffset(), GameTime::GetUtcWowTime(), MAIL_CHECK_MASK_AUCTION, MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sAuctionBotConfig, sCharacterCache, MailDraft::SendMailTo(), and sWorld.
| void AuctionHouseMgr::SendAuctionSuccessfulMail | ( | AuctionEntry * | auction, |
| CharacterDatabaseTransaction | trans | ||
| ) |
Definition at line 211 of file AuctionHouseMgr.cpp.
References ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, MailDraft::AddMoney(), AUCTION_SUCCESSFUL, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::BuildAuctionSoldMailBody(), AuctionEntry::buyout, CONFIG_MAIL_DELIVERY_DELAY, AuctionEntry::deposit, ObjectAccessor::FindConnectedPlayer(), AuctionEntry::GetAuctionCut(), Player::GetSession(), MAIL_CHECK_MASK_AUCTION, MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sAuctionBotConfig, sCharacterCache, WorldSession::SendAuctionOwnerNotification(), MailDraft::SendMailTo(), sWorld, and Player::UpdateAchievementCriteria().
| void AuctionHouseMgr::SendAuctionWonMail | ( | AuctionEntry * | auction, |
| CharacterDatabaseTransaction | trans | ||
| ) |
Definition at line 122 of file AuctionHouseMgr.cpp.
References ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, MailDraft::AddItem(), AUCTION_ENTRY_FLAG_GM_LOG_BUYER, AUCTION_ENTRY_FLAG_NONE, AUCTION_WON, AuctionEntry::bid, AuctionEntry::bidder, AuctionEntry::BuildAuctionMailSubject(), AuctionEntry::BuildAuctionWonMailBody(), AuctionEntry::buyout, CHAR_UPD_ITEM_OWNER, CharacterDatabase, ObjectAccessor::FindConnectedPlayer(), AuctionEntry::Flags, WorldSession::GetAccountId(), GetAItem(), Item::GetCount(), ObjectGuid::GetCounter(), Object::GetEntry(), Object::GetGUID(), AuctionEntry::GetHouseId(), WorldObject::GetName(), Item::GetNameForLocaleIdx(), Player::GetSession(), AuctionEntry::Id, AuctionEntry::itemEntry, AuctionEntry::itemGUIDLow, LANG_UNKNOWN, MAIL_CHECK_MASK_AUCTION, MAIL_CHECK_MASK_AUCTION_WON, MAIL_CHECK_MASK_COPIED, AuctionEntry::owner, sAuctionBotConfig, sAuctionMgr, sCharacterCache, WorldSession::SendAuctionBidderNotification(), MailDraft::SendMailTo(), PreparedStatementBase::setUInt32(), sLog, sObjectMgr, sWorld, and Player::UpdateAchievementCriteria().
| void AuctionHouseMgr::Update | ( | ) |
Definition at line 562 of file AuctionHouseMgr.cpp.
References mAllianceAuctions, mHordeAuctions, mNeutralAuctions, and AuctionHouseObject::Update().
| void AuctionHouseMgr::UpdatePendingAuctions | ( | ) |
Definition at line 521 of file AuctionHouseMgr.cpp.
References CharacterDatabase, AuctionEntry::DeleteFromDB(), AuctionEntry::expire_time, ObjectAccessor::FindConnectedPlayer(), GameTime::GetGameTime(), PendingAuctionCount(), pendingAuctionMap, PendingAuctionProcess(), AuctionEntry::SaveToDB(), TC_LOG_WARN, and ObjectGuid::ToString().
|
private |
Definition at line 218 of file AuctionHouseMgr.h.
Referenced by AddAItem(), LoadAuctionItems(), RemoveAItem(), and ~AuctionHouseMgr().
|
private |
Definition at line 213 of file AuctionHouseMgr.h.
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().
|
private |
Definition at line 212 of file AuctionHouseMgr.h.
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().
|
private |
Definition at line 214 of file AuctionHouseMgr.h.
Referenced by GetAuctionsMap(), GetAuctionsMapByHouseId(), and Update().
|
private |
Definition at line 216 of file AuctionHouseMgr.h.
Referenced by PendingAuctionAdd(), PendingAuctionCount(), PendingAuctionProcess(), and UpdatePendingAuctions().