diff --git a/LLHelper/command.cpp b/LLHelper/command.cpp index a77c28bc..56313e59 100644 --- a/LLHelper/command.cpp +++ b/LLHelper/command.cpp @@ -12,6 +12,8 @@ #include #include #include "settings.h" +#include + std::unique_ptr db; playerMap ORIG_NAME; std::unordered_map CNAME; @@ -300,7 +302,8 @@ class TransferCommand : public Command { class HelperCommand : public Command { enum HelperOP : int { - reload = 0 + reload = 0, + update = 1 } action; public: @@ -310,8 +313,11 @@ class HelperCommand : public Command { loadCfg(); outp.success(tr("hreload.success")); break; - default: - outp.error("Error"); + case update: + std::thread th([]() { + CheckAutoUpdate(true, false); + }); + th.detach(); } } @@ -319,7 +325,7 @@ class HelperCommand : public Command { using RegisterCommandHelper::makeMandatory; using RegisterCommandHelper::makeOptional; registry->registerCommand("helper", "LLHelper", CommandPermissionLevel::GameMasters, { (CommandFlagValue)0 }, { (CommandFlagValue)0x80 }); - registry->addEnum("HelperOP", {{"reload", HelperOP::reload}}); + registry->addEnum("HelperOP", { {"reload", HelperOP::reload}, {"update", HelperOP::update}}); registry->registerOverload("helper", makeMandatory(&HelperCommand::action, "optinal", "HelperOP")); } };