BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => AO 0.6 support => Topic started by: Waqu on November 23, 2010, 07:57:41 pm

Title: Wtb automatic !irc connect
Post by: Waqu on November 23, 2010, 07:57:41 pm
Wtb automatic !irc connect after loosing irc connection after whatever reason the irc desided to go offline, but the game chat still works.
Title: Re: Wtb automatic !irc connect
Post by: Khalem on November 27, 2010, 10:52:04 pm
Check out the irc reconnect setting which should do what you want :)
Title: Re: Wtb automatic !irc connect
Post by: Waqu on December 03, 2010, 01:16:24 pm
Reconnect:  On
  Description: Should the bot automatically reconnect to IRC?
  Change to: [ On | Off ]

But the problem is, it doesnt reconnect.
Title: Re: Wtb automatic !irc connect
Post by: Malaxia on December 29, 2010, 03:36:48 pm
I have the same issue, my bots are connected through IRC and there's only 1 of the 3 dimension that is automatically connected each time I restart the bots. Annoying since I have no admin on RK2...

Where is it handled? Maybe I can find a fix for that.
Title: Re: Wtb automatic !irc connect
Post by: GBH on January 10, 2011, 02:11:50 pm
Just a note.

This only seems to work by re-connecting on a bot restart.

What it doesn't do is to reconnect to IRC if the chat server splits or you get some random timeout. that needs a manual !irc connect or a restart.

G
Title: Re: Wtb automatic !irc connect
Post by: Waqu on January 12, 2011, 01:43:05 pm
Yes bot reconnects after restarting the bot, but what i need is the auto-reconnect after random timeout. Can we get that somehow?
Title: Re: Wtb automatic !irc connect
Post by: Waqu on February 10, 2011, 09:26:40 pm
No one cares?
Title: Re: Wtb automatic !irc connect
Post by: redmagician on May 11, 2011, 06:11:59 am
I've spent a lot of time trying to tackle down the cause of the issue.
I went from rewriting IRC.php to updating SmartIRC.php to the latest version to finally a simple modification.
It's been a brutal two days but I finally have the most straightforward solution I could come up with.

The issue stems from a lack of error checking in SmartIRC.php
The code in IRC.php actually works beautifully provided there are some changes to SmartIRC.php

There are two ways to fix auto reconnect.
You could update to the latest version of SmartIRC, provided you update about four lines of code (the socket_select timeout and the external dependencies).
This would also mean changing _rawreceive() in IRC.php to listenOnce() which essentially does the same thing.

What I suggest is to just modify the SmartIRC.php that's inside the Sources directory of the bot.
I've included a modified version as an attachment.
Inside the function _rawreceive() I added the following snippet of code.

if ($rawdata === false) {
// reading from the socket failed, the connection is broken
return false;
}

This should be added right above the line "$this->_checktimer();"
That line only appears once inside SmartIRC.php so that's a rather nice way of identifying where the code should go.

P.S.
I would not say that no one cares but I would imagine the amount of people that use IRC are few.
The ones who do use IRC either put up with the issue or don't seem to be driven to fix the issue themselves.
Title: Re: Wtb automatic !irc connect
Post by: Waqu on May 11, 2011, 03:15:32 pm
Thanks for the modified file, now just have to wait and see if it reconnects or not.
Title: Re: Wtb automatic !irc connect
Post by: Waqu on June 26, 2011, 03:01:44 pm
Seems to be working fine now.
Title: Re: Wtb automatic !irc connect
Post by: Zweiblum on July 17, 2011, 11:00:03 am
thx for this
SimplePortal 2.3.7 © 2008-2024, SimplePortal