Rename connect_delay to post_registration_delay. This matches the ircd-ratbox feature, and better describes what it actually is. Also make sure to set localClient->firsttime on registration, so that the delay counts from the right time.
This commit is contained in:
parent
1bb7964378
commit
b3a0099139
7 changed files with 16 additions and 14 deletions
|
@ -603,13 +603,13 @@ general {
|
||||||
pace_wait = 10 seconds;
|
pace_wait = 10 seconds;
|
||||||
short_motd = no;
|
short_motd = no;
|
||||||
ping_cookie = no;
|
ping_cookie = no;
|
||||||
connect_delay = 0 seconds;
|
|
||||||
connect_timeout = 30 seconds;
|
connect_timeout = 30 seconds;
|
||||||
default_ident_timeout = 5;
|
default_ident_timeout = 5;
|
||||||
disable_auth = no;
|
disable_auth = no;
|
||||||
no_oper_flood = yes;
|
no_oper_flood = yes;
|
||||||
max_targets = 4;
|
max_targets = 4;
|
||||||
client_flood_max_lines = 20;
|
client_flood_max_lines = 20;
|
||||||
|
post_registration_delay = 0 seconds;
|
||||||
use_whois_actually = no;
|
use_whois_actually = no;
|
||||||
oper_only_umodes = operwall, locops, servnotice;
|
oper_only_umodes = operwall, locops, servnotice;
|
||||||
oper_umodes = locops, servnotice, operwall, wallop;
|
oper_umodes = locops, servnotice, operwall, wallop;
|
||||||
|
|
|
@ -1288,12 +1288,6 @@ general {
|
||||||
*/
|
*/
|
||||||
ping_cookie = no;
|
ping_cookie = no;
|
||||||
|
|
||||||
/* connect delay: wait this long before processing commands from a newly
|
|
||||||
* registered user. Used to allow network utility bots to perform any actions
|
|
||||||
* (such as host changes or proxy scanning) before the user can join channels.
|
|
||||||
*/
|
|
||||||
connect_delay = 2 seconds;
|
|
||||||
|
|
||||||
/* connect timeout: sets how long we should wait for a connection
|
/* connect timeout: sets how long we should wait for a connection
|
||||||
* request to succeed
|
* request to succeed
|
||||||
*/
|
*/
|
||||||
|
@ -1318,6 +1312,12 @@ general {
|
||||||
*/
|
*/
|
||||||
max_targets = 4;
|
max_targets = 4;
|
||||||
|
|
||||||
|
/* post-registration delay: wait this long before processing commands from a newly
|
||||||
|
* registered user. Used to allow network utility bots to perform any actions
|
||||||
|
* (such as host changes or proxy scanning) before the user can join channels.
|
||||||
|
*/
|
||||||
|
post_registration_delay = 2 seconds;
|
||||||
|
|
||||||
/* use_whois_actually: send clients requesting a whois a numeric
|
/* use_whois_actually: send clients requesting a whois a numeric
|
||||||
* giving the real IP of non-spoofed clients to prevent DNS abuse.
|
* giving the real IP of non-spoofed clients to prevent DNS abuse.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -215,7 +215,7 @@ struct config_file_entry
|
||||||
int tkline_expire_notices;
|
int tkline_expire_notices;
|
||||||
int use_whois_actually;
|
int use_whois_actually;
|
||||||
int disable_auth;
|
int disable_auth;
|
||||||
int connect_delay;
|
int post_registration_delay;
|
||||||
int connect_timeout;
|
int connect_timeout;
|
||||||
int burst_away;
|
int burst_away;
|
||||||
int reject_ban_time;
|
int reject_ban_time;
|
||||||
|
|
|
@ -2748,7 +2748,7 @@ static struct ConfEntry conf_general_table[] =
|
||||||
{ "client_exit", CF_YESNO, NULL, 0, &ConfigFileEntry.client_exit },
|
{ "client_exit", CF_YESNO, NULL, 0, &ConfigFileEntry.client_exit },
|
||||||
{ "collision_fnc", CF_YESNO, NULL, 0, &ConfigFileEntry.collision_fnc },
|
{ "collision_fnc", CF_YESNO, NULL, 0, &ConfigFileEntry.collision_fnc },
|
||||||
{ "resv_fnc", CF_YESNO, NULL, 0, &ConfigFileEntry.resv_fnc },
|
{ "resv_fnc", CF_YESNO, NULL, 0, &ConfigFileEntry.resv_fnc },
|
||||||
{ "connect_delay", CF_TIME, NULL, 0, &ConfigFileEntry.connect_delay },
|
{ "post_registration_delay", CF_TIME, NULL, 0, &ConfigFileEntry.post_registration_delay },
|
||||||
{ "connect_timeout", CF_TIME, NULL, 0, &ConfigFileEntry.connect_timeout },
|
{ "connect_timeout", CF_TIME, NULL, 0, &ConfigFileEntry.connect_timeout },
|
||||||
{ "default_floodcount", CF_INT, NULL, 0, &ConfigFileEntry.default_floodcount },
|
{ "default_floodcount", CF_INT, NULL, 0, &ConfigFileEntry.default_floodcount },
|
||||||
{ "default_ident_timeout", CF_INT, NULL, 0, &ConfigFileEntry.default_ident_timeout },
|
{ "default_ident_timeout", CF_INT, NULL, 0, &ConfigFileEntry.default_ident_timeout },
|
||||||
|
|
|
@ -133,10 +133,10 @@ parse_client_queued(struct Client *client_p)
|
||||||
if(client_p->localClient->sent_parsed >= allow_read)
|
if(client_p->localClient->sent_parsed >= allow_read)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* connect_delay hack. Don't process any messages from a new client for $n seconds,
|
/* post_registration_delay hack. Don't process any messages from a new client for $n seconds,
|
||||||
* to allow network bots to do their thing before channels can be joined.
|
* to allow network bots to do their thing before channels can be joined.
|
||||||
*/
|
*/
|
||||||
if (rb_current_time() < client_p->localClient->firsttime + ConfigFileEntry.connect_delay)
|
if (rb_current_time() < client_p->localClient->firsttime + ConfigFileEntry.post_registration_delay)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
dolen = rb_linebuf_get(&client_p->localClient->
|
dolen = rb_linebuf_get(&client_p->localClient->
|
||||||
|
|
|
@ -386,7 +386,9 @@ register_local_user(struct Client *client_p, struct Client *source_p)
|
||||||
if(source_p->preClient->auth.cid)
|
if(source_p->preClient->auth.cid)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
client_p->localClient->last = rb_current_time();
|
/* Set firsttime here so that post_registration_delay works from registration,
|
||||||
|
* rather than initial connection. */
|
||||||
|
source_p->localClient->firsttime = client_p->localClient->last = rb_current_time();
|
||||||
|
|
||||||
/* XXX - fixme. we shouldnt have to build a users buffer twice.. */
|
/* XXX - fixme. we shouldnt have to build a users buffer twice.. */
|
||||||
if(!IsGotId(source_p) && (strchr(source_p->username, '[') != NULL))
|
if(!IsGotId(source_p) && (strchr(source_p->username, '[') != NULL))
|
||||||
|
|
|
@ -152,9 +152,9 @@ static struct InfoStruct info_table[] = {
|
||||||
"Time to allow per client_flood_message_num outside of burst",
|
"Time to allow per client_flood_message_num outside of burst",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"connect_delay",
|
"post_registration_delay",
|
||||||
OUTPUT_DECIMAL,
|
OUTPUT_DECIMAL,
|
||||||
&ConfigFileEntry.connect_delay,
|
&ConfigFileEntry.post_registration_delay,
|
||||||
"Time to wait before processing commands from a new client",
|
"Time to wait before processing commands from a new client",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue