]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_globalload.cpp
Update m_cloaking to use free-form keys instead of weakening the hash IV
[user/henk/code/inspircd.git] / src / modules / m_globalload.cpp
index a3e3148468bc7898b545ee0af6829a313e12393e..636b9f4e4ab10cb404db4f61c27598de8ff39af2 100644 (file)
 class CommandGloadmodule : public Command
 {
  public:
-       CommandGloadmodule (InspIRCd* Instance) : Command(Instance,"GLOADMODULE", "o", 1)
+       CommandGloadmodule(Module* Creator) : Command(Creator,"GLOADMODULE", 1)
        {
-               this->source = "m_globalload.so";
-               syntax = "<modulename> [servermask]";
+               flags_needed = 'o'; syntax = "<modulename> [servermask]";
                TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
 
@@ -31,7 +30,7 @@ class CommandGloadmodule : public Command
        {
                std::string servername = parameters.size() > 1 ? parameters[1] : "*";
 
-               if (InspIRCd::Match(ServerInstance->Config->ServerName, servername))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName.c_str(), servername))
                {
                        if (ServerInstance->Modules->Load(parameters[0].c_str()))
                        {
@@ -48,6 +47,11 @@ class CommandGloadmodule : public Command
 
                return CMD_SUCCESS;
        }
+
+       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+       {
+               return ROUTE_BROADCAST;
+       }
 };
 
 /** Handle /GUNLOADMODULE
@@ -55,17 +59,16 @@ class CommandGloadmodule : public Command
 class CommandGunloadmodule : public Command
 {
  public:
-       CommandGunloadmodule (InspIRCd* Instance) : Command(Instance,"GUNLOADMODULE", "o", 1)
+       CommandGunloadmodule(Module* Creator) : Command(Creator,"GUNLOADMODULE", 1)
        {
-               this->source = "m_globalload.so";
-               syntax = "<modulename> [servermask]";
+               flags_needed = 'o'; syntax = "<modulename> [servermask]";
        }
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
                std::string servername = parameters.size() > 1 ? parameters[1] : "*";
 
-               if (InspIRCd::Match(ServerInstance->Config->ServerName, servername))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName.c_str(), servername))
                {
                        if (ServerInstance->Modules->Unload(parameters[0].c_str()))
                        {
@@ -82,6 +85,11 @@ class CommandGunloadmodule : public Command
 
                return CMD_SUCCESS;
        }
+
+       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+       {
+               return ROUTE_BROADCAST;
+       }
 };
 
 /** Handle /GRELOADMODULE
@@ -89,17 +97,16 @@ class CommandGunloadmodule : public Command
 class CommandGreloadmodule : public Command
 {
  public:
-       CommandGreloadmodule (InspIRCd* Instance) : Command(Instance, "GRELOADMODULE", "o", 1)
+       CommandGreloadmodule(Module* Creator) : Command(Creator, "GRELOADMODULE", 1)
        {
-               this->source = "m_globalload.so";
-               syntax = "<modulename> [servermask]";
+               flags_needed = 'o'; syntax = "<modulename> [servermask]";
        }
 
        CmdResult Handle(const std::vector<std::string> &parameters, User *user)
        {
                std::string servername = parameters.size() > 1 ? parameters[1] : "*";
 
-               if (InspIRCd::Match(ServerInstance->Config->ServerName, servername))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName.c_str(), servername))
                {
                        bool ok = true;
                        if (!ServerInstance->Modules->Unload(parameters[0].c_str()))
@@ -121,6 +128,11 @@ class CommandGreloadmodule : public Command
 
                return CMD_SUCCESS;
        }
+
+       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+       {
+               return ROUTE_BROADCAST;
+       }
 };
 
 class ModuleGlobalLoad : public Module
@@ -130,8 +142,8 @@ class ModuleGlobalLoad : public Module
        CommandGreloadmodule cmd3;
 
  public:
-       ModuleGlobalLoad(InspIRCd* Me)
-               : Module(Me), cmd1(Me), cmd2(Me), cmd3(Me)
+       ModuleGlobalLoad()
+               : cmd1(this), cmd2(this), cmd3(this)
        {
                ServerInstance->AddCommand(&cmd1);
                ServerInstance->AddCommand(&cmd2);
@@ -144,7 +156,7 @@ class ModuleGlobalLoad : public Module
 
        virtual Version GetVersion()
        {
-               return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("Allows global loading of a module.", VF_COMMON | VF_VENDOR, API_VERSION);
        }
 };