diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-25 17:35:16 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-25 17:35:16 +0000 |
commit | a35628400f447873f28117d41ba548dc4d4369b8 (patch) | |
tree | b459ae8b435926fd856c5102d3bb33155be02b9b | |
parent | 94b92f6ea5be0ed5939ea705ba3cec2cf54dbe9a (diff) |
Added /greloadmodule to m_globalload.so
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5323 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_globalload.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 4992b47af..eb6b85a78 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -78,10 +78,43 @@ class cmd_gunloadmodule : public command_t } }; +/** Handle /GRELOADMODULE + */ +class cmd_greloadmodule : public command_t +{ + public: + cmd_greloadmodule (InspIRCd* Instance) : command_t(Instance, "GRELOADMODULE", 'o', 1) + { + this->source = "m_globalload.so"; + syntax = "<modulename>"; + } + + CmdResult Handle(const char** parameters, int pcnt, userrec *user) + { + if (!ServerInstance->UnloadModule(parameters[0])) + { + user->WriteServ("972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError()); + return CMD_FAILURE; + } + + if (!ServerInstance->LoadModule(parameters[0])) + { + user->WriteServ("974 %s %s :Failed to load module: %s",user->nick, parameters[0],ServerInstance->ModuleError()); + return CMD_FAILURE; + } + + ServerInstance->WriteOpers("*** MODULE '%s' GLOBALLY RELOADED BY '%s'",parameters[0],user->nick); + user->WriteServ("975 %s %s :Module successfully loaded.",user->nick, parameters[0]); + + return CMD_SUCCESS; + } +}; + class ModuleGlobalLoad : public Module { cmd_gloadmodule *mycommand; cmd_gunloadmodule *mycommand2; + cmd_greloadmodule *mycommand3; public: ModuleGlobalLoad(InspIRCd* Me) : Module::Module(Me) @@ -89,8 +122,10 @@ class ModuleGlobalLoad : public Module mycommand = new cmd_gloadmodule(ServerInstance); mycommand2 = new cmd_gunloadmodule(ServerInstance); + mycommand3 = new cmd_greloadmodule(ServerInstance); ServerInstance->AddCommand(mycommand); ServerInstance->AddCommand(mycommand2); + ServerInstance->AddCommand(mycommand3); } virtual ~ModuleGlobalLoad() |