diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-13 19:20:58 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-13 19:20:58 +1000 |
commit | 49afa899a8169bcde3eecffe9944d096ffcd7d2e (patch) | |
tree | c8e14487f675e20f6b66a1540cfc203ba390738d /source/server | |
parent | dbb998459b8481f474f791423789951f0e217565 (diff) |
Make server tickrate configurable
Diffstat (limited to 'source/server')
-rw-r--r-- | source/server/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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<UniverseServer>(root->toStoragePath("universe")); server->setListeningTcp(true); server->start(); |