ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_users.c
Revision: 1836
Committed: Fri Apr 19 19:54:11 2013 UTC (13 years, 5 months ago) by michael
Content type: text/x-csrc
File size: 3268 byte(s)
Log Message:
- m_users, show_lusers: removed extranous arguments to sendto_one()

File Contents

# User Rev Content
1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     * m_users.c: Gives some basic user statistics.
4     *
5     * Copyright (C) 2002 by the past and present ircd coders, and others.
6     *
7     * This program is free software; you can redistribute it and/or modify
8     * it under the terms of the GNU General Public License as published by
9     * the Free Software Foundation; either version 2 of the License, or
10     * (at your option) any later version.
11     *
12     * This program is distributed in the hope that it will be useful,
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     * GNU General Public License for more details.
16     *
17     * You should have received a copy of the GNU General Public License
18     * along with this program; if not, write to the Free Software
19     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20     * USA
21     *
22 knight 31 * $Id$
23 adx 30 */
24    
25     #include "stdinc.h"
26     #include "client.h"
27     #include "ircd.h"
28     #include "numeric.h"
29     #include "s_serv.h"
30 michael 1309 #include "conf.h"
31 adx 30 #include "send.h"
32     #include "parse.h"
33     #include "modules.h"
34    
35    
36     /*
37     * m_users
38     * parv[0] = sender prefix
39     * parv[1] = servername
40     */
41     static void
42     m_users(struct Client *client_p, struct Client *source_p,
43     int parc, char *parv[])
44     {
45 adx 269 static time_t last_used = 0;
46    
47     if (last_used + ConfigFileEntry.pace_wait_simple > CurrentTime)
48     {
49 michael 1834 sendto_one(source_p, form_str(RPL_LOAD2HI),
50 michael 1121 me.name, source_p->name);
51 adx 269 return;
52     }
53    
54 michael 435 last_used = CurrentTime;
55    
56 adx 30 if (!ConfigFileEntry.disable_remote)
57     if (hunt_server(client_p, source_p, ":%s USERS :%s", 1,
58     parc, parv) != HUNTED_ISME)
59     return;
60    
61 michael 1834 sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name,
62 adx 30 ConfigServerHide.hide_servers ? Count.total : Count.local,
63 adx 268 ConfigServerHide.hide_servers ? Count.max_tot : Count.max_loc);
64 michael 1834 sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name,
65 michael 1836 Count.total, Count.max_tot);
66 adx 30 }
67    
68     /*
69     * mo_users
70     * parv[0] = sender prefix
71     * parv[1] = servername
72     */
73     static void
74     mo_users(struct Client *client_p, struct Client *source_p,
75     int parc, char *parv[])
76     {
77     if (hunt_server(client_p, source_p, ":%s USERS :%s", 1,
78 michael 435 parc, parv) != HUNTED_ISME)
79 adx 30 return;
80    
81 michael 1219 if (!HasUMode(source_p, UMODE_OPER) && ConfigServerHide.hide_servers)
82 michael 1834 sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name,
83 michael 1836 Count.total, Count.max_tot);
84 adx 30 else
85 michael 1834 sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name,
86 michael 1836 Count.local, Count.max_loc);
87 adx 30
88 michael 1834 sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name,
89 michael 1836 Count.total, Count.max_tot);
90 adx 30 }
91 michael 1230
92     static struct Message users_msgtab = {
93     "USERS", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
94     { m_unregistered, m_users, mo_users, m_ignore, mo_users, m_ignore }
95     };
96    
97     static void
98     module_init(void)
99     {
100     mod_add_cmd(&users_msgtab);
101     }
102    
103     static void
104     module_exit(void)
105     {
106     mod_del_cmd(&users_msgtab);
107     }
108    
109     struct module module_entry = {
110     .node = { NULL, NULL, NULL },
111     .name = NULL,
112     .version = "$Revision$",
113     .handle = NULL,
114     .modinit = module_init,
115     .modexit = module_exit,
116     .flags = 0
117     };

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision