| View previous topic :: View next topic |
| Author |
Message |
hakim Voice
Joined: 23 Apr 2006 Posts: 19
|
Posted: Sun Apr 23, 2006 1:31 pm Post subject: Rejoining channel |
|
|
| Is there any way to change the time which the bot takes to rejoin channel (after it was kicked/banned)? |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sun Apr 23, 2006 1:37 pm Post subject: |
|
|
you would most likely have to change some code in irc.mod.
Edit: If I knew, I would have given you a hint were to find it (search keywoard, thread or at least file and function name). _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Last edited by De Kus on Mon Apr 24, 2006 9:40 am; edited 3 times in total |
|
| Back to top |
|
 |
hakim Voice
Joined: 23 Apr 2006 Posts: 19
|
Posted: Mon Apr 24, 2006 7:04 am Post subject: |
|
|
| De Kus wrote: | | you would most likely have to change some code in irc.mod. |
Maybe you know what exactly should be changed? |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Apr 24, 2006 8:05 pm Post subject: |
|
|
 _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Last edited by Alchera on Thu Apr 27, 2006 7:52 am; edited 1 time in total |
|
| Back to top |
|
 |
hakim Voice
Joined: 23 Apr 2006 Posts: 19
|
Posted: Tue Apr 25, 2006 1:18 pm Post subject: |
|
|
| Alchera wrote: | | De Kus wrote: | | Edit: If I knew, I would have given you a hint were to find it (search keywoard, thread or at least file and function name). |
You can read, right? |
Just look when I've posted the reply and when De Kus edited his post! |
|
| Back to top |
|
 |
KrzychuG Master

Joined: 16 Aug 2003 Posts: 306 Location: Torun, Poland
|
Posted: Tue Apr 25, 2006 2:36 pm Post subject: |
|
|
You won't speed it up by modifying source or by doing anything else. There is nothing what could delay rejoin in irc.mod and any other place. You can take a look at src/mod/irc.mod/chan.c gotkick() function if you wish ;)
The only change to speed it up a little is to change queues system or at least modifying msgrate setting (src/mod/server.mod/server.c). _________________ Que? |
|
| Back to top |
|
 |
hakim Voice
Joined: 23 Apr 2006 Posts: 19
|
Posted: Tue Apr 25, 2006 5:04 pm Post subject: |
|
|
Thanks for info KrzychuG.
Now I see that it only pauses for a longer time before rejoining if it's banned (even chanserv removes the ban instantly, preventing it from rejoining) and it rejoins instantly when he's only kicked. Maybe there's some setting concerning bans? |
|
| Back to top |
|
 |
KrzychuG Master

Joined: 16 Aug 2003 Posts: 306 Location: Torun, Poland
|
Posted: Wed Apr 26, 2006 2:22 pm Post subject: |
|
|
Well, you could force it to join channel right after the ban is removed but i'm not sure how server will react on that kind of flood.
To do that you should add one line in src/mod/irc.mod/chan.c got474() function. It's responsible for reacting on "can't join, i'm banned" server reply. You can put there JOIN command what would force bot to try to join and probably once again gave reply like "can't join, i'm banned". After some time and problably right after chanserver will remove ban bot will join channel. New function should look like this:
| Code: |
static int got474(char *from, char *msg)
{
char *chname;
struct chanset_t *chan;
newsplit(&msg);
chname = newsplit(&msg);
/* !channel short names (also referred to as 'description names'
* can be received by skipping over the unique ID.
*/
if ((chname[0] == '!') && (strlen(chname) > CHANNEL_ID_LEN)) {
chname += CHANNEL_ID_LEN;
chname[0] = '!';
}
/* We use dname because name is first set on JOIN and we might not
* have joined the channel yet.
*/
chan = findchan_by_dname(chname);
if (chan) {
putlog(LOG_JOIN, chan->dname, IRC_BANNEDFROMCHAN, chan->dname);
check_tcl_need(chan->dname, "unban");
chan = findchan_by_dname(chname);
if (!chan)
return 0;
dprintf(DP_MODE, "JOIN %s\n", chan->name); /* this one will let bot to try joining once again till if succeed */
if (chan->need_unban[0])
do_tcl("need-unban", chan->need_unban);
} else
putlog(LOG_JOIN, chname, IRC_BANNEDFROMCHAN, chname);
return 0;
}
|
It's a bit twisted and maybe dangerous (bot may be kicked out of server with excees flood message) but may work. _________________ Que? |
|
| Back to top |
|
 |
hakim Voice
Joined: 23 Apr 2006 Posts: 19
|
Posted: Wed Apr 26, 2006 8:30 pm Post subject: |
|
|
THANK YOU VERY MUCH, KrzychuG!
It really worked  |
|
| Back to top |
|
 |
|