]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_unloadmodule.cpp
More cleanup
[user/henk/code/inspircd.git] / src / cmd_unloadmodule.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 using namespace std;
18
19 #include "inspircd_config.h"
20 #include "inspircd.h"
21 #include "inspircd_io.h"
22 #include <time.h>
23 #include <string>
24 #include "users.h"
25 #include "ctables.h"
26 #include "globals.h"
27 #include "modules.h"
28 #include "dynamic.h"
29 #include "message.h"
30 #include "commands.h"
31 #include "inspstring.h"
32 #include "helperfuncs.h"
33 #include "hashcomp.h"
34 #include "socketengine.h"
35 #include "typedefs.h"
36 #include "cmd_unloadmodule.h"
37
38 extern InspIRCd* ServerInstance;
39
40 void cmd_unloadmodule::Handle (char **parameters, int pcnt, userrec *user)
41 {
42         if (ServerInstance->UnloadModule(parameters[0]))
43         {
44                 WriteOpers("*** MODULE UNLOADED: %s",parameters[0]);
45                 WriteServ(user->fd,"973 %s %s :Module successfully unloaded.",user->nick, parameters[0]);
46         }
47         else
48         {
49                 WriteServ(user->fd,"972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
50         }
51 }
52