1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
20 * DEVOICE module for InspIRCd
21 * Syntax: /DEVOICE <#chan>
24 /* $ModDesc: Provides voiced users with the ability to devoice themselves. */
33 extern InspIRCd *ServerInstance;
35 class cmd_gloadmodule : public command_t
38 cmd_gloadmodule () : command_t("GLOADMODULE", 'o', 1)
40 this->source = "m_globalload.so";
43 void Handle (char **parameters, int pcnt, userrec *user)
45 if (ServerInstance->LoadModule(parameters[0]))
47 WriteOpers("*** NEW MODULE '%s' GLOBALLY LOADED BY '%s'",parameters[0],user->nick);
48 WriteServ(user->fd,"975 %s %s :Module successfully loaded.",user->nick, parameters[0]);
52 WriteServ(user->fd,"974 %s %s :Failed to load module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
57 class cmd_gunloadmodule : public command_t
60 cmd_gunloadmodule () : command_t("GUNLOADMODULE", 'o', 1)
62 this->source = "m_globalload.so";
65 void Handle (char **parameters, int pcnt, userrec *user)
67 if (ServerInstance->UnloadModule(parameters[0]))
69 WriteOpers("*** MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0],user->nick);
70 WriteServ(user->fd,"973 %s %s :Module successfully unloaded.",user->nick, parameters[0]);
74 WriteServ(user->fd,"972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
79 class ModuleGlobalLoad : public Module
81 cmd_gloadmodule *mycommand;
82 cmd_gunloadmodule *mycommand2;
84 ModuleGlobalLoad(Server* Me) : Module::Module(Me)
87 mycommand = new cmd_gloadmodule();
88 mycommand2 = new cmd_gunloadmodule();
89 Srv->AddCommand(mycommand);
90 Srv->AddCommand(mycommand2);
93 virtual ~ModuleGlobalLoad()
97 virtual Version GetVersion()
99 return Version(1, 0, 0, 0, VF_VENDOR);
104 class ModuleGlobalLoadFactory : public ModuleFactory
107 ModuleGlobalLoadFactory()
111 ~ModuleGlobalLoadFactory()
115 virtual Module * CreateModule(Server* Me)
117 return new ModuleGlobalLoad(Me);
123 extern "C" void * init_module( void )
125 return new ModuleGlobalLoadFactory;