diff options
Diffstat (limited to 'src/server/game/AuctionHouse/AuctionHouseMgr.cpp')
-rw-r--r-- | src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 01cf94089af..2fd31145957 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -50,7 +50,7 @@ AuctionHouseMgr::~AuctionHouseMgr() AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) { - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) return &mNeutralAuctions; // team have linked auction houses @@ -76,10 +76,10 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 uint32 timeHr = (((time / 60) / 60) / 12); uint32 deposit = uint32(multiplier * MSV * count / 3) * timeHr * 3; - sLog.outDebug("MSV: %u", MSV); - sLog.outDebug("Items: %u", count); - sLog.outDebug("Multiplier: %f", multiplier); - sLog.outDebug("Deposit: %u", deposit); + sLog->outDebug("MSV: %u", MSV); + sLog->outDebug("Items: %u", count); + sLog->outDebug("Multiplier: %f", multiplier); + sLog->outDebug("Deposit: %u", deposit); if (deposit < AH_MINIMUM_DEPOSIT) return AH_MINIMUM_DEPOSIT; @@ -98,7 +98,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); Player *bidder = sObjectMgr->GetPlayer(bidder_guid); // data for gm.log - if (sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { uint32 bidder_security = 0; std::string bidder_name; @@ -127,7 +127,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& 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)", + 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); } } @@ -142,7 +142,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& msgAuctionWonBody.width(16); msgAuctionWonBody << std::right << std::hex << auction->owner; msgAuctionWonBody << std::dec << ":" << auction->bid << ":" << auction->buyout; - sLog.outDebug("AuctionWon body string : %s", msgAuctionWonBody.str().c_str()); + sLog->outDebug("AuctionWon body string : %s", msgAuctionWonBody.str().c_str()); // set owner to bidder (to prevent delete item with sender char deleting) // owner in `data` will set at mail receive and item extracting @@ -178,7 +178,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran std::ostringstream msgAuctionSalePendingBody; uint32 auctionCut = auction->GetAuctionCut(); - time_t distrTime = time(NULL) + sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY); + time_t distrTime = time(NULL) + sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY); msgAuctionSalePendingBody.width(16); msgAuctionSalePendingBody << std::right << std::hex << auction->bidder; @@ -186,7 +186,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran msgAuctionSalePendingBody << ":" << auction->deposit << ":" << auctionCut << ":0:"; msgAuctionSalePendingBody << secsToTimeBitFields(distrTime); - sLog.outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); + sLog->outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); MailDraft(msgAuctionSalePendingSubject.str(), msgAuctionSalePendingBody.str()) .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED); @@ -213,7 +213,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans auctionSuccessfulBody << std::dec << ":" << auction->bid << ":" << auction->buyout; auctionSuccessfulBody << ":" << auction->deposit << ":" << auctionCut; - sLog.outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str()); + sLog->outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str()); uint32 profit = auction->bid + auction->deposit - auctionCut; @@ -227,7 +227,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans } MailDraft(msgAuctionSuccessfulSubject.str(), auctionSuccessfulBody.str()) .AddMoney(profit) - .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY)); + .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY)); } } @@ -315,8 +315,8 @@ void AuctionHouseMgr::LoadAuctionItems() if (!result) { - sLog.outString(">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!"); + sLog->outString(); return; } @@ -333,7 +333,7 @@ void AuctionHouseMgr::LoadAuctionItems() ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template); if (!proto) { - sLog.outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template); + sLog->outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template); continue; } @@ -349,8 +349,8 @@ void AuctionHouseMgr::LoadAuctionItems() } while (result->NextRow()); - sLog.outString(">> Loaded %u auction items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u auction items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AuctionHouseMgr::LoadAuctions() @@ -362,8 +362,8 @@ void AuctionHouseMgr::LoadAuctions() if (!result) { - sLog.outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty."); + sLog->outString(); return; } @@ -389,8 +389,8 @@ void AuctionHouseMgr::LoadAuctions() CharacterDatabase.CommitTransaction(trans); - sLog.outString(">> Loaded %u auctions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u auctions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AuctionHouseMgr::AddAItem(Item* it) @@ -421,7 +421,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem { uint32 houseid = 7; // goblin auction house - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) { //FIXME: found way for proper auctionhouse selection by another way // AuctionHouse.dbc have faction field with _player_ factions associated with auction house races. @@ -478,7 +478,7 @@ bool AuctionHouseObject::RemoveAuction(AuctionEntry *auction, uint32 /*item_temp void AuctionHouseObject::Update() { - time_t curTime = sWorld.GetGameTime(); + time_t curTime = sWorld->GetGameTime(); ///- Handle expired auctions // If storage is empty, no need to update. next == NULL in this case. @@ -664,7 +664,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const Item *pItem = sAuctionMgr->GetAItem(item_guidlow); if (!pItem) { - sLog.outError("auction to item, that doesn't exist !!!!"); + sLog->outError("auction to item, that doesn't exist !!!!"); return false; } data << uint32(Id); @@ -695,7 +695,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const uint32 AuctionEntry::GetAuctionCut() const { - int32 cut = int32(CalculatePctU(sWorld.getRate(RATE_AUCTION_CUT), auctionHouseEntry->cutPercent)) * bid; + int32 cut = int32(CalculatePctU(sWorld->getRate(RATE_AUCTION_CUT), auctionHouseEntry->cutPercent)) * bid; return std::max(cut, 0); } @@ -746,14 +746,14 @@ bool AuctionEntry::LoadFromDB(Field* fields) CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(auctioneer); if (!auctioneerData) { - sLog.outError("Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer); + sLog->outError("Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer); return false; } CreatureInfo const* auctioneerInfo = ObjectMgr::GetCreatureTemplate(auctioneerData->id); if (!auctioneerInfo) { - sLog.outError("Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id); + sLog->outError("Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id); return false; } @@ -761,7 +761,7 @@ bool AuctionEntry::LoadFromDB(Field* fields) auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(factionTemplateId); if (!auctionHouseEntry) { - sLog.outError("Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId); + sLog->outError("Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId); return false; } @@ -769,7 +769,7 @@ bool AuctionEntry::LoadFromDB(Field* fields) // and item_template in fact (GetAItem will fail if problematic in result check in AuctionHouseMgr::LoadAuctionItems) if (!sAuctionMgr->GetAItem(item_guidlow)) { - sLog.outError("Auction %u has not a existing item : %u", Id, item_guidlow); + sLog->outError("Auction %u has not a existing item : %u", Id, item_guidlow); return false; } return true; |