summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2023-05-11 22:05:17 +0200
committerMattes D <github@xoft.cz>2023-05-16 23:50:37 +0200
commitc9522fb740200ccef6230cec452c48efb31e5394 (patch)
tree7e74d70699e13dd0a92444a1a0add7a3059ac7ca /src/Server.cpp
parentTry a timeout for jobs. (diff)
downloadcuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.gz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.bz2
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.lz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.xz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.zst
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.zip
Diffstat (limited to 'src/Server.cpp')
-rw-r--r--src/Server.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 36964d41c..a3953db5a 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -489,7 +489,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
if (split.size() > 1)
{
cPluginManager::Get()->ReloadPlugin(split[1]);
- a_Output.Out("Plugin reload scheduled");
+ a_Output.OutLn("Plugin reload scheduled");
}
else
{
@@ -501,14 +501,14 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
else if (split[0] == "reloadplugins")
{
cPluginManager::Get()->ReloadPlugins();
- a_Output.Out("Plugins reloaded");
+ a_Output.OutLn("Plugins reloaded");
a_Output.Finished();
return;
}
else if (split[0] == "reloadweb")
{
cRoot::Get()->GetWebAdmin()->Reload();
- a_Output.Out("WebAdmin configuration reloaded");
+ a_Output.OutLn("WebAdmin configuration reloaded");
a_Output.Finished();
return;
}
@@ -517,11 +517,11 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
if (split.size() > 1)
{
cPluginManager::Get()->RefreshPluginList(); // Refresh the plugin list, so that if the plugin was added just now, it is loadable
- a_Output.Out(cPluginManager::Get()->LoadPlugin(split[1]) ? "Plugin loaded" : "Error occurred loading plugin");
+ a_Output.OutLn(cPluginManager::Get()->LoadPlugin(split[1]) ? "Plugin loaded" : "Error occurred loading plugin");
}
else
{
- a_Output.Out("Usage: load <PluginFolder>");
+ a_Output.OutLn("Usage: load <PluginFolder>");
}
a_Output.Finished();
return;
@@ -531,11 +531,11 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
if (split.size() > 1)
{
cPluginManager::Get()->UnloadPlugin(split[1]);
- a_Output.Out("Plugin unload scheduled");
+ a_Output.OutLn("Plugin unload scheduled");
}
else
{
- a_Output.Out("Usage: unload <PluginFolder>");
+ a_Output.OutLn("Usage: unload <PluginFolder>");
}
a_Output.Finished();
return;
@@ -556,7 +556,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
return false;
}
);
- a_Output.Out("Destroyed all entities");
+ a_Output.OutLn("Destroyed all entities");
a_Output.Finished();
return;
}
@@ -571,7 +571,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
else if (split[0].compare("luastats") == 0)
{
- a_Output.Out(cLuaStateTracker::GetStats());
+ a_Output.OutLn(cLuaStateTracker::GetStats());
a_Output.Finished();
return;
}
@@ -581,7 +581,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
return;
}
- a_Output.Out("Unknown command, type 'help' for all commands.");
+ a_Output.OutLn("Unknown command, type 'help' for all commands.");
a_Output.Finished();
}
@@ -624,7 +624,8 @@ void cServer::PrintHelp(const AStringVector & a_Split, cCommandOutputCallback &
for (AStringPairs::const_iterator itr = Callback.m_Commands.begin(), end = Callback.m_Commands.end(); itr != end; ++itr)
{
const AStringPair & cmd = *itr;
- a_Output.Out(Printf("%-*s - %s\n", static_cast<int>(Callback.m_MaxLen), cmd.first.c_str(), cmd.second.c_str()));
+ // Output the commands and their help strings, with all the commands aligned to the same width
+ a_Output.OutLn(fmt::format(FMT_STRING("{1:{0}s} - {2}"), Callback.m_MaxLen, cmd.first, cmd.second));
} // for itr - Callback.m_Commands[]
}