]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/precommand.cpp
beffba6e946a4095c7c9f85843c49837396547c8
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / precommand.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *        the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 /* $ModDesc: Provides a spanning tree server link protocol */
15
16 #include "inspircd.h"
17 #include "commands/cmd_whois.h"
18 #include "commands/cmd_stats.h"
19 #include "socket.h"
20 #include "wildcard.h"
21 #include "xline.h"
22 #include "transport.h"
23
24 #include "m_spanningtree/main.h"
25 #include "m_spanningtree/utils.h"
26 #include "m_spanningtree/treeserver.h"
27 #include "m_spanningtree/treesocket.h"
28
29 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
30
31 int ModuleSpanningTree::OnPreCommand(std::string &command, std::vector<std::string>& parameters, User *user, bool validated, const std::string &original_line)
32 {
33         /* If the command doesnt appear to be valid, we dont want to mess with it. */
34         if (!validated)
35                 return 0;
36
37         if (command == "CONNECT")
38         {
39                 return this->HandleConnect(parameters,user);
40         }
41         else if (command == "STATS")
42         {
43                 return this->HandleStats(parameters,user);
44         }
45         else if (command == "MOTD")
46         {
47                 return this->HandleMotd(parameters,user);
48         }
49         else if (command == "ADMIN")
50         {
51                 return this->HandleAdmin(parameters,user);
52         }
53         else if (command == "SQUIT")
54         {
55                 return this->HandleSquit(parameters,user);
56         }
57         else if (command == "MAP")
58         {
59                 return this->HandleMap(parameters,user);
60         }
61         else if ((command == "TIME") && (parameters.size() > 0))
62         {
63                 return this->HandleTime(parameters,user);
64         }
65         else if (command == "LUSERS")
66         {
67                 this->HandleLusers(parameters,user);
68                 return 1;
69         }
70         else if (command == "LINKS")
71         {
72                 this->HandleLinks(parameters,user);
73                 return 1;
74         }
75         else if (command == "WHOIS")
76         {
77                 if (parameters.size() > 1)
78                 {
79                         // remote whois
80                         return this->HandleRemoteWhois(parameters,user);
81                 }
82         }
83         else if ((command == "VERSION") && (parameters.size() > 0))
84         {
85                 this->HandleVersion(parameters,user);
86                 return 1;
87         }
88         else if ((command == "MODULES") && (parameters.size() > 0))
89         {
90                 return this->HandleModules(parameters,user);
91         }
92         return 0;
93 }
94