mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 15:16:24 +00:00
feat(Core/Time): Implement saparated manager for game time (#8630)
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "DBCStores.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "GameTime.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
@@ -278,7 +279,7 @@ namespace lfg
|
||||
|
||||
if (task == 0)
|
||||
{
|
||||
time_t currTime = time(nullptr);
|
||||
time_t currTime = GameTime::GetGameTime().count();
|
||||
|
||||
// Remove obsolete role checks
|
||||
for (LfgRoleCheckContainer::iterator it = RoleChecksStore.begin(); it != RoleChecksStore.end();)
|
||||
@@ -716,7 +717,7 @@ namespace lfg
|
||||
// Create new rolecheck
|
||||
LfgRoleCheck& roleCheck = RoleChecksStore[gguid];
|
||||
roleCheck.roles.clear(); // pussywizard: NEW rolecheck, not old one with trash data >_>
|
||||
roleCheck.cancelTime = time_t(time(nullptr)) + LFG_TIME_ROLECHECK;
|
||||
roleCheck.cancelTime = time_t(GameTime::GetGameTime().count()) + LFG_TIME_ROLECHECK;
|
||||
roleCheck.state = LFG_ROLECHECK_INITIALITING;
|
||||
roleCheck.leader = guid;
|
||||
roleCheck.dungeons = dungeons;
|
||||
@@ -754,7 +755,7 @@ namespace lfg
|
||||
LfgRolesMap rolesMap;
|
||||
rolesMap[guid] = roles;
|
||||
LFGQueue& queue = GetQueue(guid);
|
||||
queue.AddQueueData(guid, time(nullptr), dungeons, rolesMap);
|
||||
queue.AddQueueData(guid, GameTime::GetGameTime().count(), dungeons, rolesMap);
|
||||
|
||||
if (!isContinue)
|
||||
{
|
||||
@@ -964,8 +965,10 @@ namespace lfg
|
||||
m_raidBrowserUpdateTimer[team] = 0;
|
||||
}
|
||||
|
||||
if (getMSTimeDiff(World::GetGameTimeMS(), getMSTime()) > (70 * 7) / 5) // prevent lagging
|
||||
if (GetMSTimeDiff(GameTime::GetGameTimeMS(), GetTimeMS()) > 98ms) // prevent lagging
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectGuid guid, groupGuid, instanceGuid;
|
||||
uint8 level, Class, race, talents[3];
|
||||
@@ -1444,7 +1447,7 @@ namespace lfg
|
||||
{
|
||||
SetState(gguid, LFG_STATE_QUEUED);
|
||||
LFGQueue& queue = GetQueue(gguid);
|
||||
queue.AddQueueData(gguid, time_t(time(nullptr)), roleCheck.dungeons, roleCheck.roles);
|
||||
queue.AddQueueData(gguid, time_t(GameTime::GetGameTime().count()), roleCheck.dungeons, roleCheck.roles);
|
||||
RoleChecksStore.erase(itRoleCheck);
|
||||
}
|
||||
else if (roleCheck.state != LFG_ROLECHECK_INITIALITING)
|
||||
@@ -1809,7 +1812,7 @@ namespace lfg
|
||||
|
||||
bool sendUpdate = proposal.state != LFG_PROPOSAL_SUCCESS;
|
||||
proposal.state = LFG_PROPOSAL_SUCCESS;
|
||||
time_t joinTime = time(nullptr);
|
||||
time_t joinTime = GameTime::GetGameTime().count();
|
||||
|
||||
LFGQueue& queue = GetQueue(guid);
|
||||
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND);
|
||||
@@ -1987,7 +1990,7 @@ namespace lfg
|
||||
|
||||
LfgPlayerBoot& boot = BootsStore[gguid];
|
||||
boot.inProgress = true;
|
||||
boot.cancelTime = time_t(time(nullptr)) + LFG_TIME_BOOT;
|
||||
boot.cancelTime = time_t(GameTime::GetGameTime().count()) + LFG_TIME_BOOT;
|
||||
boot.reason = reason;
|
||||
boot.victim = victim;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user