1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 21:23:12 +02:00

- Limit watch status requests to one per time, more will often flood you off

and is stupid/useless.
This commit is contained in:
Bram Matthys
2008-08-09 11:17:50 +00:00
parent b809428392
commit 6a641aa5f5
2 changed files with 10 additions and 4 deletions
+2
View File
@@ -1642,3 +1642,5 @@
'error setting max fd's to 9223372036854775807' which prevents the ircd
from booting up. Reported by btcentral and Bock. This hack might not be
totally correct though ;).
- Limit watch status requests to one per time, more will often flood you off
and is stupid/useless.
+8 -4
View File
@@ -136,7 +136,7 @@ DLLFUNC CMD_FUNC(m_watch)
char *s, **pav = parv, *user;
char *p = NULL, *def = "l";
int awaynotify = 0;
int did_l=0, did_s=0;
if (parc < 2)
{
@@ -212,12 +212,14 @@ DLLFUNC CMD_FUNC(m_watch)
* their WATCH list. I imagine this could be CPU intensive if its
* done alot, perhaps an auto-lag on this?
*/
if (*s == 'S' || *s == 's')
if ((*s == 'S' || *s == 's') && !did_s)
{
Link *lp;
aWatch *anptr;
int count = 0;
did_s = 1;
/*
* Send a list of how many users they have on their WATCH list
* and how many WATCH lists they are on.
@@ -274,10 +276,12 @@ DLLFUNC CMD_FUNC(m_watch)
* their WATCH list AND if they are online or offline? Sheesh,
* greedy arn't we?
*/
if (*s == 'L' || *s == 'l')
if ((*s == 'L' || *s == 'l') && !did_l)
{
Link *lp = sptr->watch;
did_l = 1;
while (lp)
{
if ((acptr =