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_LOADMODULE_H__
17 #define __CMD_LOADMODULE_H__
19 // include the common header files
24 /** Handle /LOADMODULE. 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 CommandLoadmodule : public Command
32 /** Constructor for loadmodule.
34 CommandLoadmodule (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"LOADMODULE","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);
47 /** Handle /LOADMODULE
49 CmdResult CommandLoadmodule::Handle (const std::vector<std::string>& parameters, User *user)
51 if (ServerInstance->Modules->Load(parameters[0].c_str()))
53 ServerInstance->SNO->WriteToSnoMask('a', "NEW MODULE: %s loaded %s",user->nick.c_str(), parameters[0].c_str());
54 user->WriteNumeric(975, "%s %s :Module successfully loaded.",user->nick.c_str(), parameters[0].c_str());
59 user->WriteNumeric(974, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str());
64 COMMAND_INIT(CommandLoadmodule)