From 0e3039d44cc215d4b1394c5a64c6e2c01a751b1d Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 27 Aug 2020 15:55:11 +0200 Subject: Added a "reloadweb" command for reloading web admin config. --- src/Server.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Server.cpp b/src/Server.cpp index 372437265..d9a0ced27 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -455,7 +455,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac // "stop" and "restart" are handled in cRoot::ExecuteConsoleCommand, our caller, due to its access to controlling variables - // "help" and "reload" are to be handled by MCS, so that they work no matter what + // "help" and "reload" are to be handled by Cuberite, so that they work no matter what if (split[0] == "help") { PrintHelp(split, a_Output); @@ -475,6 +475,13 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac a_Output.Finished(); return; } + else if (split[0] == "reloadweb") + { + cRoot::Get()->GetWebAdmin()->Reload(); + a_Output.Out("WebAdmin configuration reloaded"); + a_Output.Finished(); + return; + } else if (split[0] == "load") { if (split.size() > 1) @@ -617,6 +624,7 @@ void cServer::BindBuiltInConsoleCommands(void) cPluginManager * PlgMgr = cPluginManager::Get(); PlgMgr->BindConsoleCommand("help", nullptr, handler, "Shows the available commands"); PlgMgr->BindConsoleCommand("reload", nullptr, handler, "Reloads all plugins"); + PlgMgr->BindConsoleCommand("reloadweb", nullptr, handler, "Reloads the webadmin configuration"); PlgMgr->BindConsoleCommand("restart", nullptr, handler, "Restarts the server cleanly"); PlgMgr->BindConsoleCommand("stop", nullptr, handler, "Stops the server cleanly"); PlgMgr->BindConsoleCommand("chunkstats", nullptr, handler, "Displays detailed chunk memory statistics"); -- cgit v1.2.3