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

Method timescale

source/game/StarCommandProcessor.cpp:225–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225String 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
239String CommandProcessor::tickrate(ConnectionId connectionId, String const& argumentsString) {
240 if (auto errorMsg = adminCheck(connectionId, "change the tick rate"))

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected