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

i.e. world update start
This commit is contained in:
Viste(Кирилл)
2019-02-14 21:22:17 +03:00
committed by Francesco Borzì
parent 1b7522ff0e
commit 51b8773528
108 changed files with 933 additions and 509 deletions

View File

@@ -18,6 +18,7 @@
#include "Containers.h"
#include "DBCStructure.h"
#include "DBCStores.h"
#include "GameTime.h"
#include "Group.h"
#include "LFGQueue.h"
#include "LFGMgr.h"
@@ -29,6 +30,9 @@
namespace lfg
{
LfgQueueData::LfgQueueData() : joinTime(GameTime::GetGameTime()), lastRefreshTime(joinTime), tanks(LFG_TANKS_NEEDED), healers(LFG_HEALERS_NEEDED), dps(LFG_DPS_NEEDED)
{ }
void LFGQueue::AddToQueue(uint64 guid, bool failedProposal)
{
//sLog->outString("ADD AddToQueue: %u, failed proposal: %u", GUID_LOPART(guid), failedProposal ? 1 : 0);
@@ -409,7 +413,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const
return LFG_COMPATIBILITY_PENDING;
// Create a new proposal
proposal.cancelTime = time(NULL) + LFG_TIME_PROPOSAL;
proposal.cancelTime = GameTime::GetGameTime() + LFG_TIME_PROPOSAL;
proposal.state = LFG_PROPOSAL_INITIATING;
proposal.leader = 0;
proposal.dungeonId = Trinity::Containers::SelectRandomContainerElement(proposalDungeons);
@@ -445,7 +449,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const
void LFGQueue::UpdateQueueTimers(uint32 diff)
{
time_t currTime = time(NULL);
time_t currTime = GameTime::GetGameTime();
bool sendQueueStatus = false;
if (m_QueueStatusTimer > LFG_QUEUEUPDATE_INTERVAL)