| 223 | } |
| 224 | |
| 225 | String CommandProcessor::timescale(ConnectionId connectionId, String const& argumentsString) { |
| 226 | if (auto errorMsg = adminCheck(connectionId, "mess with time")) |
| 227 | return *errorMsg; |
| 228 | |
| 229 | auto arguments = m_parser.tokenizeToStringList(argumentsString); |
| 230 | |
| 231 | if (arguments.empty()) |
| 232 | return strf("Current timescale is {:6.6f}x", GlobalTimescale); |
| 233 | |
| 234 | float timescale = clamp(lexicalCast<float>(arguments[0]), 0.001f, 32.0f); |
| 235 | m_universe->setTimescale(timescale); |
| 236 | return strf("Set timescale to {:6.6f}x", timescale); |
| 237 | } |
| 238 | |
| 239 | String CommandProcessor::tickrate(ConnectionId connectionId, String const& argumentsString) { |
| 240 | if (auto errorMsg = adminCheck(connectionId, "change the tick rate")) |
nothing calls this directly
no test coverage detected