1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 #ifndef __CMD_UNLOADMODULE_H__
17 #define __CMD_UNLOADMODULE_H__
19 // include the common header files
24 /** Handle /UNLOADMODULE. These command handlers can be reloaded by the core,
25 * and handle basic RFC1459 commands. Commands within modules work
26 * the same way, however, they can be fully unloaded, where these
29 class CommandUnloadmodule : public Command
32 /** Constructor for unloadmodule.
34 CommandUnloadmodule (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"UNLOADMODULE","o",1) { syntax = "<modulename>"; }
36 * @param parameters The parameters to the comamnd
37 * @param pcnt The number of parameters passed to teh command
38 * @param user The user issuing the command
39 * @return A value from CmdResult to indicate command success or failure.
41 CmdResult Handle(const std::vector<std::string>& parameters, User *user);
49 CmdResult CommandUnloadmodule::Handle (const std::vector<std::string>& parameters, User *user)
51 if (ServerInstance->Modules->Unload(parameters[0].c_str()))
53 ServerInstance->SNO->WriteToSnoMask('a', "MODULE UNLOADED: %s unloaded %s", user->nick.c_str(), parameters[0].c_str());
54 user->WriteNumeric(973, "%s %s :Module successfully unloaded.",user->nick.c_str(), parameters[0].c_str());
58 user->WriteNumeric(972, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str());
65 COMMAND_INIT(CommandUnloadmodule)