]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/commands.h
Merge pull request #1162 from SaberUK/insp20+fix-deinstall
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / commands.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2010 Daniel De Graaf <danieldg@inspircd.org>
5  *
6  * This file is part of InspIRCd.  InspIRCd is free software: you can
7  * redistribute it and/or modify it under the terms of the GNU General Public
8  * License as published by the Free Software Foundation, version 2.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19
20 #ifndef M_SPANNINGTREE_COMMANDS_H
21 #define M_SPANNINGTREE_COMMANDS_H
22
23 #include "main.h"
24
25 /** Handle /RCONNECT
26  */
27 class CommandRConnect : public Command
28 {
29         SpanningTreeUtilities* Utils;   /* Utility class */
30  public:
31         CommandRConnect (Module* Callback, SpanningTreeUtilities* Util);
32         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
33                 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
34 };
35
36 class CommandRSQuit : public Command
37 {
38         SpanningTreeUtilities* Utils;   /* Utility class */
39  public:
40         CommandRSQuit(Module* Callback, SpanningTreeUtilities* Util);
41         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
42                 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
43         void NoticeUser(User* user, const std::string &msg);
44 };
45
46 class CommandSVSJoin : public Command
47 {
48  public:
49         CommandSVSJoin(Module* Creator) : Command(Creator, "SVSJOIN", 2) { flags_needed = FLAG_SERVERONLY; }
50         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
51         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
52 };
53 class CommandSVSPart : public Command
54 {
55  public:
56         CommandSVSPart(Module* Creator) : Command(Creator, "SVSPART", 2) { flags_needed = FLAG_SERVERONLY; }
57         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
58         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
59 };
60 class CommandSVSNick : public Command
61 {
62  public:
63         CommandSVSNick(Module* Creator) : Command(Creator, "SVSNICK", 3) { flags_needed = FLAG_SERVERONLY; }
64         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
65         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
66 };
67 class CommandMetadata : public Command
68 {
69  public:
70         CommandMetadata(Module* Creator) : Command(Creator, "METADATA", 2) { flags_needed = FLAG_SERVERONLY; }
71         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
72         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
73 };
74 class CommandUID : public Command
75 {
76  public:
77         CommandUID(Module* Creator) : Command(Creator, "UID", 10) { flags_needed = FLAG_SERVERONLY; }
78         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
79         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
80 };
81 class CommandOpertype : public Command
82 {
83  public:
84         CommandOpertype(Module* Creator) : Command(Creator, "OPERTYPE", 1) { flags_needed = FLAG_SERVERONLY; }
85         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
86         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
87 };
88 class CommandFJoin : public Command
89 {
90  public:
91         CommandFJoin(Module* Creator) : Command(Creator, "FJOIN", 3) { flags_needed = FLAG_SERVERONLY; }
92         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
93         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
94         /** Remove all modes from a channel, including statusmodes (+qaovh etc), simplemodes, parameter modes.
95          * This does not update the timestamp of the target channel, this must be done seperately.
96          */
97         void RemoveStatus(User* source, parameterlist &params);
98 };
99 class CommandFMode : public Command
100 {
101  public:
102         CommandFMode(Module* Creator) : Command(Creator, "FMODE", 3) { flags_needed = FLAG_SERVERONLY; }
103         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
104         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
105 };
106 class CommandFTopic : public Command
107 {
108  public:
109         CommandFTopic(Module* Creator) : Command(Creator, "FTOPIC", 4) { flags_needed = FLAG_SERVERONLY; }
110         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
111         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
112 };
113 class CommandFHost : public Command
114 {
115  public:
116         CommandFHost(Module* Creator) : Command(Creator, "FHOST", 1) { flags_needed = FLAG_SERVERONLY; }
117         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
118         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
119 };
120 class CommandFIdent : public Command
121 {
122  public:
123         CommandFIdent(Module* Creator) : Command(Creator, "FIDENT", 1) { flags_needed = FLAG_SERVERONLY; }
124         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
125         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
126 };
127 class CommandFName : public Command
128 {
129  public:
130         CommandFName(Module* Creator) : Command(Creator, "FNAME", 1) { flags_needed = FLAG_SERVERONLY; }
131         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
132         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
133 };
134
135 class SpanningTreeCommands
136 {
137  public:
138         CommandRConnect rconnect;
139         CommandRSQuit rsquit;
140         CommandSVSJoin svsjoin;
141         CommandSVSPart svspart;
142         CommandSVSNick svsnick;
143         CommandMetadata metadata;
144         CommandUID uid;
145         CommandOpertype opertype;
146         CommandFJoin fjoin;
147         CommandFMode fmode;
148         CommandFTopic ftopic;
149         CommandFHost fhost;
150         CommandFIdent fident;
151         CommandFName fname;
152         SpanningTreeCommands(ModuleSpanningTree* module);
153 };
154
155 #endif