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 ServerTargetCommand
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);
71 class CommandCommands : public Command
74 /** Constructor for commands.
76 CommandCommands(Module* parent);
79 * @param parameters The parameters to the command
80 * @param user The user issuing the command
81 * @return A value from CmdResult to indicate command success or failure.
83 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
88 class CommandInfo : public ServerTargetCommand
91 /** Constructor for info.
93 CommandInfo(Module* parent);
96 * @param parameters The parameters to the command
97 * @param user The user issuing the command
98 * @return A value from CmdResult to indicate command success or failure.
100 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
105 class CommandModules : public ServerTargetCommand
108 /** Constructor for modules.
110 CommandModules(Module* parent);
113 * @param parameters The parameters to the command
114 * @param user The user issuing the command
115 * @return A value from CmdResult to indicate command success or failure.
117 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
122 class CommandMotd : public ServerTargetCommand
125 /** Constructor for motd.
127 CommandMotd(Module* parent);
130 * @param parameters The parameters to the command
131 * @param user The user issuing the command
132 * @return A value from CmdResult to indicate command success or failure.
134 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
139 class CommandTime : public ServerTargetCommand
142 /** Constructor for time.
144 CommandTime(Module* parent);
147 * @param parameters The parameters to the command
148 * @param user The user issuing the command
149 * @return A value from CmdResult to indicate command success or failure.
151 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
156 class CommandVersion : public Command
159 /** Constructor for version.
161 CommandVersion(Module* parent);
164 * @param parameters The parameters to the command
165 * @param user The user issuing the command
166 * @return A value from CmdResult to indicate command success or failure.
168 CmdResult Handle(const std::vector<std::string>& parameters, User* user);