BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.4 support => Topic started by: Parfet on August 18, 2007, 12:24:40 am

Title: possible fix for irc reconnect
Post by: Parfet on August 18, 2007, 12:24:40 am
this *seems* to work on our bot most of the time, and is a pretty easy fix, sets up the bot to reconnect on timeout if the setting is on in the config
change the cron function to look like this
Code: [Select]
/*
This gets called on cron
*/
function cron()
{
if (($this->irc != null) && (!$this->irc->_rawreceive()))
{
if($this->bot->settings->get("Irc","Reconnect")==True) {
$this->bot->send_gc("IRC connection lost...");
$this->irc_connect();
} else {
$this->irc_disconnect();
$this->bot->send_gc("IRC connection lost...");
}
}
}
it will report to org chat that irc has died, then report that it is reconnecting, so far seems to work well
Title: Re: possible fix for irc reconnect
Post by: Alreadythere on August 18, 2007, 02:35:48 pm
I think you should call irc_disconnect() anyways, even if you want to reconnect right after. Just to be sure all internal settings are correctly cleared up.

Otherwise this looks like a nice fix.
SimplePortal 2.3.7 © 2008-2024, SimplePortal