mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
i.e. world update start
This commit is contained in:
committed by
Francesco Borzì
parent
1b7522ff0e
commit
51b8773528
@@ -31,6 +31,7 @@ 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"
|
||||
@@ -41,7 +42,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
|
||||
uint64 guid = _player->GetGUID();
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_CALENDAR [" UI64FMTD "]", guid);
|
||||
|
||||
time_t currTime = time(NULL);
|
||||
time_t currTime = GameTime::GetGameTime();
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 1000); // Average size if no instance
|
||||
|
||||
@@ -228,7 +229,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(NULL) - time_t(86400L)))
|
||||
if (time_t(eventPackedTime) < (GameTime::GetGameTime() - time_t(86400L)))
|
||||
{
|
||||
recvData.rfinish();
|
||||
return;
|
||||
@@ -320,7 +321,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(NULL) - time_t(86400L)))
|
||||
if (time_t(eventPackedTime) < (GameTime::GetGameTime() - time_t(86400L)))
|
||||
{
|
||||
recvData.rfinish();
|
||||
return;
|
||||
@@ -377,7 +378,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(NULL) - time_t(86400L)))
|
||||
if (time_t(eventTime) < (GameTime::GetGameTime() - time_t(86400L)))
|
||||
{
|
||||
recvData.rfinish();
|
||||
return;
|
||||
@@ -517,7 +518,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(NULL), 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);
|
||||
}
|
||||
@@ -549,7 +550,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recvData)
|
||||
if (CalendarInvite* invite = sCalendarMgr->GetInvite(inviteId))
|
||||
{
|
||||
invite->SetStatus(CalendarInviteStatus(status));
|
||||
invite->SetStatusTime(time(NULL));
|
||||
invite->SetStatusTime(GameTime::GetGameTime());
|
||||
|
||||
sCalendarMgr->UpdateInvite(invite);
|
||||
sCalendarMgr->SendCalendarEventStatus(*calendarEvent, *invite);
|
||||
@@ -613,7 +614,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(time(NULL));
|
||||
//invite->SetStatusTime(GameTime::GetGameTime());
|
||||
|
||||
sCalendarMgr->UpdateInvite(invite);
|
||||
sCalendarMgr->SendCalendarEventStatus(*calendarEvent, *invite);
|
||||
@@ -713,7 +714,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 = time(NULL);
|
||||
time_t currTime = GameTime::GetGameTime();
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, (add ? 4 : 0) + 4 + 4 + 4 + 8);
|
||||
if (add)
|
||||
@@ -731,7 +732,7 @@ void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add)
|
||||
|
||||
void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save, bool isExtended)
|
||||
{
|
||||
time_t currTime = time(NULL);
|
||||
time_t currTime = GameTime::GetGameTime();
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user