ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_lusers.c
Revision: 1029
Committed: Sun Nov 8 13:10:50 2009 UTC (16 years, 8 months ago) by michael
Content type: text/x-csrc
Original Path: ircd-hybrid-7.3/modules/m_lusers.c
File size: 3013 byte(s)
Log Message:
- branch off trunk to create 7.3 branch

File Contents

# User Rev Content
1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     * m_lusers.c: Sends 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 "handlers.h"
27     #include "client.h"
28     #include "ircd.h"
29     #include "numeric.h"
30     #include "s_serv.h" /* hunt_server */
31     #include "s_user.h" /* show_lusers */
32     #include "send.h"
33     #include "s_conf.h"
34     #include "msg.h"
35     #include "parse.h"
36     #include "modules.h"
37    
38 michael 980 static void m_lusers(struct Client *, struct Client *, int, char *[]);
39     static void ms_lusers(struct Client *, struct Client *, int, char *[]);
40 adx 30
41     struct Message lusers_msgtab = {
42     "LUSERS", 0, 0, 0, 0, MFLG_SLOW, 0,
43     {m_unregistered, m_lusers, ms_lusers, m_ignore, ms_lusers, m_ignore}
44     };
45 michael 885
46 adx 30 #ifndef STATIC_MODULES
47     void
48     _modinit(void)
49     {
50     mod_add_cmd(&lusers_msgtab);
51     }
52    
53     void
54     _moddeinit(void)
55     {
56     mod_del_cmd(&lusers_msgtab);
57     }
58    
59 knight 31 const char *_version = "$Revision$";
60 adx 30 #endif
61 michael 885
62 adx 30 /* m_lusers - LUSERS message handler
63     * parv[0] = sender
64     * parv[1] = host/server mask.
65     * parv[2] = server to query
66     *
67     * 199970918 JRL hacked to ignore parv[1] completely and require parc > 3
68     * to cause a force
69     *
70     * 2003 hacked parv[1] back in, by request of efnet admins/opers -Dianora
71     */
72     static void
73     m_lusers(struct Client *client_p, struct Client *source_p,
74 michael 980 int parc, char *parv[])
75 adx 30 {
76     static time_t last_used = 0;
77    
78 adx 269 if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
79 adx 30 {
80     /* safe enough to give this on a local connect only */
81 michael 980 sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, parv[0]);
82 adx 30 return;
83     }
84    
85 michael 980 last_used = CurrentTime;
86    
87 adx 30 if (parc > 2 && !ConfigFileEntry.disable_remote)
88 michael 980 if (hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2,
89     parc, parv) != HUNTED_ISME)
90 adx 30 return;
91    
92     show_lusers(source_p);
93     }
94    
95     /* ms_lusers - LUSERS message handler for servers and opers
96     * parv[0] = sender
97     * parv[1] = host/server mask.
98     * parv[2] = server to query
99     */
100     static void
101     ms_lusers(struct Client *client_p, struct Client *source_p,
102 michael 980 int parc, char *parv[])
103 adx 30 {
104     if (parc > 2)
105 michael 980 if (hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2,
106     parc, parv) != HUNTED_ISME)
107 adx 30 return;
108    
109 adx 269 if (IsClient(source_p))
110 adx 30 show_lusers(source_p);
111     }

Properties

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