]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/commands/cmd_info.cpp
e0ad65bda674d3ae78db0c52a6bec4549ee67b32
[user/henk/code/inspircd.git] / src / commands / cmd_info.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15
16 /** Handle /INFO. These command handlers can be reloaded by the core,
17  * and handle basic RFC1459 commands. Commands within modules work
18  * the same way, however, they can be fully unloaded, where these
19  * may not.
20  */
21 class CommandInfo : public Command
22 {
23  public:
24         /** Constructor for info.
25          */
26         CommandInfo ( Module* parent) : Command(parent,"INFO") { syntax = "[<servermask>]"; }
27         /** Handle command.
28          * @param parameters The parameters to the comamnd
29          * @param pcnt The number of parameters passed to teh command
30          * @param user The user issuing the command
31          * @return A value from CmdResult to indicate command success or failure.
32          */
33         CmdResult Handle(const std::vector<std::string>& parameters, User *user);
34         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
35         {
36                 if (parameters.size() > 0)
37                         return ROUTE_UNICAST(parameters[0]);
38                 return ROUTE_LOCALONLY;
39         }
40 };
41
42 static const char* const lines[] = {
43         "                   -/\\- \2InspIRCd\2 -\\/-",
44         "                 November 2002 - Present",
45         " ",
46         "\2Core Developers\2:",
47         "    Craig Edwards,          Brain,      <brain@inspircd.org>",
48         "    Craig McLure,           Craig,      <craig@inspircd.org>",
49         "    Robin Burchell,         w00t,       <w00t@inspircd.org>",
50         "    Oliver Lupton,          Om,         <om@inspircd.org>",
51         "    John Brooks,            Special,    <special@inspircd.org>",
52         "    Dennis Friis,           peavey,     <peavey@inspircd.org>",
53         "    Thomas Stagner,         aquanight,  <aquanight@inspircd.org>",
54         "    Uli Schlachter,         psychon,    <psychon@inspircd.org>",
55         "    Matt Smith,             dz,         <dz@inspircd.org>",
56         "    Daniel De Graaf,        danieldg,   <danieldg@inspircd.org>",
57         "                            jackmcbarn, <jackmcbarn@inspircd.org>",
58         " ",
59         "\2Regular Contributors\2:",
60         "    Majic          MacGyver        Namegduf       Ankit",
61         "    Phoenix        Taros",
62         " ",
63         "\2Other Contributors\2:",
64         "   dmb             Zaba            skenmy         GreenReaper",
65         "   Dan             Jason           satmd          owine",
66         "   Adremelech      John2           jilles         HiroP",
67         "   eggy            Bricker         AnMaster       djGrrr",
68         "   nenolod         Quension        praetorian     pippijn",
69         " ",
70         "\2Former Contributors\2:",
71         "   CC              jamie           typobox43      Burlex (win32)",
72         "   Stskeeps        ThaPrince       BuildSmart     Thunderhacker",
73         "   Skip            LeaChim",
74         " ",
75         "\2Thanks To\2:",
76         "   searchirc.com   irc-junkie.org  Brik",
77         " ",
78         " Best experienced with: \2An IRC client\2",
79         NULL
80 };
81
82 /** Handle /INFO
83  */
84 CmdResult CommandInfo::Handle (const std::vector<std::string>& parameters, User *user)
85 {
86         if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
87                 return CMD_SUCCESS;
88
89         int i=0;
90         while (lines[i])
91                 user->SendText(":%s %03d %s :%s", ServerInstance->Config->ServerName.c_str(), RPL_INFO, user->nick.c_str(), lines[i++]);
92         FOREACH_MOD(I_OnInfo,OnInfo(user));
93         user->SendText(":%s %03d %s :End of /INFO list", ServerInstance->Config->ServerName.c_str(), RPL_ENDOFINFO, user->nick.c_str());
94         return CMD_SUCCESS;
95 }
96
97 COMMAND_INIT(CommandInfo)