1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 #include "commands/cmd_lusers.h"
18 extern "C" command_t* init_command(InspIRCd* Instance)
20 return new cmd_lusers(Instance);
25 CmdResult cmd_lusers::Handle (const char** parameters, int pcnt, userrec *user)
27 // this lusers command shows one server at all times because
28 // a protocol module must override it to show those stats.
29 user->WriteServ("251 %s :There are %d users and %d invisible on 1 server",user->nick,ServerInstance->UserCount()-ServerInstance->InvisibleUserCount(),ServerInstance->InvisibleUserCount());
30 if (ServerInstance->OperCount())
31 user->WriteServ("252 %s %d :operator(s) online",user->nick,ServerInstance->OperCount());
32 if (ServerInstance->UnregisteredUserCount())
33 user->WriteServ("253 %s %d :unknown connections",user->nick,ServerInstance->UnregisteredUserCount());
34 if (ServerInstance->ChannelCount())
35 user->WriteServ("254 %s %d :channels formed",user->nick,ServerInstance->ChannelCount());
36 if (ServerInstance->LocalUserCount())
37 user->WriteServ("255 %s :I have %d clients and 0 servers",user->nick,ServerInstance->LocalUserCount());