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

@@ -18,6 +18,7 @@
#include "InstanceSaveMgr.h"
#include "Common.h"
#include "Config.h"
#include "GameTime.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
@@ -93,7 +94,7 @@ InstanceSave* InstanceSaveMgr::AddInstanceSave(uint32 mapId, uint32 instanceId,
}
else
{
resetTime = time(nullptr) + 3 * DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup
resetTime = GameTime::GetGameTime().count() + 3 * DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup
extendedResetTime = 0;
}
InstanceSave* save = new InstanceSave(mapId, instanceId, difficulty, resetTime, extendedResetTime);
@@ -260,7 +261,7 @@ void InstanceSaveMgr::LoadInstances()
void InstanceSaveMgr::LoadResetTimes()
{
time_t now = time(nullptr);
time_t now = GameTime::GetGameTime().count();
time_t today = (now / DAY) * DAY;
// load the global respawn times for raid/heroic instances
@@ -423,7 +424,7 @@ void InstanceSaveMgr::ScheduleReset(time_t time, InstResetEvent event)
void InstanceSaveMgr::Update()
{
time_t now = time(nullptr);
time_t now = GameTime::GetGameTime().count();
time_t t;
bool resetOccurred = false;
@@ -522,7 +523,7 @@ void InstanceSaveMgr::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool
if (!mapEntry->Instanceable())
return;
time_t now = time(nullptr);
time_t now = GameTime::GetGameTime().count();
if (!warn)
{