MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / tickrate

Method tickrate

source/game/StarCommandProcessor.cpp:239–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239String 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
253String CommandProcessor::setTileProtection(ConnectionId connectionId, String const& argumentString) {
254 if (auto errorMsg = adminCheck(connectionId, "modify world properties")) {

Callers

nothing calls this directly

Calls 5

strfFunction · 0.85
clampFunction · 0.85
tokenizeToStringListMethod · 0.80
setTickRateMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected