]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/precommand.cpp
Header update: 2007 -> 2008
[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/timesynctimer.h"
25 #include "m_spanningtree/resolvers.h"
26 #include "m_spanningtree/main.h"
27 #include "m_spanningtree/utils.h"
28 #include "m_spanningtree/treeserver.h"
29 #include "m_spanningtree/link.h"
30 #include "m_spanningtree/treesocket.h"
31 #include "m_spanningtree/rconnect.h"
32 #include "m_spanningtree/rsquit.h"
33
34 /* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
35
36 int ModuleSpanningTree::OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line)
37 {
38         /* If the command doesnt appear to be valid, we dont want to mess with it. */
39         if (!validated)
40                 return 0;
41
42         if (command == "CONNECT")
43         {
44                 return this->HandleConnect(parameters,pcnt,user);
45         }
46         else if (command == "STATS")
47         {
48                 return this->HandleStats(parameters,pcnt,user);
49         }
50         else if (command == "MOTD")
51         {
52                 return this->HandleMotd(parameters,pcnt,user);
53         }
54         else if (command == "ADMIN")
55         {
56                 return this->HandleAdmin(parameters,pcnt,user);
57         }
58         else if (command == "SQUIT")
59         {
60                 return this->HandleSquit(parameters,pcnt,user);
61         }
62         else if (command == "MAP")
63         {
64                 this->HandleMap(parameters,pcnt,user);
65                 return 1;
66         }
67         else if ((command == "TIME") && (pcnt > 0))
68         {
69                 return this->HandleTime(parameters,pcnt,user);
70         }
71         else if (command == "LUSERS")
72         {
73                 this->HandleLusers(parameters,pcnt,user);
74                 return 1;
75         }
76         else if (command == "LINKS")
77         {
78                 this->HandleLinks(parameters,pcnt,user);
79                 return 1;
80         }
81         else if (command == "WHOIS")
82         {
83                 if (pcnt > 1)
84                 {
85                         // remote whois
86                         return this->HandleRemoteWhois(parameters,pcnt,user);
87                 }
88         }
89         else if ((command == "VERSION") && (pcnt > 0))
90         {
91                 this->HandleVersion(parameters,pcnt,user);
92                 return 1;
93         }
94         else if ((command == "MODULES") && (pcnt > 0))
95         {
96                 return this->HandleModules(parameters,pcnt,user);
97         }
98         return 0;
99 }
100