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_unloadmodule Class Reference

Handle /UNLOADMODULE. More...

#include <cmd_unloadmodule.h>

Inheritance diagram for cmd_unloadmodule:

Inheritance graph
[legend]
Collaboration diagram for cmd_unloadmodule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 cmd_unloadmodule (InspIRCd *Instance)
 Constructor for unloadmodule.
CmdResult Handle (const char **parameters, int pcnt, userrec *user)
 Handle command.

Detailed Description

Handle /UNLOADMODULE.

These command handlers can be reloaded by the core, and handle basic RFC1459 commands. Commands within modules work the same way, however, they can be fully unloaded, where these may not.

Definition at line 27 of file cmd_unloadmodule.h.


Constructor & Destructor Documentation

cmd_unloadmodule::cmd_unloadmodule InspIRCd Instance  )  [inline]
 

Constructor for unloadmodule.

Definition at line 32 of file cmd_unloadmodule.h.

References command_t::syntax.

00032 : command_t(Instance,"UNLOADMODULE",'o',1) { syntax = "<modulename>"; }


Member Function Documentation

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

Handle command.

Parameters:
parameters The parameters to the comamnd
pcnt The number of parameters passed to teh command
user The user issuing the command
Returns:
A value from CmdResult to indicate command success or failure.

Implements command_t.

Definition at line 25 of file cmd_unloadmodule.cpp.

References CMD_FAILURE, CMD_SUCCESS, InspIRCd::ModuleError(), userrec::nick, command_t::ServerInstance, InspIRCd::UnloadModule(), InspIRCd::WriteOpers(), and userrec::WriteServ().

00026 {
00027         if (ServerInstance->UnloadModule(parameters[0]))
00028         {
00029                 ServerInstance->WriteOpers("*** MODULE UNLOADED: %s unloaded %s", user->nick, parameters[0]);
00030                 user->WriteServ("973 %s %s :Module successfully unloaded.",user->nick, parameters[0]);
00031         }
00032         else
00033         {
00034                 user->WriteServ("972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
00035                 return CMD_FAILURE;
00036         }
00037 
00038         return CMD_SUCCESS;
00039 }


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