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

This reverts commit 51b8773528.
This commit is contained in:
Nefertumm
2019-02-15 15:14:49 -03:00
committed by GitHub
parent 23e7ae6a2f
commit c15206fc15
108 changed files with 509 additions and 933 deletions
@@ -9,7 +9,6 @@
#include "ArenaTeamMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "GameTime.h"
#include "ArenaTeam.h"
#include "BattlegroundMgr.h"
@@ -130,7 +129,7 @@ void BattlegroundMgr::Update(uint32 diff)
{
if (m_AutoDistributionTimeChecker < diff)
{
if (GameTime::GetGameTime() > m_NextAutoDistributionTime)
if (time(NULL) > m_NextAutoDistributionTime)
{
sArenaTeamMgr->DistributeArenaPoints();
m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
@@ -695,7 +694,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution()
return;
time_t wstime = time_t(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME));
time_t curtime = GameTime::GetGameTime();
time_t curtime = time(NULL);
sLog->outString("AzerothCore Battleground: Initializing Automatic Arena Point Distribution");
if (wstime < curtime)
{
@@ -1052,7 +1051,7 @@ void BattlegroundMgr::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, T
if (bg->isArena() && bg->isRated())
bg->SetArenaTeamIdForTeam(ginfo->teamId, ginfo->ArenaTeamId);
ginfo->RemoveInviteTime = GameTime::GetGameTimeMS() + INVITE_ACCEPT_WAIT_TIME;
ginfo->RemoveInviteTime = World::GetGameTimeMS() + INVITE_ACCEPT_WAIT_TIME;
// loop through the players
for (std::set<uint64>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
@@ -8,7 +8,6 @@
#include "ArenaTeamMgr.h"
#include "BattlegroundMgr.h"
#include "BattlegroundQueue.h"
#include "GameTime.h"
#include "Chat.h"
#include "Group.h"
#include "Log.h"
@@ -125,7 +124,7 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, PvPDiffi
ginfo->ArenaTeamId = arenateamid;
ginfo->IsRated = isRated;
ginfo->IsInvitedToBGInstanceGUID = 0;
ginfo->JoinTime = GameTime::GetGameTimeMS();
ginfo->JoinTime = World::GetGameTimeMS();
ginfo->RemoveInviteTime = 0;
ginfo->teamId = leader->GetTeamId();
ginfo->ArenaTeamRating = ArenaRating;
@@ -211,7 +210,7 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, PvPDiffi
void BattlegroundQueue::PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* ginfo)
{
uint32 timeInQueue = std::max<uint32>(1, getMSTimeDiff(ginfo->JoinTime, GameTime::GetGameTimeMS()));
uint32 timeInQueue = std::max<uint32>(1, getMSTimeDiff(ginfo->JoinTime, World::GetGameTimeMS()));
// team_index: bg alliance - TEAM_ALLIANCE, bg horde - TEAM_HORDE, arena skirmish - TEAM_ALLIANCE, arena rated - TEAM_HORDE
uint8 team_index;
@@ -539,7 +538,7 @@ bool BattlegroundQueue::CheckPremadeMatch(BattlegroundBracketId bracket_id, uint
// this happens if timer has expired or group size lowered
uint32 premade_time = sWorld->getIntConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
uint32 time_before = GameTime::GetGameTimeMS() >= premade_time ? GameTime::GetGameTimeMS() - premade_time : 0;
uint32 time_before = World::GetGameTimeMS() >= premade_time ? World::GetGameTimeMS() - premade_time : 0;
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty())
@@ -790,7 +789,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(BattlegroundBracketId bracket_id
{
// pussywizard: everything inside this section is mine, do NOT destroy!
const uint32 currMSTime = GameTime::GetGameTimeMS();
const uint32 currMSTime = World::GetGameTimeMS();
const uint32 discardTime = sBattlegroundMgr->GetRatingDiscardTimer();
const uint32 maxDefaultRatingDifference = (MaxPlayersPerTeam > 2 ? 300 : 200);
const uint32 maxCountedMMR = 2500;
@@ -10,7 +10,6 @@
#include "Creature.h"
#include "Language.h"
#include "Object.h"
#include "GameTime.h"
#include "Player.h"
#include "Util.h"
#include "WorldSession.h"
@@ -57,7 +56,7 @@ void BattlegroundEY::PostUpdateImpl(uint32 diff)
AddPoints(TEAM_ALLIANCE, BG_EY_TickPoints[_ownedPointsCount[TEAM_ALLIANCE] - 1]);
if (_ownedPointsCount[TEAM_HORDE] > 0)
AddPoints(TEAM_HORDE, BG_EY_TickPoints[_ownedPointsCount[TEAM_HORDE] - 1]);
_bgEvents.ScheduleEvent(BG_EY_EVENT_ADD_POINTS, BG_EY_FPOINTS_TICK_TIME - (GameTime::GetGameTimeMS() % BG_EY_FPOINTS_TICK_TIME));
_bgEvents.ScheduleEvent(BG_EY_EVENT_ADD_POINTS, BG_EY_FPOINTS_TICK_TIME - (World::GetGameTimeMS() % BG_EY_FPOINTS_TICK_TIME));
break;
case BG_EY_EVENT_FLAG_ON_GROUND:
RespawnFlagAfterDrop();
@@ -67,7 +66,7 @@ void BattlegroundEY::PostUpdateImpl(uint32 diff)
break;
case BG_EY_EVENT_CHECK_CPOINTS:
UpdatePointsState();
_bgEvents.ScheduleEvent(BG_EY_EVENT_CHECK_CPOINTS, BG_EY_FPOINTS_CHECK_TIME - (GameTime::GetGameTimeMS() % BG_EY_FPOINTS_CHECK_TIME));
_bgEvents.ScheduleEvent(BG_EY_EVENT_CHECK_CPOINTS, BG_EY_FPOINTS_CHECK_TIME - (World::GetGameTimeMS() % BG_EY_FPOINTS_CHECK_TIME));
break;
}
}
@@ -11,7 +11,6 @@
#include "WorldPacket.h"
#include "GameObject.h"
#include "ObjectMgr.h"
#include "GameTime.h"
#include "Vehicle.h"
#include "Transport.h"
#include "WorldSession.h"
@@ -128,7 +127,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
{
// Check if creature respawn time is properly saved
RespawnMap::iterator itr = respawnMap.find(catapult->GetGUIDLow());
if (itr == respawnMap.end() || GameTime::GetGameTime() < itr->second)
if (itr == respawnMap.end() || time(NULL) < itr->second)
continue;
catapult->Relocate(BG_IC_DocksVehiclesCatapults[j].GetPositionX(), BG_IC_DocksVehiclesCatapults[j].GetPositionY(), BG_IC_DocksVehiclesCatapults[j].GetPositionZ(), BG_IC_DocksVehiclesCatapults[j].GetOrientation());
@@ -146,7 +145,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
{
// Check if creature respawn time is properly saved
RespawnMap::iterator itr = respawnMap.find(glaiveThrower->GetGUIDLow());
if (itr == respawnMap.end() || GameTime::GetGameTime() < itr->second)
if (itr == respawnMap.end() || time(NULL) < itr->second)
continue;
glaiveThrower->Relocate(BG_IC_DocksVehiclesGlaives[j].GetPositionX(), BG_IC_DocksVehiclesGlaives[j].GetPositionY(), BG_IC_DocksVehiclesGlaives[j].GetPositionZ(), BG_IC_DocksVehiclesGlaives[j].GetOrientation());
@@ -175,7 +174,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
{
// Check if creature respawn time is properly saved
RespawnMap::iterator itr = respawnMap.find(siege->GetGUIDLow());
if (itr == respawnMap.end() || GameTime::GetGameTime() < itr->second)
if (itr == respawnMap.end() || time(NULL) < itr->second)
continue;
siege->Relocate(BG_IC_WorkshopVehicles[4].GetPositionX(), BG_IC_WorkshopVehicles[4].GetPositionY(), BG_IC_WorkshopVehicles[4].GetPositionZ(), BG_IC_WorkshopVehicles[4].GetOrientation());
@@ -193,7 +192,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
{
// Check if creature respawn time is properly saved
RespawnMap::iterator itr = respawnMap.find(demolisher->GetGUIDLow());
if (itr == respawnMap.end() || GameTime::GetGameTime() < itr->second)
if (itr == respawnMap.end() || time(NULL) < itr->second)
continue;
demolisher->Relocate(BG_IC_WorkshopVehicles[u].GetPositionX(), BG_IC_WorkshopVehicles[u].GetPositionY(), BG_IC_WorkshopVehicles[u].GetPositionZ(), BG_IC_WorkshopVehicles[u].GetOrientation());
@@ -521,7 +520,7 @@ void BattlegroundIC::HandleKillUnit(Creature* unit, Player* killer)
// Xinef: Add to respawn list
if (entry == NPC_DEMOLISHER || entry == NPC_SIEGE_ENGINE_H || entry == NPC_SIEGE_ENGINE_A ||
entry == NPC_GLAIVE_THROWER_A || entry == NPC_GLAIVE_THROWER_H || entry == NPC_CATAPULT)
respawnMap[unit->GetGUIDLow()] = GameTime::GetGameTime() + VEHICLE_RESPAWN_TIME;
respawnMap[unit->GetGUIDLow()] = time(NULL) + VEHICLE_RESPAWN_TIME;
}
}
@@ -868,7 +867,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
if (!siegeVehicle->IsVehicleInUse())
Unit::Kill(siegeEngine, siegeEngine);
respawnMap[siegeEngine->GetGUIDLow()] = GameTime::GetGameTime() + VEHICLE_RESPAWN_TIME;
respawnMap[siegeEngine->GetGUIDLow()] = time(NULL) + VEHICLE_RESPAWN_TIME;
}
}
@@ -9,7 +9,6 @@
#include "Player.h"
#include "GameObject.h"
#include "ObjectMgr.h"
#include "GameTime.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "GameGraveyard.h"
@@ -1060,11 +1059,11 @@ void BattlegroundSA::UpdateDemolisherSpawns()
// Demolisher is not in list
if (DemoliserRespawnList.find(i) == DemoliserRespawnList.end())
{
DemoliserRespawnList[i] = GameTime::GetGameTimeMS()+30000;
DemoliserRespawnList[i] = World::GetGameTimeMS()+30000;
}
else
{
if (DemoliserRespawnList[i] < GameTime::GetGameTimeMS())
if (DemoliserRespawnList[i] < World::GetGameTimeMS())
{
Demolisher->Relocate(BG_SA_NpcSpawnlocs[i][0], BG_SA_NpcSpawnlocs[i][1],
BG_SA_NpcSpawnlocs[i][2], BG_SA_NpcSpawnlocs[i][3]);