mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
refactor(Core/Cache): move the GlobalPlayerCache to its own class (#9166)
This commit is contained in:
@@ -78,7 +78,9 @@ void CalendarMgr::LoadFromDB()
|
||||
uint32 guildId = 0;
|
||||
|
||||
if (flags & CALENDAR_FLAG_GUILD_EVENT || flags & CALENDAR_FLAG_WITHOUT_INVITES)
|
||||
guildId = Player::GetGuildIdFromStorage(creatorGUID.GetCounter());
|
||||
{
|
||||
guildId = sCharacterCache->GetCharacterGuildIdByGuid(creatorGUID);
|
||||
}
|
||||
|
||||
CalendarEvent* calendarEvent = new CalendarEvent(eventId, creatorGUID, guildId, type, dungeonId, time_t(eventTime), flags, time_t(timezoneTime), title, description);
|
||||
_events.insert(calendarEvent);
|
||||
@@ -479,7 +481,7 @@ void CalendarMgr::SendCalendarEventInvite(CalendarInvite const& invite)
|
||||
ObjectGuid invitee = invite.GetInviteeGUID();
|
||||
Player* player = ObjectAccessor::FindConnectedPlayer(invitee);
|
||||
|
||||
uint8 level = player ? player->getLevel() : Player::GetLevelFromStorage(invitee.GetCounter());
|
||||
uint8 level = player ? player->getLevel() : sCharacterCache->GetCharacterLevelByGuid(invitee);
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_EVENT_INVITE, 8 + 8 + 8 + 1 + 1 + 1 + (statusTime ? 4 : 0) + 1);
|
||||
data << invitee.WriteAsPacked();
|
||||
@@ -624,8 +626,8 @@ void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calend
|
||||
ObjectGuid inviteeGuid = calendarInvite->GetInviteeGUID();
|
||||
Player* invitee = ObjectAccessor::FindConnectedPlayer(inviteeGuid);
|
||||
|
||||
uint8 inviteeLevel = invitee ? invitee->getLevel() : Player::GetLevelFromStorage(inviteeGuid.GetCounter());
|
||||
uint32 inviteeGuildId = invitee ? invitee->GetGuildId() : Player::GetGuildIdFromStorage(inviteeGuid.GetCounter());
|
||||
uint8 inviteeLevel = invitee ? invitee->getLevel() : sCharacterCache->GetCharacterLevelByGuid(inviteeGuid);
|
||||
uint32 inviteeGuildId = invitee ? invitee->GetGuildId() : sCharacterCache->GetCharacterGuildIdByGuid(inviteeGuid);
|
||||
|
||||
data << inviteeGuid.WriteAsPacked();
|
||||
data << uint8(inviteeLevel);
|
||||
|
||||
Reference in New Issue
Block a user