mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8789] Rename several singleton macros to use more consistent names.
* objmgr -> sObjectMgr * spellmgr -> sSpellMgr * WaypointMgr -> sWaypointMgr * poolhandler -> sPoolMgr * objaccessor -> sObjectAccessor * mapmgr -> sMapMgr * sInstanceSaveManager -> sInstanceSaveMgr * ticketmgr -> sTicketMgr * CreatureEAI_Mgr -> sEventAIMgr * auctionmgr -> sAuctionMgr * achievementmgr -> sAchievementMgr
This commit is contained in:
parent
539072fcbd
commit
0734adb746
84 changed files with 1113 additions and 1113 deletions
|
|
@ -79,7 +79,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
|
|||
return;
|
||||
|
||||
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
|
||||
Player *bidder = objmgr.GetPlayer(bidder_guid);
|
||||
Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
|
||||
|
||||
uint32 bidder_accId = 0;
|
||||
|
||||
|
|
@ -96,30 +96,30 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
|
|||
}
|
||||
else
|
||||
{
|
||||
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid);
|
||||
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
|
||||
bidder_security = accmgr.GetSecurity(bidder_accId);
|
||||
|
||||
if(bidder_security > SEC_PLAYER ) // not do redundant DB requests
|
||||
{
|
||||
if(!objmgr.GetPlayerNameByGUID(bidder_guid,bidder_name))
|
||||
bidder_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
|
||||
if(!sObjectMgr.GetPlayerNameByGUID(bidder_guid,bidder_name))
|
||||
bidder_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
if( bidder_security > SEC_PLAYER )
|
||||
{
|
||||
std::string owner_name;
|
||||
if(!objmgr.GetPlayerNameByGUID(auction->owner,owner_name))
|
||||
owner_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
|
||||
if(!sObjectMgr.GetPlayerNameByGUID(auction->owner,owner_name))
|
||||
owner_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
|
||||
|
||||
uint32 owner_accid = objmgr.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);
|
||||
}
|
||||
}
|
||||
else if(!bidder)
|
||||
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid);
|
||||
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
|
||||
|
||||
// receiver exist
|
||||
if(bidder || bidder_accId)
|
||||
|
|
@ -134,7 +134,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
|
|||
sLog.outDebug( "AuctionWon body string : %s", msgAuctionWonBody.str().c_str() );
|
||||
|
||||
//prepare mail data... :
|
||||
uint32 itemTextId = objmgr.CreateItemText( msgAuctionWonBody.str() );
|
||||
uint32 itemTextId = sObjectMgr.CreateItemText( msgAuctionWonBody.str() );
|
||||
|
||||
// set owner to bidder (to prevent delete item with sender char deleting)
|
||||
// owner in `data` will set at mail receive and item extracting
|
||||
|
|
@ -163,10 +163,10 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
|
|||
void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
|
||||
{
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
Player *owner = objmgr.GetPlayer(owner_guid);
|
||||
Player *owner = sObjectMgr.GetPlayer(owner_guid);
|
||||
|
||||
// owner exist (online or offline)
|
||||
if(owner || objmgr.GetPlayerAccountIdByGUID(owner_guid))
|
||||
if(owner || sObjectMgr.GetPlayerAccountIdByGUID(owner_guid))
|
||||
{
|
||||
std::ostringstream msgAuctionSalePendingSubject;
|
||||
msgAuctionSalePendingSubject << auction->item_template << ":0:" << AUCTION_SALE_PENDING;
|
||||
|
|
@ -184,7 +184,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
|
|||
|
||||
sLog.outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str());
|
||||
|
||||
uint32 itemTextId = objmgr.CreateItemText( msgAuctionSalePendingBody.str() );
|
||||
uint32 itemTextId = sObjectMgr.CreateItemText( msgAuctionSalePendingBody.str() );
|
||||
|
||||
MailDraft(msgAuctionSalePendingSubject.str(), itemTextId)
|
||||
.SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_AUCTION);
|
||||
|
|
@ -195,11 +195,11 @@ void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
|
|||
void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
|
||||
{
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
Player *owner = objmgr.GetPlayer(owner_guid);
|
||||
Player *owner = sObjectMgr.GetPlayer(owner_guid);
|
||||
|
||||
uint32 owner_accId = 0;
|
||||
if(!owner)
|
||||
owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
|
||||
// owner exist
|
||||
if(owner || owner_accId)
|
||||
|
|
@ -217,7 +217,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
|
|||
|
||||
sLog.outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str());
|
||||
|
||||
uint32 itemTextId = objmgr.CreateItemText( auctionSuccessfulBody.str() );
|
||||
uint32 itemTextId = sObjectMgr.CreateItemText( auctionSuccessfulBody.str() );
|
||||
|
||||
uint32 profit = auction->bid + auction->deposit - auctionCut;
|
||||
|
||||
|
|
@ -246,11 +246,11 @@ void AuctionHouseMgr::SendAuctionExpiredMail( AuctionEntry * auction )
|
|||
}
|
||||
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
Player *owner = objmgr.GetPlayer(owner_guid);
|
||||
Player *owner = sObjectMgr.GetPlayer(owner_guid);
|
||||
|
||||
uint32 owner_accId = 0;
|
||||
if(!owner)
|
||||
owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
|
||||
|
||||
// owner exist
|
||||
if(owner || owner_accId)
|
||||
|
|
@ -388,7 +388,7 @@ void AuctionHouseMgr::LoadAuctions()
|
|||
aItem->startbid = fields[9].GetUInt32();
|
||||
aItem->deposit = fields[10].GetUInt32();
|
||||
|
||||
CreatureData const* auctioneerData = objmgr.GetCreatureData(aItem->auctioneer);
|
||||
CreatureData const* auctioneerData = sObjectMgr.GetCreatureData(aItem->auctioneer);
|
||||
if(!auctioneerData)
|
||||
{
|
||||
aItem->DeleteFromDB();
|
||||
|
|
@ -514,7 +514,7 @@ void AuctionHouseObject::Update()
|
|||
///- Either cancel the auction if there was no bidder
|
||||
if (itr->second->bidder == 0)
|
||||
{
|
||||
auctionmgr.SendAuctionExpiredMail( itr->second );
|
||||
sAuctionMgr.SendAuctionExpiredMail( itr->second );
|
||||
}
|
||||
///- Or perform the transaction
|
||||
else
|
||||
|
|
@ -522,13 +522,13 @@ 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
|
||||
auctionmgr.SendAuctionSuccessfulMail( itr->second );
|
||||
auctionmgr.SendAuctionWonMail( itr->second );
|
||||
sAuctionMgr.SendAuctionSuccessfulMail( itr->second );
|
||||
sAuctionMgr.SendAuctionWonMail( itr->second );
|
||||
}
|
||||
|
||||
///- In any case clear the auction
|
||||
itr->second->DeleteFromDB();
|
||||
auctionmgr.RemoveAItem(itr->second->item_guidlow);
|
||||
sAuctionMgr.RemoveAItem(itr->second->item_guidlow);
|
||||
delete itr->second;
|
||||
RemoveAuction(itr->first);
|
||||
}
|
||||
|
|
@ -573,7 +573,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 = auctionmgr.GetAItem(Aentry->item_guidlow);
|
||||
Item *item = sAuctionMgr.GetAItem(Aentry->item_guidlow);
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
|
|
@ -604,7 +604,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
|||
// local name
|
||||
if ( loc_idx >= 0 )
|
||||
{
|
||||
ItemLocale const *il = objmgr.GetItemLocale(proto->ItemId);
|
||||
ItemLocale const *il = sObjectMgr.GetItemLocale(proto->ItemId);
|
||||
if (il)
|
||||
{
|
||||
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
|
||||
|
|
@ -627,7 +627,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
|||
//this function inserts to WorldPacket auction's data
|
||||
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
|
||||
{
|
||||
Item *pItem = auctionmgr.GetAItem(item_guidlow);
|
||||
Item *pItem = sAuctionMgr.GetAItem(item_guidlow);
|
||||
if (!pItem)
|
||||
{
|
||||
sLog.outError("auction to item, that doesn't exist !!!!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue