aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/CalendarHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/CalendarHandler.cpp')
-rw-r--r--src/server/game/Handlers/CalendarHandler.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index 4384ff82474..b239a771615 100644
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -42,6 +42,7 @@ Copied events should probably have a new owner
#include "DatabaseEnv.h"
#include "DBCStores.h"
#include "GameEventMgr.h"
+#include "GameTime.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "InstanceSaveMgr.h"
@@ -58,7 +59,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
ObjectGuid guid = _player->GetGUID();
TC_LOG_DEBUG("network", "CMSG_CALENDAR_GET_CALENDAR [%s]", guid.ToString().c_str());
- time_t currTime = time(nullptr);
+ time_t currTime = GameTime::GetGameTime();
WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 1000); // Average size if no instance
@@ -239,7 +240,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData)
// prevent events in the past
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
- if (time_t(eventPackedTime) < (time(nullptr) - time_t(86400L)))
+ if (time_t(eventPackedTime) < (GameTime::GetGameTime() - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -332,7 +333,7 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recvData)
// prevent events in the past
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
- if (time_t(eventPackedTime) < (time(nullptr) - time_t(86400L)))
+ if (time_t(eventPackedTime) < (GameTime::GetGameTime() - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -389,7 +390,7 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData)
// prevent events in the past
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
- if (time_t(eventTime) < (time(nullptr) - time_t(86400L)))
+ if (time_t(eventTime) < (GameTime::GetGameTime() - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -532,7 +533,7 @@ void WorldSession::HandleCalendarEventSignup(WorldPacket& recvData)
}
CalendarInviteStatus status = tentative ? CALENDAR_STATUS_TENTATIVE : CALENDAR_STATUS_SIGNED_UP;
- CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), eventId, guid, guid, time(nullptr), status, CALENDAR_RANK_PLAYER, "");
+ CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), eventId, guid, guid, GameTime::GetGameTime(), status, CALENDAR_RANK_PLAYER, "");
sCalendarMgr->AddInvite(calendarEvent, invite);
sCalendarMgr->SendCalendarClearPendingAction(guid);
}
@@ -564,7 +565,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recvData)
if (CalendarInvite* invite = sCalendarMgr->GetInvite(inviteId))
{
invite->SetStatus(CalendarInviteStatus(status));
- invite->SetStatusTime(time(nullptr));
+ invite->SetStatusTime(GameTime::GetGameTime());
sCalendarMgr->UpdateInvite(invite);
sCalendarMgr->SendCalendarEventStatus(*calendarEvent, *invite);
@@ -733,7 +734,7 @@ void WorldSession::HandleSetSavedInstanceExtend(WorldPacket& recvData)
void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add)
{
TC_LOG_DEBUG("network", "%s", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED");
- time_t currTime = time(nullptr);
+ time_t currTime = GameTime::GetGameTime();
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, (add ? 4 : 0) + 4 + 4 + 4 + 8);
if (add)
@@ -758,7 +759,7 @@ void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save)
TC_LOG_DEBUG("network", "SMSG_CALENDAR_RAID_LOCKOUT_UPDATED [%s] Map: %u, Difficulty %u",
guid.ToString().c_str(), save->GetMapId(), save->GetDifficulty());
- time_t currTime = time(nullptr);
+ time_t currTime = GameTime::GetGameTime();
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8);
data.AppendPackedTime(currTime);