refactor(Core/Cache): move the GlobalPlayerCache to its own class (#9166)

This commit is contained in:
Skjalf
2021-11-18 12:53:36 -03:00
committed by GitHub
parent 00dc369cb6
commit 731d256420
47 changed files with 898 additions and 595 deletions

View File

@@ -17,6 +17,7 @@
#include "AuctionHouseMgr.h"
#include "BattlegroundMgr.h"
#include "CharacterCache.h"
#include "CalendarMgr.h"
#include "DatabaseEnv.h"
#include "Item.h"
@@ -146,7 +147,9 @@ void MailDraft::SendReturnToSender(uint32 /*sender_acc*/, ObjectGuid::LowType se
uint32 rc_account = 0;
if (!receiver)
rc_account = sObjectMgr->GetPlayerAccountIdByGUID(receiver_guid);
{
rc_account = sCharacterCache->GetCharacterAccountIdByGuid(ObjectGuid(HighGuid::Player, receiver_guid));
}
if (!receiver && !rc_account) // sender not exist
{
@@ -250,8 +253,7 @@ void MailDraft::SendMailTo(CharacterDatabaseTransaction trans, MailReceiver cons
trans->Append(stmt);
}
// xinef: update global data
sWorld->UpdateGlobalPlayerMails(receiver.GetPlayerGUIDLow(), 1);
sCharacterCache->IncreaseCharacterMailCount(ObjectGuid(HighGuid::Player, receiver.GetPlayerGUIDLow()));
// For online receiver update in game mail status and data
if (pReceiver)