feat(Core/Time): Implement saparated manager for game time (#8630)

This commit is contained in:
Kargatum
2022-01-24 17:55:00 +07:00
committed by GitHub
parent 12da792a90
commit 8b7df23f06
129 changed files with 1147 additions and 817 deletions

View File

@@ -16,6 +16,7 @@
*/
#include "CalendarMgr.h"
#include "GameTime.h"
#include "GuildMgr.h"
#include "Log.h"
#include "ObjectAccessor.h"
@@ -24,6 +25,9 @@
#include "QueryResult.h"
#include <unordered_map>
CalendarInvite::CalendarInvite() : _inviteId(1), _eventId(0), _statusTime(GameTime::GetGameTime().count()),
_status(CALENDAR_STATUS_INVITED), _rank(CALENDAR_RANK_PLAYER), _text("") { }
CalendarInvite::~CalendarInvite()
{
// Free _inviteId only if it's a real invite and not just a pre-invite or guild announcement
@@ -358,7 +362,7 @@ uint64 CalendarMgr::GetFreeInviteId()
void CalendarMgr::DeleteOldEvents()
{
time_t oldEventsTime = time(nullptr) - CALENDAR_OLD_EVENTS_DELETION_TIME;
time_t oldEventsTime = GameTime::GetGameTime().count() - CALENDAR_OLD_EVENTS_DELETION_TIME;
for (CalendarEventStore::const_iterator itr = _events.begin(); itr != _events.end();)
{