I'm testing my Bot with WinXp and PHP 5 an it works great.
But I've got one Problem.
I've got a dynamic IP and after the ping timeout, the bot reconnects, but doesn't rejoin the channels it was into before the ping timeout.
It doesn't run the row $irc->join( array('chan1','chan2') ); again
after the reconnection but a whois on the bot's nick is successful.
Am I missing something or is this just strange behavior on the bot-side? :D
And if so, how do I solve this problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The $irc->reconnect() is not needed after listen(), as the lib will do that alone because you use setAutoReconnect(TRUE). Should rejoin the channels after the connection was lost and reconnected.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I'm testing my Bot with WinXp and PHP 5 an it works great.
But I've got one Problem.
I've got a dynamic IP and after the ping timeout, the bot reconnects, but doesn't rejoin the channels it was into before the ping timeout.
It doesn't run the row $irc->join( array('chan1','chan2') ); again
after the reconnection but a whois on the bot's nick is successful.
Am I missing something or is this just strange behavior on the bot-side? :D
And if so, how do I solve this problem?
If you look at reconnect():
http://cvs.php.net/viewvc.cgi/pear/Net_SmartIRC/SmartIRC.php?revision=1.90&view=markup
you will see that it rejoins them if channel sync is activated
Aah...OK, thank you :)
So, I use this like that?:
$bot = &new jBot( );
$irc = &new Net_SmartIRC( );
$irc->setUseSockets( TRUE );
$irc->setAutoRetry(TRUE);
$irc->setAutoReconnect (TRUE);
$irc->setTransmitTimeout(180);
$irc->setReceiveTimeout(180);
$irc->setChannelSyncing(TRUE);
$irc->setDebug(SMARTIRC_DEBUG_ALL);
$irc->connect( $host, $port );
$irc->login( $nickname, $realname, 0, $ident );
$irc->message(SMARTIRC_TYPE_QUERY,$authservice,"AUTH $authname $authpassword");
$irc->join( array('chan1','chan2') );
$irc->listen( );
$irc->reconnect( );
Is this the right way to do that?
Anyway,
thanks for your help :)
The $irc->reconnect() is not needed after listen(), as the lib will do that alone because you use setAutoReconnect(TRUE). Should rejoin the channels after the connection was lost and reconnected.