]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_version.cpp
Just to mess with om's head, remove helperfuncs.h from everywhere
[user/henk/code/inspircd.git] / src / cmd_version.cpp
1 /*   +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #include "inspircd.h"
18 #include "configreader.h"
19 #include "users.h"
20 #include "commands.h"
21
22 #include "commands/cmd_version.h"
23
24
25
26
27 void cmd_version::Handle (const char** parameters, int pcnt, userrec *user)
28 {
29         std::stringstream out(ServerInstance->Config->data005);
30         std::string token = "";
31         std::string line5 = "";
32         int token_counter = 0;
33
34         user->WriteServ("351 %s :%s",user->nick,ServerInstance->GetVersionString().c_str());
35
36         while (!out.eof())
37         {
38                 out >> token;
39                 line5 = line5 + token + " ";
40                 token_counter++;
41
42                 if ((token_counter >= 13) || (out.eof() == true))
43                 {
44                         user->WriteServ("005 %s %s:are supported by this server",user->nick,line5.c_str());
45                         line5 = "";
46                         token_counter = 0;
47                 }
48         }
49 }