2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2010 Daniel De Graaf <danieldg@inspircd.org>
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.
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
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/>.
26 class CommandRConnect : public Command
29 CommandRConnect(Module* Creator);
30 CmdResult Handle (const std::vector<std::string>& parameters, User *user);
31 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
34 class CommandRSQuit : public Command
37 CommandRSQuit(Module* Creator);
38 CmdResult Handle (const std::vector<std::string>& parameters, User *user);
39 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
42 class CommandMap : public Command
44 /** Show MAP output to a user (recursive)
46 void ShowMap(TreeServer* Current, User* user, int depth, int &line, char* names, int &maxnamew, char* stats);
48 /** Returns oper-specific MAP information
50 std::string MapOperInfo(TreeServer* Current);
53 CommandMap(Module* Creator);
54 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
55 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
58 class CommandSVSJoin : public ServerCommand
61 CommandSVSJoin(Module* Creator) : ServerCommand(Creator, "SVSJOIN", 2) { }
62 CmdResult Handle(User* user, std::vector<std::string>& params);
63 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
66 class CommandSVSPart : public ServerCommand
69 CommandSVSPart(Module* Creator) : ServerCommand(Creator, "SVSPART", 2) { }
70 CmdResult Handle(User* user, std::vector<std::string>& params);
71 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
74 class CommandSVSNick : public ServerCommand
77 CommandSVSNick(Module* Creator) : ServerCommand(Creator, "SVSNICK", 3) { }
78 CmdResult Handle(User* user, std::vector<std::string>& params);
79 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
82 class CommandMetadata : public ServerCommand
85 CommandMetadata(Module* Creator) : ServerCommand(Creator, "METADATA", 2) { }
86 CmdResult Handle(User* user, std::vector<std::string>& params);
89 class CommandUID : public ServerOnlyServerCommand<CommandUID>
92 CommandUID(Module* Creator) : ServerOnlyServerCommand<CommandUID>(Creator, "UID", 10) { }
93 CmdResult HandleServer(TreeServer* server, std::vector<std::string>& params);
96 class CommandOpertype : public UserOnlyServerCommand<CommandOpertype>
99 CommandOpertype(Module* Creator) : UserOnlyServerCommand<CommandOpertype>(Creator, "OPERTYPE", 1) { }
100 CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params);
104 class CommandFJoin : public ServerCommand
106 /** Remove all modes from a channel, including statusmodes (+qaovh etc), simplemodes, parameter modes.
107 * This does not update the timestamp of the target channel, this must be done seperately.
109 static void RemoveStatus(Channel* c);
110 static void ApplyModeStack(User* srcuser, Channel* c, irc::modestacker& stack);
111 bool ProcessModeUUIDPair(const std::string& item, TreeSocket* src_socket, Channel* chan, irc::modestacker* modestack);
113 CommandFJoin(Module* Creator) : ServerCommand(Creator, "FJOIN", 3) { }
114 CmdResult Handle(User* user, std::vector<std::string>& params);
117 class CommandFMode : public ServerCommand
120 CommandFMode(Module* Creator) : ServerCommand(Creator, "FMODE", 3) { }
121 CmdResult Handle(User* user, std::vector<std::string>& params);
124 class CommandFTopic : public ServerCommand
127 CommandFTopic(Module* Creator) : ServerCommand(Creator, "FTOPIC", 5) { }
128 CmdResult Handle(User* user, std::vector<std::string>& params);
131 class CommandFHost : public UserOnlyServerCommand<CommandFHost>
134 CommandFHost(Module* Creator) : UserOnlyServerCommand<CommandFHost>(Creator, "FHOST", 1) { }
135 CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params);
138 class CommandFIdent : public UserOnlyServerCommand<CommandFIdent>
141 CommandFIdent(Module* Creator) : UserOnlyServerCommand<CommandFIdent>(Creator, "FIDENT", 1) { }
142 CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params);
145 class CommandFName : public UserOnlyServerCommand<CommandFName>
148 CommandFName(Module* Creator) : UserOnlyServerCommand<CommandFName>(Creator, "FNAME", 1) { }
149 CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params);
152 class CommandIJoin : public UserOnlyServerCommand<CommandIJoin>
155 CommandIJoin(Module* Creator) : UserOnlyServerCommand<CommandIJoin>(Creator, "IJOIN", 1) { }
156 CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params);
159 class CommandResync : public ServerOnlyServerCommand<CommandResync>
162 CommandResync(Module* Creator) : ServerOnlyServerCommand<CommandResync>(Creator, "RESYNC", 1) { }
163 CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
166 class CommandAway : public UserOnlyServerCommand<CommandAway>
169 CommandAway(Module* Creator) : UserOnlyServerCommand<CommandAway>(Creator, "AWAY", 0, 2) { }
170 CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& parameters);
173 class CommandAddLine : public ServerCommand
176 CommandAddLine(Module* Creator) : ServerCommand(Creator, "ADDLINE", 6, 6) { }
177 CmdResult Handle(User* user, std::vector<std::string>& parameters);
180 class CommandDelLine : public ServerCommand
183 CommandDelLine(Module* Creator) : ServerCommand(Creator, "DELLINE", 2, 2) { }
184 CmdResult Handle(User* user, std::vector<std::string>& parameters);
187 class CommandEncap : public ServerCommand
190 CommandEncap(Module* Creator) : ServerCommand(Creator, "ENCAP", 2) { }
191 CmdResult Handle(User* user, std::vector<std::string>& parameters);
192 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
195 class CommandIdle : public UserOnlyServerCommand<CommandIdle>
198 CommandIdle(Module* Creator) : UserOnlyServerCommand<CommandIdle>(Creator, "IDLE", 1) { }
199 CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& parameters);
200 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_UNICAST(parameters[0]); }
203 class CommandNick : public UserOnlyServerCommand<CommandNick>
206 CommandNick(Module* Creator) : UserOnlyServerCommand<CommandNick>(Creator, "NICK", 2) { }
207 CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& parameters);
210 class CommandPing : public ServerCommand
213 CommandPing(Module* Creator) : ServerCommand(Creator, "PING", 1) { }
214 CmdResult Handle(User* user, std::vector<std::string>& parameters);
215 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_UNICAST(parameters[0]); }
218 class CommandPong : public ServerOnlyServerCommand<CommandPong>
221 CommandPong(Module* Creator) : ServerOnlyServerCommand<CommandPong>(Creator, "PONG", 1) { }
222 CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
223 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_UNICAST(parameters[0]); }
226 class CommandPush : public ServerCommand
229 CommandPush(Module* Creator) : ServerCommand(Creator, "PUSH", 2) { }
230 CmdResult Handle(User* user, std::vector<std::string>& parameters);
231 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_UNICAST(parameters[0]); }
234 class CommandSave : public ServerCommand
237 CommandSave(Module* Creator) : ServerCommand(Creator, "SAVE", 2) { }
238 CmdResult Handle(User* user, std::vector<std::string>& parameters);
241 class CommandServer : public ServerOnlyServerCommand<CommandServer>
244 CommandServer(Module* Creator) : ServerOnlyServerCommand<CommandServer>(Creator, "SERVER", 5) { }
245 CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
248 class CommandSQuit : public ServerOnlyServerCommand<CommandSQuit>
251 CommandSQuit(Module* Creator) : ServerOnlyServerCommand<CommandSQuit>(Creator, "SQUIT", 2) { }
252 CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
255 class CommandSNONotice : public ServerCommand
258 CommandSNONotice(Module* Creator) : ServerCommand(Creator, "SNONOTICE", 2) { }
259 CmdResult Handle(User* user, std::vector<std::string>& parameters);
262 class CommandVersion : public ServerOnlyServerCommand<CommandServer>
265 CommandVersion(Module* Creator) : ServerOnlyServerCommand<CommandServer>(Creator, "VERSION", 1) { }
266 CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
269 class CommandBurst : public ServerOnlyServerCommand<CommandBurst>
272 CommandBurst(Module* Creator) : ServerOnlyServerCommand<CommandBurst>(Creator, "BURST") { }
273 CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
276 class CommandEndBurst : public ServerOnlyServerCommand<CommandEndBurst>
279 CommandEndBurst(Module* Creator) : ServerOnlyServerCommand<CommandEndBurst>(Creator, "ENDBURST") { }
280 CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
283 class SpanningTreeCommands
286 CommandRConnect rconnect;
287 CommandRSQuit rsquit;
289 CommandSVSJoin svsjoin;
290 CommandSVSPart svspart;
291 CommandSVSNick svsnick;
292 CommandMetadata metadata;
294 CommandOpertype opertype;
297 CommandResync resync;
299 CommandFTopic ftopic;
301 CommandFIdent fident;
304 CommandAddLine addline;
305 CommandDelLine delline;
313 CommandServer server;
315 CommandSNONotice snonotice;
316 CommandVersion version;
318 CommandEndBurst endburst;
319 SpanningTreeCommands(ModuleSpanningTree* module);