]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/commands.h
m_spanningtree Remove unneeded #includes
[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 #pragma once
21
22 #include "main.h"
23
24 /** Handle /RCONNECT
25  */
26 class CommandRConnect : public Command
27 {
28         SpanningTreeUtilities* Utils;   /* Utility class */
29  public:
30         CommandRConnect (Module* Callback, SpanningTreeUtilities* Util);
31         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
32                 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
33 };
34
35 class CommandRSQuit : public Command
36 {
37         SpanningTreeUtilities* Utils;   /* Utility class */
38  public:
39         CommandRSQuit(Module* Callback, SpanningTreeUtilities* Util);
40         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
41                 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
42 };
43
44 class CommandSVSJoin : public Command
45 {
46  public:
47         CommandSVSJoin(Module* Creator) : Command(Creator, "SVSJOIN", 2) { flags_needed = FLAG_SERVERONLY; }
48         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
49         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
50 };
51 class CommandSVSPart : public Command
52 {
53  public:
54         CommandSVSPart(Module* Creator) : Command(Creator, "SVSPART", 2) { flags_needed = FLAG_SERVERONLY; }
55         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
56         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
57 };
58 class CommandSVSNick : public Command
59 {
60  public:
61         CommandSVSNick(Module* Creator) : Command(Creator, "SVSNICK", 3) { flags_needed = FLAG_SERVERONLY; }
62         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
63         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
64 };
65 class CommandMetadata : public Command
66 {
67  public:
68         CommandMetadata(Module* Creator) : Command(Creator, "METADATA", 2) { flags_needed = FLAG_SERVERONLY; }
69         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
70         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
71 };
72 class CommandUID : public Command
73 {
74  public:
75         CommandUID(Module* Creator) : Command(Creator, "UID", 10) { flags_needed = FLAG_SERVERONLY; }
76         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
77         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
78 };
79 class CommandOpertype : public Command
80 {
81  public:
82         CommandOpertype(Module* Creator) : Command(Creator, "OPERTYPE", 1) { flags_needed = FLAG_SERVERONLY; }
83         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
84         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
85 };
86 class TreeSocket;
87 class CommandFJoin : public Command
88 {
89         /** Remove all modes from a channel, including statusmodes (+qaovh etc), simplemodes, parameter modes.
90          * This does not update the timestamp of the target channel, this must be done seperately.
91          */
92         static void RemoveStatus(Channel* c);
93         static void ApplyModeStack(User* srcuser, Channel* c, irc::modestacker& stack);
94         bool ProcessModeUUIDPair(const std::string& item, TreeSocket* src_socket, Channel* chan, irc::modestacker* modestack);
95  public:
96         CommandFJoin(Module* Creator) : Command(Creator, "FJOIN", 3) { flags_needed = FLAG_SERVERONLY; }
97         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
98         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
99 };
100 class CommandFMode : public Command
101 {
102  public:
103         CommandFMode(Module* Creator) : Command(Creator, "FMODE", 3) { flags_needed = FLAG_SERVERONLY; }
104         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
105         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
106 };
107 class CommandFTopic : public Command
108 {
109  public:
110         CommandFTopic(Module* Creator) : Command(Creator, "FTOPIC", 4) { flags_needed = FLAG_SERVERONLY; }
111         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
112         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
113 };
114 class CommandFHost : public Command
115 {
116  public:
117         CommandFHost(Module* Creator) : Command(Creator, "FHOST", 1) { flags_needed = FLAG_SERVERONLY; }
118         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
119         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
120 };
121 class CommandFIdent : public Command
122 {
123  public:
124         CommandFIdent(Module* Creator) : Command(Creator, "FIDENT", 1) { flags_needed = FLAG_SERVERONLY; }
125         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
126         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
127 };
128 class CommandFName : public Command
129 {
130  public:
131         CommandFName(Module* Creator) : Command(Creator, "FNAME", 1) { flags_needed = FLAG_SERVERONLY; }
132         CmdResult Handle (const std::vector<std::string>& parameters, User *user);
133         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_BROADCAST; }
134 };
135
136 class SpanningTreeCommands
137 {
138  public:
139         CommandRConnect rconnect;
140         CommandRSQuit rsquit;
141         CommandSVSJoin svsjoin;
142         CommandSVSPart svspart;
143         CommandSVSNick svsnick;
144         CommandMetadata metadata;
145         CommandUID uid;
146         CommandOpertype opertype;
147         CommandFJoin fjoin;
148         CommandFMode fmode;
149         CommandFTopic ftopic;
150         CommandFHost fhost;
151         CommandFIdent fident;
152         CommandFName fname;
153         SpanningTreeCommands(ModuleSpanningTree* module);
154 };