]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_version.cpp
Swap around ERROR and SNONOTICE in SendError() so that the server doesnt try and...
[user/henk/code/inspircd.git] / src / cmd_version.cpp
index 8e80e3778bd3e28e5220558801bd4387f2d31d5f..2b6522d818a434a19ae425f080efa0e2befd72b7 100644 (file)
@@ -1,79 +1,29 @@
-/*   +------------------------------------+
+/*       +------------------------------------+
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *                <Craig@chatspike.net>
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
  *
- * Written by Craig Edwards, Craig McLure, and others.
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
-#include "inspircd_config.h"
 #include "inspircd.h"
-#include "inspircd_io.h"
-#include <time.h>
-#include <string>
-#ifdef GCC3
-#include <ext/hash_map>
-#else
-#include <hash_map>
-#endif
-#include <map>
-#include <sstream>
-#include <vector>
-#include <deque>
-#include "users.h"
-#include "ctables.h"
-#include "globals.h"
-#include "modules.h"
-#include "dynamic.h"
-#include "wildcard.h"
-#include "message.h"
-#include "commands.h"
-#include "mode.h"
-#include "xline.h"
-#include "inspstring.h"
-#include "dnsqueue.h"
-#include "helperfuncs.h"
-#include "hashcomp.h"
-#include "socketengine.h"
-#include "typedefs.h"
-#include "command_parse.h"
-#include "cmd_version.h"
-
-extern ServerConfig* Config;
-extern InspIRCd* ServerInstance;
-
-void cmd_version::Handle (char **parameters, int pcnt, userrec *user)
-{
-       std::stringstream out(Config->data005);
-       std::string token = "";
-       std::string line5 = "";
-       int token_counter = 0;
+#include "commands/cmd_version.h"
 
-       WriteServ(user->fd,"351 %s :%s",user->nick,ServerInstance->GetVersionString().c_str());
 
-       while (!out.eof())
-       {
-               out >> token;
-               line5 = line5 + token + " ";
-               token_counter++;
 
-               if ((token_counter >= 13) || (out.eof() == true))
-               {
-                       WriteServ(user->fd,"005 %s %s:are supported by this server",user->nick,line5.c_str());
-                       line5 = "";
-                       token_counter = 0;
-               }
-       }
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+{
+       return new cmd_version(Instance);
 }
 
-
+CmdResult cmd_version::Handle (const char** parameters, int pcnt, userrec *user)
+{
+       user->WriteServ("351 %s :%s",user->nick,ServerInstance->GetVersionString().c_str());
+       ServerInstance->Config->Send005(user);
+       return CMD_SUCCESS;
+}