From 49afa899a8169bcde3eecffe9944d096ffcd7d2e Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Thu, 13 Jul 2023 19:20:58 +1000 Subject: Make server tickrate configurable --- source/server/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/server/main.cpp') diff --git a/source/server/main.cpp b/source/server/main.cpp index 8d734e0..08b55dd 100644 --- a/source/server/main.cpp +++ b/source/server/main.cpp @@ -47,6 +47,13 @@ int main(int argc, char** argv) { { Logger::info("Server Version {} ({}) Source ID: {} Protocol: {}", StarVersionString, StarArchitectureString, StarSourceIdentifierString, StarProtocolVersion); + float updateRate = 1.0f / WorldTimestep; + if (auto jUpdateRate = configuration->get("updateRate")) { + updateRate = jUpdateRate.toFloat(); + WorldTimestep = 1.0f / updateRate; + Logger::info("Configured tickrate is {:4.2f}hz", updateRate); + } + UniverseServerUPtr server = make_unique(root->toStoragePath("universe")); server->setListeningTcp(true); server->start(); -- cgit v1.2.3