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 class CommandReloadmodule : public Command
19 /** Constructor for reloadmodule.
21 CommandReloadmodule (InspIRCd* Instance, Module* parent) : Command(Instance, parent, "RELOADMODULE","o",1) { syntax = "<modulename>"; }
23 * @param parameters The parameters to the comamnd
24 * @param pcnt The number of parameters passed to teh command
25 * @param user The user issuing the command
26 * @return A value from CmdResult to indicate command success or failure.
28 CmdResult Handle(const std::vector<std::string>& parameters, User *user);
31 CmdResult CommandReloadmodule::Handle (const std::vector<std::string>& parameters, User *user)
33 if (ServerInstance->Modules->Unload(parameters[0].c_str()))
35 ServerInstance->SNO->WriteToSnoMask('a', "RELOAD MODULE: %s unloaded %s",user->nick.c_str(), parameters[0].c_str());
36 if (ServerInstance->Modules->Load(parameters[0].c_str()))
38 ServerInstance->SNO->WriteToSnoMask('a', "RELOAD MODULE: %s reloaded %s",user->nick.c_str(), parameters[0].c_str());
39 user->WriteNumeric(975, "%s %s :Module successfully reloaded.",user->nick.c_str(), parameters[0].c_str());
44 ServerInstance->SNO->WriteToSnoMask('a', "RELOAD MODULE: %s unsuccessfully reloaded %s",user->nick.c_str(), parameters[0].c_str());
45 user->WriteNumeric(975, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str());
49 COMMAND_INIT(CommandReloadmodule)