Revert "feat(core): Ensure that all actions are compared to fixed point in time (#1236) (#1458)" (#1471)

This reverts commit 51b8773528.
This commit is contained in:
Nefertumm
2019-02-15 15:14:49 -03:00
committed by GitHub
parent 23e7ae6a2f
commit c15206fc15
108 changed files with 509 additions and 933 deletions

View File

@@ -31,7 +31,6 @@ Copied events should probably have a new owner
#include "ObjectMgr.h"
#include "ObjectAccessor.h"
#include "DatabaseEnv.h"
#include "GameTime.h"
#include "GuildMgr.h"
#include "ArenaTeamMgr.h"
#include "WorldSession.h"
@@ -42,7 +41,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
uint64 guid = _player->GetGUID();
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_CALENDAR [" UI64FMTD "]", guid);
time_t currTime = GameTime::GetGameTime();
time_t currTime = time(NULL);
WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 1000); // Average size if no instance
@@ -229,7 +228,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) < (GameTime::GetGameTime() - time_t(86400L)))
if (time_t(eventPackedTime) < (time(NULL) - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -321,7 +320,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) < (GameTime::GetGameTime() - time_t(86400L)))
if (time_t(eventPackedTime) < (time(NULL) - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -378,7 +377,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) < (GameTime::GetGameTime() - time_t(86400L)))
if (time_t(eventTime) < (time(NULL) - time_t(86400L)))
{
recvData.rfinish();
return;
@@ -518,7 +517,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, GameTime::GetGameTime(), status, CALENDAR_RANK_PLAYER, "");
CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), eventId, guid, guid, time(NULL), status, CALENDAR_RANK_PLAYER, "");
sCalendarMgr->AddInvite(calendarEvent, invite);
sCalendarMgr->SendCalendarClearPendingAction(guid);
}
@@ -550,7 +549,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recvData)
if (CalendarInvite* invite = sCalendarMgr->GetInvite(inviteId))
{
invite->SetStatus(CalendarInviteStatus(status));
invite->SetStatusTime(GameTime::GetGameTime());
invite->SetStatusTime(time(NULL));
sCalendarMgr->UpdateInvite(invite);
sCalendarMgr->SendCalendarEventStatus(*calendarEvent, *invite);
@@ -614,7 +613,7 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recvData)
{
invite->SetStatus((CalendarInviteStatus)status);
// not sure if we should set response time when moderator changes invite status
//invite->SetStatusTime(GameTime::GetGameTime());
//invite->SetStatusTime(time(NULL));
sCalendarMgr->UpdateInvite(invite);
sCalendarMgr->SendCalendarEventStatus(*calendarEvent, *invite);
@@ -714,7 +713,7 @@ void WorldSession::HandleSetSavedInstanceExtend(WorldPacket& recvData)
void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED");
time_t currTime = GameTime::GetGameTime();
time_t currTime = time(NULL);
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, (add ? 4 : 0) + 4 + 4 + 4 + 8);
if (add)
@@ -732,7 +731,7 @@ void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add)
void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save, bool isExtended)
{
time_t currTime = GameTime::GetGameTime();
time_t currTime = time(NULL);
time_t resetTime = isExtended ? save->GetExtendedResetTime() : save->GetResetTime();
time_t resetTimeOp = isExtended ? save->GetResetTime() : save->GetExtendedResetTime();
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8);