diff options
author | Jackmcbarn <jackmcbarn@jackmcbarn.no-ip.org> | 2011-03-23 09:11:18 -0400 |
---|---|---|
committer | Jackmcbarn <jackmcbarn@jackmcbarn.no-ip.org> | 2011-03-23 09:11:18 -0400 |
commit | 2018098273b8792fe4f4d59c7545bd133c1c8e85 (patch) | |
tree | 0b0d9735110ecd94fb114720f92205b8b5be16a2 /src | |
parent | 73b297aeb21b4f2873ceedb70236a78659a53ee4 (diff) |
Display a message when using /greloadmodule
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_globalload.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index be29b00a5..c9a4231dd 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -96,6 +96,25 @@ class CommandGunloadmodule : public Command } }; +class GReloadModuleWorker : public HandlerBase1<void, bool> +{ + public: + const std::string nick; + const std::string name; + const std::string uid; + GReloadModuleWorker(const std::string& usernick, const std::string& uuid, const std::string& modn) + : nick(usernick), name(modn), uid(uuid) {} + void Call(bool result) + { + ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBALLY RELOADED BY '%s'%s", name.c_str(), nick.c_str(), result ? "" : " (failed here)"); + 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); + } +}; + /** Handle /GRELOADMODULE */ class CommandGreloadmodule : public Command @@ -114,7 +133,7 @@ class CommandGreloadmodule : public Command { Module* m = ServerInstance->Modules->Find(parameters[0]); if (m) - ServerInstance->Modules->Reload(m, NULL); + ServerInstance->Modules->Reload(m, new GReloadModuleWorker(user->nick, user->uuid, parameters[0])); else { user->WriteNumeric(975, "%s %s :Could not find module by that name", user->nick.c_str(), parameters[0].c_str()); |