-/** Handle /SERVER.
- */
-class CommandServer : public Command
-{
- public:
- /** Constructor for server.
- */
- CommandServer(Module* parent)
- : Command(parent, "SERVER")
- {
- works_before_reg = true;
- }
-
- /** Handle command.
- * @param parameters The parameters to the command
- * @param user The user issuing the command
- * @return A value from CmdResult to indicate command success or failure.
- */
- CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
- {
- if (user->registered == REG_ALL)
- {
- user->WriteNumeric(ERR_ALREADYREGISTERED, "You are already registered. (Perhaps your IRC client does not have a /SERVER command).");
- }
- else
- {
- user->WriteNumeric(ERR_NOTREGISTERED, "SERVER", "You may not register as a server (servers have separate ports from clients, change your config)");
- }
- return CMD_FAILURE;
- }
-};
-