This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Rejoining channel

General support and discussion of Eggdrop bots.
Post Reply
h
hakim
Voice
Posts: 19
Joined: Sun Apr 23, 2006 3:39 am

Rejoining channel

Post by hakim »

Is there any way to change the time which the bot takes to rejoin channel (after it was kicked/banned)?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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).
Last edited by De Kus on Mon Apr 24, 2006 9:40 am, edited 3 times in total.
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...
h
hakim
Voice
Posts: 19
Joined: Sun Apr 23, 2006 3:39 am

Post by hakim »

De Kus wrote:you would most likely have to change some code in irc.mod.
Maybe you know what exactly should be changed?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

:P
Last edited by Alchera on Thu Apr 27, 2006 7:52 am, edited 1 time in total.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
h
hakim
Voice
Posts: 19
Joined: Sun Apr 23, 2006 3:39 am

Post by hakim »

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!
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

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?
h
hakim
Voice
Posts: 19
Joined: Sun Apr 23, 2006 3:39 am

Post by hakim »

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?
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

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: Select all

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?
h
hakim
Voice
Posts: 19
Joined: Sun Apr 23, 2006 3:39 am

Post by hakim »

THANK YOU VERY MUCH, KrzychuG!
It really worked :)
Post Reply