]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_lusers.cpp
Fix passing wrong instance to resolver
[user/henk/code/inspircd.git] / src / cmd_lusers.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #include "users.h"
18 #include "commands.h"
19 #include "helperfuncs.h"
20 #include "inspircd.h"
21 #include "commands/cmd_lusers.h"
22
23 extern InspIRCd* ServerInstance;
24
25 void cmd_lusers::Handle (const char** parameters, int pcnt, userrec *user)
26 {
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->usercnt()-ServerInstance->usercount_invisible(),ServerInstance->usercount_invisible());
30         if (ServerInstance->usercount_opers())
31                 user->WriteServ("252 %s %d :operator(s) online",user->nick,ServerInstance->usercount_opers());
32         if (ServerInstance->usercount_unknown())
33                 user->WriteServ("253 %s %d :unknown connections",user->nick,ServerInstance->usercount_unknown());
34         if (ServerInstance->chancount())
35                 user->WriteServ("254 %s %d :channels formed",user->nick,ServerInstance->chancount());
36         if (ServerInstance->local_count())
37                 user->WriteServ("254 %s :I have %d clients and 0 servers",user->nick,ServerInstance->local_count());
38 }
39