+ public:
+ /** Constructor for reloadmodule.
+ */
+ CommandReloadmodule ( Module* parent) : Command( parent, "RELOADMODULE",1) { flags_needed = 'o'; syntax = "<modulename>"; }
+ /** Handle command.
+ * @param parameters The parameters to the comamnd
+ * @param pcnt The number of parameters passed to teh command
+ * @param user The user issuing the command
+ * @return A value from CmdResult to indicate command success or failure.
+ */
+ CmdResult Handle(const std::vector<std::string>& parameters, User *user);
+};
+
+class ReloadModuleWorker : public HandlerBase1<void, bool>
+{
+ public:
+ const std::string name;
+ const std::string uid;
+ ReloadModuleWorker(const std::string& uuid, const std::string& modn)
+ : name(modn), uid(uuid) {}
+ void Call(bool result)
+ {
+ ServerInstance->SNO->WriteGlobalSno('a', "RELOAD MODULE: %s %ssuccessfully reloaded",
+ name.c_str(), result ? "" : "un");
+ User* user = ServerInstance->FindNick(uid);
+ if (user)
+ user->WriteNumeric(975, "%s %s :Module %ssuccessfully reloaded.",
+ user->nick.c_str(), name.c_str(), result ? "" : "un");
+ ServerInstance->GlobalCulls.AddItem(this);
+ }
+};