1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 #include <sys/resource.h>
17 /* This is just to be completely certain that the change which fixed getrusage on RH7 doesn't break anything else -- Om */
23 #include "inspircd_win32wrapper.h"
24 #pragma comment(lib, "psapi.lib")
29 /** Handle /STATS. These command handlers can be reloaded by the core,
30 * and handle basic RFC1459 commands. Commands within modules work
31 * the same way, however, they can be fully unloaded, where these
34 class CommandStats : public Command
37 /** Constructor for stats.
39 CommandStats (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"STATS",0,1) { syntax = "<stats-symbol> [<servername>]"; }
41 * @param parameters The parameters to the comamnd
42 * @param pcnt The number of parameters passed to teh command
43 * @param user The user issuing the command
44 * @return A value from CmdResult to indicate command success or failure.
46 CmdResult Handle(const std::vector<std::string>& parameters, User *user);
49 CmdResult CommandStats::Handle (const std::vector<std::string>& parameters, User *user)
54 if (parameters[0].empty())
56 user->WriteNumeric(ERR_NEEDMOREPARAMS, "%s STATS :Not enough parameters.", user->nick.c_str());
59 char search = parameters[0][0];
60 ServerInstance->DoStats(search, user, values);
61 for (size_t i = 0; i < values.size(); i++)
62 user->Write(":%s", values[i].c_str());
68 COMMAND_INIT(CommandStats)