Make server tickrate configurable
This commit is contained in:
parent
dbb998459b
commit
49afa899a8
@ -47,6 +47,13 @@ int main(int argc, char** argv) {
|
|||||||
{
|
{
|
||||||
Logger::info("Server Version {} ({}) Source ID: {} Protocol: {}", StarVersionString, StarArchitectureString, StarSourceIdentifierString, StarProtocolVersion);
|
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"));
|
UniverseServerUPtr server = make_unique<UniverseServer>(root->toStoragePath("universe"));
|
||||||
server->setListeningTcp(true);
|
server->setListeningTcp(true);
|
||||||
server->start();
|
server->start();
|
||||||
|
Loading…
Reference in New Issue
Block a user