1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 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 ( Module* parent) : Command(parent,"STATS",1,2) { 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);
47 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
49 if (parameters.size() > 1)
50 return ROUTE_UNICAST(parameters[1]);
51 return ROUTE_LOCALONLY;
55 CmdResult CommandStats::Handle (const std::vector<std::string>& parameters, User *user)
57 if (parameters.size() > 1 && parameters[1] != ServerInstance->Config->ServerName)
60 char search = parameters[0][0];
61 ServerInstance->DoStats(search, user, values);
62 for (size_t i = 0; i < values.size(); i++)
63 user->SendText(":%s", values[i].c_str());
68 COMMAND_INIT(CommandStats)