diff options
Diffstat (limited to 'src/server/game/AuctionHouse/AuctionHouseMgr.cpp')
-rw-r--r-- | src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index c9686a2a2e7..01cf94089af 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -96,7 +96,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& uint32 bidder_accId = 0; uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); - Player *bidder = sObjectMgr.GetPlayer(bidder_guid); + Player *bidder = sObjectMgr->GetPlayer(bidder_guid); // data for gm.log if (sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) { @@ -110,22 +110,22 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& } else { - bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid); - bidder_security = sAccountMgr.GetSecurity(bidder_accId); + bidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(bidder_guid); + bidder_security = sAccountMgr->GetSecurity(bidder_accId); if (bidder_security > SEC_PLAYER) // not do redundant DB requests { - if (!sObjectMgr.GetPlayerNameByGUID(bidder_guid,bidder_name)) - bidder_name = sObjectMgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN); + if (!sObjectMgr->GetPlayerNameByGUID(bidder_guid,bidder_name)) + bidder_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } } if (bidder_security > SEC_PLAYER) { std::string owner_name; - if (!sObjectMgr.GetPlayerNameByGUID(auction->owner,owner_name)) - owner_name = sObjectMgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN); + if (!sObjectMgr->GetPlayerNameByGUID(auction->owner,owner_name)) + owner_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); - uint32 owner_accid = sObjectMgr.GetPlayerAccountIdByGUID(auction->owner); + uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); sLog.outCommand(bidder_accId,"GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", bidder_name.c_str(),bidder_accId,pItem->GetProto()->Name1,pItem->GetEntry(),pItem->GetCount(),auction->bid,owner_name.c_str(),owner_accid); @@ -167,8 +167,8 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTransaction& trans) { uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); - Player *owner = sObjectMgr.GetPlayer(owner_guid); - uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid); + Player *owner = sObjectMgr->GetPlayer(owner_guid); + uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist (online or offline) if (owner || owner_accId) { @@ -197,8 +197,8 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTransaction& trans) { uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); - Player *owner = sObjectMgr.GetPlayer(owner_guid); - uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid); + Player *owner = sObjectMgr->GetPlayer(owner_guid); + uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist if (owner || owner_accId) { @@ -240,8 +240,8 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction, SQLTransact return; uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); - Player *owner = sObjectMgr.GetPlayer(owner_guid); - uint32 owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid); + Player *owner = sObjectMgr->GetPlayer(owner_guid); + uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist if (owner || owner_accId) { @@ -261,11 +261,11 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction, SQLTransact void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans) { uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder,0, HIGHGUID_PLAYER); - Player *oldBidder = sObjectMgr.GetPlayer(oldBidder_guid); + Player *oldBidder = sObjectMgr->GetPlayer(oldBidder_guid); uint32 oldBidder_accId = 0; if (!oldBidder) - oldBidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(oldBidder_guid); + oldBidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(oldBidder_guid); // old bidder exist if (oldBidder || oldBidder_accId) @@ -286,11 +286,11 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 new void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans) { uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); - Player *bidder = sObjectMgr.GetPlayer(bidder_guid); + Player *bidder = sObjectMgr->GetPlayer(bidder_guid); uint32 bidder_accId = 0; if (!bidder) - bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid); + bidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(bidder_guid); // bidder exist if (bidder || bidder_accId) @@ -462,14 +462,14 @@ void AuctionHouseObject::AddAuction(AuctionEntry *auction) ASSERT(auction); AuctionsMap[auction->Id] = auction; - sScriptMgr.OnAuctionAdd(this, auction); + sScriptMgr->OnAuctionAdd(this, auction); } bool AuctionHouseObject::RemoveAuction(AuctionEntry *auction, uint32 /*item_template*/) { bool wasInMap = AuctionsMap.erase(auction->Id) ? true : false; - sScriptMgr.OnAuctionRemove(this, auction); + sScriptMgr->OnAuctionRemove(this, auction); // we need to delete the entry, it is not referenced any more delete auction; @@ -503,8 +503,8 @@ void AuctionHouseObject::Update() ///- Either cancel the auction if there was no bidder if (auction->bidder == 0) { - sAuctionMgr.SendAuctionExpiredMail(auction, trans); - sScriptMgr.OnAuctionExpire(this, auction); + sAuctionMgr->SendAuctionExpiredMail(auction, trans); + sScriptMgr->OnAuctionExpire(this, auction); } ///- Or perform the transaction else @@ -512,9 +512,9 @@ void AuctionHouseObject::Update() //we should send an "item sold" message if the seller is online //we send the item to the winner //we send the money to the seller - sAuctionMgr.SendAuctionSuccessfulMail(auction, trans); - sAuctionMgr.SendAuctionWonMail(auction, trans); - sScriptMgr.OnAuctionSuccessful(this, auction); + sAuctionMgr->SendAuctionSuccessfulMail(auction, trans); + sAuctionMgr->SendAuctionWonMail(auction, trans); + sScriptMgr->OnAuctionSuccessful(this, auction); } uint32 item_template = auction->item_template; @@ -524,7 +524,7 @@ void AuctionHouseObject::Update() CharacterDatabase.CommitTransaction(trans); RemoveAuction(auction, item_template); - sAuctionMgr.RemoveAItem(auction->item_guidlow); + sAuctionMgr->RemoveAItem(auction->item_guidlow); } while (result->NextRow()); } @@ -570,7 +570,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr) { AuctionEntry *Aentry = itr->second; - Item *item = sAuctionMgr.GetAItem(Aentry->item_guidlow); + Item *item = sAuctionMgr->GetAItem(Aentry->item_guidlow); if (!item) continue; @@ -604,8 +604,8 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player // local name if (loc_idx >= 0) - if (ItemLocale const *il = sObjectMgr.GetItemLocale(proto->ItemId)) - sObjectMgr.GetLocaleString(il->Name, loc_idx, name); + if (ItemLocale const *il = sObjectMgr->GetItemLocale(proto->ItemId)) + sObjectMgr->GetLocaleString(il->Name, loc_idx, name); // DO NOT use GetItemEnchantMod(proto->RandomProperty) as it may return a result // that matches the search but it may not equal item->GetItemRandomPropertyId() @@ -661,7 +661,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player //this function inserts to WorldPacket auction's data bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const { - Item *pItem = sAuctionMgr.GetAItem(item_guidlow); + Item *pItem = sAuctionMgr->GetAItem(item_guidlow); if (!pItem) { sLog.outError("auction to item, that doesn't exist !!!!"); @@ -743,7 +743,7 @@ bool AuctionEntry::LoadFromDB(Field* fields) startbid = fields[9].GetUInt32(); deposit = fields[10].GetUInt32(); - CreatureData const* auctioneerData = sObjectMgr.GetCreatureData(auctioneer); + CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(auctioneer); if (!auctioneerData) { sLog.outError("Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer); @@ -767,7 +767,7 @@ bool AuctionEntry::LoadFromDB(Field* fields) // check if sold item exists for guid // and item_template in fact (GetAItem will fail if problematic in result check in AuctionHouseMgr::LoadAuctionItems) - if (!sAuctionMgr.GetAItem(item_guidlow)) + if (!sAuctionMgr->GetAItem(item_guidlow)) { sLog.outError("Auction %u has not a existing item : %u", Id, item_guidlow); return false; |