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

- Made anti away flood system work just like anti nick flood (#0001205). NO_FLOOD_AWAY is now enabled and away-flood is set to 4 per 120s by default.

This commit is contained in:
Bram Matthys
2003-09-04 23:20:52 +00:00
parent bc5a744312
commit 49f5e68768
4 changed files with 16 additions and 14 deletions
+2
View File
@@ -2390,3 +2390,5 @@ seen. gmtime warning still there
- Fixed a bug in +f + modes-on-join + 't' subfloodtype, reported by Rocko (#0001228).
- Fixed a crashbug with +f and services, reported by Rocko (#0001227).
- And another +f + modes-on-join one...
- Made anti away flood system work just like anti nick flood (#0001205).
NO_FLOOD_AWAY is now enabled and away-flood is set to 4 per 120s by default.
+1 -1
View File
@@ -351,7 +351,7 @@
* NO_FLOOD_AWAY - enables limiting of how frequently a client can set /away
*/
#undef NO_FLOOD_AWAY
#define NO_FLOOD_AWAY
/*
* Define your network service names here.
+9 -12
View File
@@ -138,23 +138,20 @@ int m_away(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
}
#ifdef NO_FLOOD_AWAY
if (MyClient(sptr) && AWAY_PERIOD)
if (MyClient(sptr) && AWAY_PERIOD && !IsAnOper(sptr))
{
if ((sptr->user->flood.away_t + AWAY_PERIOD) <= timeofday)
sptr->user->flood.away_c = 0;
if (!IsAnOper(sptr))
{
sptr->user->flood.away_c = 0;
sptr->user->flood.away_t = timeofday;
if (sptr->user->flood.away_c < AWAY_COUNT)
sptr->user->flood.away_c++;
if (sptr->user->flood.away_c >= AWAY_COUNT)
{
sendto_one(sptr, err_str(ERR_TOOMANYAWAY), me.name, parv[0]);
return 0;
}
}
if (sptr->user->flood.away_c <= AWAY_COUNT)
sptr->user->flood.away_c++;
if (sptr->user->flood.away_c > AWAY_COUNT)
{
sendto_one(sptr, err_str(ERR_TOOMANYAWAY), me.name, parv[0]);
return 0;
}
}
#endif
/* Marking as away */
+4 -1
View File
@@ -1305,7 +1305,10 @@ void config_setdefaultsettings(aConfiguration *i)
i->oper_snomask = strdup(SNO_DEFOPER);
i->ident_read_timeout = 30;
i->ident_connect_timeout = 10;
i->nick_count = 3; i->nick_period = 60; /* nickflood protection: 3 per 60s */
i->nick_count = 3; i->nick_period = 60; /* nickflood protection: max 3 per 60s */
#ifdef NO_FLOOD_AWAY
i->away_count = 4; i->away_period = 120; /* awayflood protection: max 4 per 120s */
#endif
}
int init_conf(char *rootconf, int rehash)