Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarClientCommandProcessor.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-03-19 13:35:55 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-03-19 13:35:55 +1100
commit5ca42599ef52236274938dba9bd6e113611cb734 (patch)
treed8eea4d1064ba0821f173f3f154646c142d21884 /source/frontend/StarClientCommandProcessor.cpp
parent5f01d2d4d7c19e280f02cd2e0ecd73990f2373a4 (diff)
make timescale a server command and add a tickrate command
Diffstat (limited to 'source/frontend/StarClientCommandProcessor.cpp')
-rw-r--r--source/frontend/StarClientCommandProcessor.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/source/frontend/StarClientCommandProcessor.cpp b/source/frontend/StarClientCommandProcessor.cpp
index 8434043..52882d9 100644
--- a/source/frontend/StarClientCommandProcessor.cpp
+++ b/source/frontend/StarClientCommandProcessor.cpp
@@ -51,8 +51,7 @@ ClientCommandProcessor::ClientCommandProcessor(UniverseClientPtr universeClient,
{"maketechavailable", bind(&ClientCommandProcessor::makeTechAvailable, this, _1)},
{"enabletech", bind(&ClientCommandProcessor::enableTech, this, _1)},
{"upgradeship", bind(&ClientCommandProcessor::upgradeShip, this, _1)},
- {"swap", bind(&ClientCommandProcessor::swap, this, _1)},
- {"timescale", bind(&ClientCommandProcessor::timeScale, this, _1)}
+ {"swap", bind(&ClientCommandProcessor::swap, this, _1)}
};
}
@@ -381,7 +380,7 @@ String ClientCommandProcessor::makeTechAvailable(String const& argumentsString)
return "You must be an admin to use this command.";
if (arguments.size() == 0)
- return "Not enouch arguments to /maketechavailable";
+ return "Not enough arguments to /maketechavailable";
m_universeClient->mainPlayer()->techs()->makeAvailable(arguments.at(0));
return strf("Added {} to player's visible techs", arguments.at(0));
@@ -393,7 +392,7 @@ String ClientCommandProcessor::enableTech(String const& argumentsString) {
return "You must be an admin to use this command.";
if (arguments.size() == 0)
- return "Not enouch arguments to /enabletech";
+ return "Not enough arguments to /enabletech";
m_universeClient->mainPlayer()->techs()->makeAvailable(arguments.at(0));
m_universeClient->mainPlayer()->techs()->enable(arguments.at(0));
@@ -406,7 +405,7 @@ String ClientCommandProcessor::upgradeShip(String const& argumentsString) {
return "You must be an admin to use this command.";
if (arguments.size() == 0)
- return "Not enouch arguments to /upgradeship";
+ return "Not enough arguments to /upgradeship";
auto shipUpgrades = Json::parseJson(arguments.at(0));
m_universeClient->rpcInterface()->invokeRemote("ship.applyShipUpgrades", shipUpgrades);
@@ -417,7 +416,7 @@ String ClientCommandProcessor::swap(String const& argumentsString) {
auto arguments = m_parser.tokenizeToStringList(argumentsString);
if (arguments.size() == 0)
- return "Not enouch arguments to /swap";
+ return "Not enough arguments to /swap";
if (m_universeClient->switchPlayer(arguments[0]))
return "Successfully swapped player";
@@ -425,14 +424,4 @@ String ClientCommandProcessor::swap(String const& argumentsString) {
return "Failed to swap player";
}
-String ClientCommandProcessor::timeScale(String const& argumentsString) {
- auto arguments = m_parser.tokenizeToStringList(argumentsString);
-
- if (arguments.size() == 0)
- return "Not enouch arguments to /timescale";
-
- GlobalTimescale = clamp(lexicalCast<float>(arguments[0]), 0.001f, 256.0f);
- return strf("Set application timescale to {:6.6f}x", GlobalTimescale);
-}
-
}