| 237 | } |
| 238 | |
| 239 | String CommandProcessor::tickrate(ConnectionId connectionId, String const& argumentsString) { |
| 240 | if (auto errorMsg = adminCheck(connectionId, "change the tick rate")) |
| 241 | return *errorMsg; |
| 242 | |
| 243 | auto arguments = m_parser.tokenizeToStringList(argumentsString); |
| 244 | |
| 245 | if (arguments.empty()) |
| 246 | return strf("Current tick rate is {:4.2f}Hz", 1.0f / ServerGlobalTimestep); |
| 247 | |
| 248 | float tickRate = clamp(lexicalCast<float>(arguments[0]), 5.f, 500.f); |
| 249 | m_universe->setTickRate(tickRate); |
| 250 | return strf("Set tick rate to {:4.2f}Hz", tickRate); |
| 251 | } |
| 252 | |
| 253 | String CommandProcessor::setTileProtection(ConnectionId connectionId, String const& argumentString) { |
| 254 | if (auto errorMsg = adminCheck(connectionId, "modify world properties")) { |
nothing calls this directly
no test coverage detected