aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/CalendarHandler.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-11-09 13:33:26 +0100
committerShauren <shauren.trinity@gmail.com>2023-11-09 13:33:26 +0100
commit1eea1d11b14d2ae065ab0f1888fba3b1ef03874f (patch)
tree8e2b110023af2d87e8e62024ccbeecc8709c0836 /src/server/game/Handlers/CalendarHandler.cpp
parentf58ff3d0f748a4abeb7681981bd964aa7423ecc1 (diff)
Core: Update to 10.2.0
Diffstat (limited to 'src/server/game/Handlers/CalendarHandler.cpp')
-rw-r--r--src/server/game/Handlers/CalendarHandler.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index 346cc303315..209babfec10 100644
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -61,9 +61,9 @@ void WorldSession::HandleCalendarGetCalendar(WorldPackets::Calendar::CalendarGet
packet.ServerTime = currTime;
CalendarInviteStore playerInvites = sCalendarMgr->GetPlayerInvites(guid);
- for (auto const& invite : playerInvites)
+ for (CalendarInvite const* invite : playerInvites)
{
- WorldPackets::Calendar::CalendarSendCalendarInviteInfo inviteInfo;
+ WorldPackets::Calendar::CalendarSendCalendarInviteInfo& inviteInfo = packet.Invites.emplace_back();
inviteInfo.EventID = invite->GetEventId();
inviteInfo.InviteID = invite->GetInviteId();
inviteInfo.InviterGuid = invite->GetSenderGUID();
@@ -71,14 +71,12 @@ void WorldSession::HandleCalendarGetCalendar(WorldPackets::Calendar::CalendarGet
inviteInfo.Moderator = invite->GetRank();
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(invite->GetEventId()))
inviteInfo.InviteType = calendarEvent->IsGuildEvent() && calendarEvent->GetGuildId() == _player->GetGuildId();
-
- packet.Invites.push_back(inviteInfo);
}
CalendarEventStore playerEvents = sCalendarMgr->GetPlayerEvents(guid);
- for (auto const& event : playerEvents)
+ for (CalendarEvent const* event : playerEvents)
{
- WorldPackets::Calendar::CalendarSendCalendarEventInfo eventInfo;
+ WorldPackets::Calendar::CalendarSendCalendarEventInfo& eventInfo = packet.Events.emplace_back();
eventInfo.EventID = event->GetEventId();
eventInfo.Date = event->GetDate();
eventInfo.EventClubID = event->GetGuildId();
@@ -87,20 +85,15 @@ void WorldSession::HandleCalendarGetCalendar(WorldPackets::Calendar::CalendarGet
eventInfo.Flags = event->GetFlags();
eventInfo.OwnerGuid = event->GetOwnerGUID();
eventInfo.TextureID = event->GetTextureId();
-
- packet.Events.push_back(eventInfo);
}
for (InstanceLock const* lock : sInstanceLockMgr.GetInstanceLocksForPlayer(_player->GetGUID()))
{
- WorldPackets::Calendar::CalendarSendCalendarRaidLockoutInfo lockoutInfo;
-
+ WorldPackets::Calendar::CalendarSendCalendarRaidLockoutInfo& lockoutInfo = packet.RaidLockouts.emplace_back();
lockoutInfo.MapID = lock->GetMapId();
lockoutInfo.DifficultyID = lock->GetDifficultyId();
lockoutInfo.ExpireTime = int32(std::max(std::chrono::duration_cast<Seconds>(lock->GetEffectiveExpiryTime() - GameTime::GetSystemTime()).count(), SI64LIT(0)));
lockoutInfo.InstanceID = lock->GetInstanceId();
-
- packet.RaidLockouts.push_back(lockoutInfo);
}
SendPacket(packet.Write());