]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_info/cmd_info.cpp
7f1e923c9296d42e8cf09e01a7ec2e25264073be
[user/henk/code/inspircd.git] / src / coremods / core_info / cmd_info.cpp
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2011 Jackmcbarn <jackmcbarn@jackmcbarn.no-ip.org>
5  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
6  *   Copyright (C) 2007-2008 Robin Burchell <robin+git@viroteck.net>
7  *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
8  *
9  * This file is part of InspIRCd.  InspIRCd is free software: you can
10  * redistribute it and/or modify it under the terms of the GNU General Public
11  * License as published by the Free Software Foundation, version 2.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  */
21
22
23 #include "inspircd.h"
24
25 /** Handle /INFO.
26  */
27 class CommandInfo : public Command
28 {
29  public:
30         /** Constructor for info.
31          */
32         CommandInfo(Module* parent) : Command(parent,"INFO")
33         {
34                 Penalty = 4;
35                 syntax = "[<servername>]";
36         }
37
38         /** Handle command.
39          * @param parameters The parameters to the command
40          * @param user The user issuing the command
41          * @return A value from CmdResult to indicate command success or failure.
42          */
43         CmdResult Handle(const std::vector<std::string>& parameters, User *user);
44         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
45         {
46                 if (parameters.size() > 0)
47                         return ROUTE_UNICAST(parameters[0]);
48                 return ROUTE_LOCALONLY;
49         }
50 };
51
52 static const char* const lines[] = {
53         "                   -/\\- \2InspIRCd\2 -\\/-",
54         "                 November 2002 - Present",
55         " ",
56         "\2Core Developers\2:",
57         "    Craig Edwards,          Brain,      <brain@inspircd.org>",
58         "    Craig McLure,           Craig,      <craig@inspircd.org>",
59         "    Robin Burchell,         w00t,       <w00t@inspircd.org>",
60         "    Oliver Lupton,          Om,         <om@inspircd.org>",
61         "    John Brooks,            Special,    <special@inspircd.org>",
62         "    Dennis Friis,           peavey,     <peavey@inspircd.org>",
63         "    Thomas Stagner,         aquanight,  <aquanight@inspircd.org>",
64         "    Uli Schlachter,         psychon,    <psychon@inspircd.org>",
65         "    Matt Smith,             dz,         <dz@inspircd.org>",
66         "    Daniel De Graaf,        danieldg,   <danieldg@inspircd.org>",
67         "                            jackmcbarn, <jackmcbarn@inspircd.org>",
68         "    Attila Molnar,          Attila,     <attilamolnar@hush.com>",
69         " ",
70         "\2Regular Contributors\2:",
71         "    Adam           SaberUK",
72         " ",
73         "\2Other Contributors\2:",
74         "    ChrisTX        Shawn           Shutter",
75         " ",
76         "\2Former Contributors\2:",
77         "   dmb             Zaba            skenmy         GreenReaper",
78         "   Dan             Jason           satmd          owine",
79         "   Adremelech      John2           jilles         HiroP",
80         "   eggy            Bricker         AnMaster       djGrrr",
81         "   nenolod         Quension        praetorian     pippijn",
82         "   CC              jamie           typobox43      Burlex (win32)",
83         "   Stskeeps        ThaPrince       BuildSmart     Thunderhacker",
84         "   Skip            LeaChim         Majic          MacGyver",
85         "   Namegduf        Ankit           Phoenix        Taros",
86         " ",
87         "\2Thanks To\2:",
88         "   searchirc.com   irc-junkie.org  Brik           fraggeln",
89         " ",
90         " Best experienced with: \2An IRC client\2",
91         NULL
92 };
93
94 /** Handle /INFO
95  */
96 CmdResult CommandInfo::Handle (const std::vector<std::string>& parameters, User *user)
97 {
98         if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
99                 return CMD_SUCCESS;
100
101         int i=0;
102         while (lines[i])
103                 user->SendText(":%s %03d %s :%s", ServerInstance->Config->ServerName.c_str(), RPL_INFO, user->nick.c_str(), lines[i++]);
104         FOREACH_MOD(OnInfo, (user));
105         user->SendText(":%s %03d %s :End of /INFO list", ServerInstance->Config->ServerName.c_str(), RPL_ENDOFINFO, user->nick.c_str());
106         return CMD_SUCCESS;
107 }
108
109 COMMAND_INIT(CommandInfo)