diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-03-19 13:35:55 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-03-19 13:35:55 +1100 |
commit | 5ca42599ef52236274938dba9bd6e113611cb734 (patch) | |
tree | d8eea4d1064ba0821f173f3f154646c142d21884 /source/game/StarWorldServerThread.cpp | |
parent | 5f01d2d4d7c19e280f02cd2e0ecd73990f2373a4 (diff) |
make timescale a server command and add a tickrate command
Diffstat (limited to 'source/game/StarWorldServerThread.cpp')
-rw-r--r-- | source/game/StarWorldServerThread.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/game/StarWorldServerThread.cpp b/source/game/StarWorldServerThread.cpp index c03c938..5d126ab 100644 --- a/source/game/StarWorldServerThread.cpp +++ b/source/game/StarWorldServerThread.cpp @@ -207,7 +207,7 @@ void WorldServerThread::run() { double storageInterval = root.assets()->json("/universe_server.config:worldStorageInterval").toDouble() / 1000.0; Timer storageTimer = Timer::withTime(storageInterval); - TickRateApproacher tickApproacher(1.0 / ServerGlobalTimestep, updateMeasureWindow); + TickRateApproacher tickApproacher(1.0f / ServerGlobalTimestep, updateMeasureWindow); double fidelityScore = 0.0; WorldServerFidelity automaticFidelity = WorldServerFidelity::Medium; @@ -217,6 +217,7 @@ void WorldServerThread::run() { LogMap::set(strf("server_{}_update", m_worldId), strf("{:4.2f}Hz", tickApproacher.rate())); update(fidelity); + tickApproacher.setTargetTickRate(1.0f / ServerGlobalTimestep); tickApproacher.tick(); if (storageTimer.timeUp()) { |