The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download | Blog | Stats
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

cmd_gunloadmodule Class Reference

Handle /GUNLOADMODULE. More...

Inheritance diagram for cmd_gunloadmodule:

Inheritance graph
[legend]
Collaboration diagram for cmd_gunloadmodule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 cmd_gunloadmodule (InspIRCd *Instance)
CmdResult Handle (const char **parameters, int pcnt, userrec *user)
 Handle the command from a user.

Detailed Description

Handle /GUNLOADMODULE.

Definition at line 57 of file m_globalload.cpp.


Constructor & Destructor Documentation

cmd_gunloadmodule::cmd_gunloadmodule InspIRCd Instance  )  [inline]
 

Definition at line 60 of file m_globalload.cpp.

References command_t::source, and command_t::syntax.

00060                                                : command_t(Instance,"GUNLOADMODULE", 'o', 1)
00061         {
00062                 this->source = "m_globalload.so";
00063                 syntax = "<modulename> [servermask]";
00064         }


Member Function Documentation

CmdResult cmd_gunloadmodule::Handle const char **  parameters,
int  pcnt,
userrec user
[inline, virtual]
 

Handle the command from a user.

Parameters:
parameters The parameters for the command.
pcnt The number of parameters available in 'parameters'
user The user who issued the command.
Returns:
Return CMD_SUCCESS on success, or CMD_FAILURE on failure. If the command succeeds but should remain local to this server, return CMD_LOCALONLY.

Implements command_t.

Definition at line 66 of file m_globalload.cpp.

References CMD_SUCCESS, InspIRCd::Config, InspIRCd::MatchText(), InspIRCd::ModuleError(), userrec::nick, command_t::ServerInstance, ServerConfig::ServerName, InspIRCd::UnloadModule(), InspIRCd::WriteOpers(), and userrec::WriteServ().

00067         {
00068                 std::string servername = pcnt > 1 ? parameters[1] : "*";
00069 
00070                 if (ServerInstance->MatchText(ServerInstance->Config->ServerName, servername))
00071                 {
00072                         if (ServerInstance->UnloadModule(parameters[0]))
00073                         {
00074                                 ServerInstance->WriteOpers("*** MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0],user->nick);
00075                                 user->WriteServ("973 %s %s :Module successfully unloaded.",user->nick, parameters[0]);
00076                         }
00077                         else
00078                         {
00079                                 user->WriteServ("972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
00080                         }
00081                 }
00082                 else
00083                         ServerInstance->WriteOpers("*** MODULE '%s' GLOBAL UNLOAD BY '%s' (not unloaded here)",parameters[0],user->nick);
00084 
00085                 return CMD_SUCCESS;
00086         }


The documentation for this class was generated from the following file: