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/StarUniverseClient.cpp | |
parent | 5f01d2d4d7c19e280f02cd2e0ecd73990f2373a4 (diff) |
make timescale a server command and add a tickrate command
Diffstat (limited to 'source/game/StarUniverseClient.cpp')
-rw-r--r-- | source/game/StarUniverseClient.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp index 57033f8..752d081 100644 --- a/source/game/StarUniverseClient.cpp +++ b/source/game/StarUniverseClient.cpp @@ -164,6 +164,7 @@ void UniverseClient::disconnect() { break; } + GlobalTimescale = 1.0f; reset(); m_mainPlayer = {}; } @@ -675,6 +676,7 @@ void UniverseClient::handlePackets(List<PacketPtr> const& packets) { m_celestialDatabase->invalidateCacheFor(planetTypeUpdate->coordinate); } else if (auto pausePacket = as<PausePacket>(packet)) { setPause(pausePacket->pause); + GlobalTimescale = clamp(pausePacket->timescale, 0.0f, 1024.f); } else if (auto serverInfoPacket = as<ServerInfoPacket>(packet)) { m_serverInfo = ServerInfo{serverInfoPacket->players, serverInfoPacket->maxPlayers}; } else if (!m_systemWorldClient->handleIncomingPacket(packet)) { |