From 403d16068410909b8d352588dc83f6d255a018b7 Mon Sep 17 00:00:00 2001 From: w00t Date: Tue, 15 Jul 2008 13:32:28 +0000 Subject: Send ERR_NOTREGISTERED to clients that send SERVER on a client port with a text that tells them what they are doing wrong. Should help them debug it themselves. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10023 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands/cmd_server.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/commands/cmd_server.cpp b/src/commands/cmd_server.cpp index 81f9e722c..811d59057 100644 --- a/src/commands/cmd_server.cpp +++ b/src/commands/cmd_server.cpp @@ -23,6 +23,13 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandServer::Handle (const std::vector&, User *user) { - user->WriteNumeric(ERR_ALREADYREGISTERED, "%s :You are already registered. (Perhaps your IRC client does not have a /SERVER command).",user->nick.c_str()); + if (user->registered == REG_ALL) + { + user->WriteNumeric(ERR_ALREADYREGISTERED, "%s :You are already registered. (Perhaps your IRC client does not have a /SERVER command).",user->nick.c_str()); + } + else + { + user->WriteNumeric(ERR_NOTREGISTERED, "%s :You may not register as a server (servers have seperate ports from clients, change your config)",command.c_str()); + } return CMD_FAILURE; } -- cgit v1.2.3