From 60663d1374beef3103f4787152654034fa4a8897 Mon Sep 17 00:00:00 2001 From: xinef1 Date: Thu, 2 Mar 2017 02:19:25 +0100 Subject: Ensure that all actions are compared to fixed point in time (ie. world update start) (#18910) - Actions will not be dependent on processing moment - Increased GameObjects cooldown resolution to milliseconds, fixes arming time of traps to be exactly one second and not something from range (1000, 1999) - Created GameTime namespace and UpdateTime class and moved there some code out of world (cherrypicked from 7567cafec84080d26ea513242a1f540a823b8f9d) --- src/server/scripts/Commands/cs_server.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index e7ce8d0845f..cd7adb4be82 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -27,6 +27,7 @@ EndScriptData */ #include "Config.h" #include "DatabaseEnv.h" #include "DatabaseLoader.h" +#include "GameTime.h" #include "GitRevision.h" #include "Language.h" #include "Log.h" @@ -34,6 +35,7 @@ EndScriptData */ #include "Player.h" #include "RBAC.h" #include "Realm.h" +#include "UpdateTime.h" #include "Util.h" #include "VMapFactory.h" #include "World.h" @@ -256,8 +258,8 @@ public: uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); - std::string uptime = secsToTimeString(sWorld->GetUptime()); - uint32 updateTime = sWorld->GetUpdateTime(); + std::string uptime = secsToTimeString(GameTime::GetUptime()); + uint32 updateTime = sWorldUpdateTime.GetLastUpdateTime(); handler->PSendSysMessage("%s", GitRevision::GetFullVersion()); handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum); @@ -455,7 +457,7 @@ public: if (newTime < 0) return false; - sWorld->SetRecordDiffInterval(newTime); + sWorldUpdateTime.SetRecordUpdateTimeInterval(newTime); printf("Record diff every %i ms\n", newTime); return true; -- cgit v1.2.3