aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorxinef1 <w.szyszko2@gmail.com>2017-03-02 02:19:25 +0100
committerShauren <shauren.trinity@gmail.com>2019-08-17 20:04:14 +0200
commit60663d1374beef3103f4787152654034fa4a8897 (patch)
tree38e07d44442ad903a9729536942e8e253a072274 /src/server/scripts/Commands
parent98180ecdc179386270e93b80c0db8344b659557f (diff)
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)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_server.cpp8
1 files changed, 5 insertions, 3 deletions
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;