[10363] More wide use ObjectGuid in way remove MAKE_NEW_GUID uses.

Also
* Fixed some amount wrong uses low guids as full player guids.
* Add private without body ObjectGuid(uint32 const&) for catch wrong assigns low guids to ObjectGuid.
  In some cases need assign "0" guid, then use ObjectGuid() instead.
* Fixed .pdump commands work.
This commit is contained in:
VladimirMangos 2010-08-17 02:16:15 +04:00
parent db7db6382a
commit 5f44c4da21
41 changed files with 369 additions and 323 deletions

View file

@ -84,7 +84,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
if(!pItem)
return;
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
ObjectGuid bidder_guid = ObjectGuid(HIGHGUID_PLAYER, auction->bidder);
Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
uint32 bidder_accId = 0;
@ -105,26 +105,27 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
bidder_security = sAccountMgr.GetSecurity(bidder_accId);
if(bidder_security > SEC_PLAYER ) // not do redundant DB requests
if (bidder_security > SEC_PLAYER ) // not do redundant DB requests
{
if(!sObjectMgr.GetPlayerNameByGUID(bidder_guid,bidder_name))
if (!sObjectMgr.GetPlayerNameByGUID(bidder_guid, bidder_name))
bidder_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
}
}
if( bidder_security > SEC_PLAYER )
if (bidder_security > SEC_PLAYER)
{
ObjectGuid owner_guid = ObjectGuid(HIGHGUID_PLAYER, auction->owner);
std::string owner_name;
if(!sObjectMgr.GetPlayerNameByGUID(auction->owner,owner_name))
if(!sObjectMgr.GetPlayerNameByGUID(owner_guid, owner_name))
owner_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
uint32 owner_accid = sObjectMgr.GetPlayerAccountIdByGUID(auction->owner);
uint32 owner_accid = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
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)
else if (!bidder)
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
// receiver exist
@ -169,7 +170,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
{
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
ObjectGuid owner_guid = ObjectGuid(HIGHGUID_PLAYER, auction->owner);
Player *owner = sObjectMgr.GetPlayer(owner_guid);
// owner exist (online or offline)
@ -199,7 +200,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
//call this method to send mail to auction owner, when auction is successful, it does not clear ram
void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
{
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
ObjectGuid owner_guid = ObjectGuid(HIGHGUID_PLAYER, auction->owner);
Player *owner = sObjectMgr.GetPlayer(owner_guid);
uint32 owner_accId = 0;
@ -249,7 +250,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail( AuctionEntry * auction )
return;
}
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
ObjectGuid owner_guid = ObjectGuid(HIGHGUID_PLAYER, auction->owner);
Player *owner = sObjectMgr.GetPlayer(owner_guid);
uint32 owner_accId = 0;