egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Rejoining channel

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop Help
View previous topic :: View next topic  
Author Message
hakim
Voice


Joined: 23 Apr 2006
Posts: 19

PostPosted: Sun Apr 23, 2006 1:31 pm    Post subject: Rejoining channel Reply with quote

Is there any way to change the time which the bot takes to rejoin channel (after it was kicked/banned)?
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sun Apr 23, 2006 1:37 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
hakim
Voice


Joined: 23 Apr 2006
Posts: 19

PostPosted: Mon Apr 24, 2006 7:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Apr 24, 2006 8:05 pm    Post subject: Reply with quote

Razz
_________________
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
View user's profile Send private message Visit poster's website
hakim
Voice


Joined: 23 Apr 2006
Posts: 19

PostPosted: Tue Apr 25, 2006 1:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
KrzychuG
Master


Joined: 16 Aug 2003
Posts: 306
Location: Torun, Poland

PostPosted: Tue Apr 25, 2006 2:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
hakim
Voice


Joined: 23 Apr 2006
Posts: 19

PostPosted: Tue Apr 25, 2006 5:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
KrzychuG
Master


Joined: 16 Aug 2003
Posts: 306
Location: Torun, Poland

PostPosted: Wed Apr 26, 2006 2:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
hakim
Voice


Joined: 23 Apr 2006
Posts: 19

PostPosted: Wed Apr 26, 2006 8:30 pm    Post subject: Reply with quote

THANK YOU VERY MUCH, KrzychuG!
It really worked Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber