2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
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/>.
24 /** These commands require no parameters, but if there is a parameter it is a server name where the command will be routed to.
26 class ServerTargetCommand : public Command
29 ServerTargetCommand(Module* mod, const std::string& Name)
34 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
39 class CommandAdmin : public Command
42 /** Holds the admin's name, for output in
45 std::string AdminName;
47 /** Holds the email address of the admin,
48 * for output in the /ADMIN command.
50 std::string AdminEmail;
52 /** Holds the admin's nickname, for output
53 * in the /ADMIN command
55 std::string AdminNick;
57 /** Constructor for admin.
59 CommandAdmin(Module* parent);
62 * @param parameters The parameters to the command
63 * @param user The user issuing the command
64 * @return A value from CmdResult to indicate command success or failure.
66 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
67 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
72 class CommandCommands : public Command
75 /** Constructor for commands.
77 CommandCommands(Module* parent);
80 * @param parameters The parameters to the command
81 * @param user The user issuing the command
82 * @return A value from CmdResult to indicate command success or failure.
84 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
89 class CommandInfo : public Command
92 /** Constructor for info.
94 CommandInfo(Module* parent);
97 * @param parameters The parameters to the command
98 * @param user The user issuing the command
99 * @return A value from CmdResult to indicate command success or failure.
101 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
102 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
107 class CommandModules : public Command
110 /** Constructor for modules.
112 CommandModules(Module* parent);
115 * @param parameters The parameters to the command
116 * @param user The user issuing the command
117 * @return A value from CmdResult to indicate command success or failure.
119 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
120 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
125 class CommandMotd : public Command
128 /** Constructor for motd.
130 CommandMotd(Module* parent);
133 * @param parameters The parameters to the command
134 * @param user The user issuing the command
135 * @return A value from CmdResult to indicate command success or failure.
137 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
138 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
143 class CommandTime : public Command
146 /** Constructor for time.
148 CommandTime(Module* parent);
151 * @param parameters The parameters to the command
152 * @param user The user issuing the command
153 * @return A value from CmdResult to indicate command success or failure.
155 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
156 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
161 class CommandVersion : public Command
164 /** Constructor for version.
166 CommandVersion(Module* parent);
169 * @param parameters The parameters to the command
170 * @param user The user issuing the command
171 * @return A value from CmdResult to indicate command success or failure.
173 CmdResult Handle(const std::vector<std::string>& parameters, User* user);