collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: IRC relay goes dead  (Read 22609 times)

0 Members and 1 Guest are viewing this topic.

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
IRC relay goes dead
« on: July 17, 2009, 08:00:53 am »
Yea, it's me again.  That annoying guy that keeps coming around here asking questions.

So I got the bot setup in an IRC channel and everything works fine for a while, but it goes dead several times a day and I have to do !irc connect to get the link established again.  Weird thing is that the bot is in the IRC channel, and working fine in guild, but traffic is not going between the two until I issue the connect command again.  Not quite sure what's causing it to flake out.

Any suggestions?

Thanks.

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #1 on: July 18, 2009, 01:39:51 am »
OK, just a little more info on this.  Commands like !online in the IRC channel still work, but the bot stops relaying chat back and forth from guild chat / IRC.

Any ideas how to fix this to be more consistent?


Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #2 on: July 18, 2009, 08:07:05 pm »
This sounds very odd and i honestly cannot think of any reason why this would happen. Especially if the bot is responding to commands on IRC.

Does the text to be relayed display in the console?

BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #3 on: July 18, 2009, 09:41:14 pm »
Yes, displaying fine in console, but stops relaying to IRC.

I've been messing around with the MaxRelaySize setting to see if I can find something more reliable.  Smaller seems to make it work for longer periods of time, but I haven't found a magic setting that keeps it working all the time yet.

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #4 on: July 21, 2009, 07:05:28 pm »
Well, it's still very unreliable.  I played around with MaxRelaySize a bit but none of that really helped.  Stuff like the !online command still work and will report back to IRC, but the chat just stops getting relayed anywhere from 10 to 30 minutes or so.

It would be nice if you could tell the bot to reconnect to the IRC channel from the IRC channel, but that command seems to be disabled from IRC. 

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #5 on: July 25, 2009, 03:24:33 am »
So I learned last night that chat from IRC still comes thru to ingame guild chat, but ingame guild chat back to IRC just dies after a while.

Anyone got any ideas yet?  Or know when the next version of bebot is coming out?

Thanks.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #6 on: July 25, 2009, 10:01:53 am »
In your Relay.php module, find the relay_to_irc function and replace it with this one:
Code: [Select]
function relay_to_irc($msg)
{
$msg = preg_replace("/##end##/U", "", $msg);
$msg = preg_replace("/##(.+)##/U", "", $msg);

echo "Debug IRC sending: $msg\n";
$this -> bot -> send_irc("", "", $msg);
}

This will tell you if the bot actually sends the message to IRC.

Have you tried a different IRC server? Try setting one up on the same machine as the bot if you can to test.
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #7 on: July 25, 2009, 08:09:51 pm »
In your Relay.php module, find the relay_to_irc function and replace it with this one:
Code: [Select]
function relay_to_irc($msg)
{
$msg = preg_replace("/##end##/U", "", $msg);
$msg = preg_replace("/##(.+)##/U", "", $msg);

echo "Debug IRC sending: $msg\n";
$this -> bot -> send_irc("", "", $msg);
}

This will tell you if the bot actually sends the message to IRC.

Have you tried a different IRC server? Try setting one up on the same machine as the bot if you can to test.

If you mean by try setting one up that I should setup a different IRC client on that machine to see if I have any problems staying connected to that IRC server and channel, then yes, I have done that, and experienced no problems outside what you normally see with IRC servers.

I will give this debug code a shot and let you know what else I come up with, and thanks for the help.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #8 on: July 25, 2009, 09:55:25 pm »
I am not referring to the IRC client, but rather IRC server.

Make the bot use a different one, ie try irc.funcom.com if thats not what you are using now, or irc.shadow-realm.org

In any case, the debug code will tell you if the bot is even trying to send to the IRC channel when you notice it occuring and will tell us a little bit more. Then we can work from there to track it down if it is indeed an issue with the bot code.
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #9 on: July 25, 2009, 11:04:35 pm »
Thanks Khalem.  Where will I find this extra information when then problem does happen?

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #10 on: July 25, 2009, 11:12:08 pm »
The information will output directly to the console window.
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #11 on: July 26, 2009, 05:16:05 am »
Quote
Lawndart [BUDDY]        [LOG]   Coldsoul changed status [6] (MEMBER)
Total Count: 146716
Count: 1
Lawndart [BUDDY]        [LOG]   Subata changed status [6] (MEMBER)
Lawndart [GROUP]        [MSG]   [Dead Kow Kult] Lawndart: [IRC] Pockles: nice poon, bot broken again
Total Count: 146717
Count: 1
Lawndart [BUDDY]        [LOG]   Coolio changed status
  • (MEMBER)

Lawndart [GROUP]        [MSG]   [Dead Kow Kult] Lawndart: Coolio logged off
Lawndart [GROUP]        [MSG]   [Dead Kow Kult] Ayandi: we wiped

That's a quick example of traffic passing from IRC to guild but not from guild to IRC.  I don't see any debug info though.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #12 on: July 26, 2009, 12:12:23 pm »
My bad. It's been a while since i looked at the IRC relaying code. We need the actual IRC.php module, not Relay.php.

First, find the function send_irc around line 195 and change it to the following
Code: [Select]
function send_irc($prefix, $name, $msg)
{
if (!$this -> bot -> core("settings") -> get("irc", "connected"))
{
echo "Debug IRC: Not connected!!!!\n";
return false;
}

$msg = $this -> strip_formatting($msg);

// If msg is too long to be relayed drop it:
if (strlen($msg) > $this -> bot -> core("settings") -> get("Irc", "Maxrelaysize"))
{
echo "Debug IRC: Message too long to be relayed!!!!\n";
return false;
}

$ircmsg = "";
if ($prefix != "")
{
$ircmsg = chr(2) . chr(2) . chr(2) . $prefix . chr(2) . ' ';
}
if ($name != "")
{
$ircmsg .= $name . ': ';
}
$ircmsg .= $msg;
$ircmsg = htmlspecialchars_decode($ircmsg);
$this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> bot -> core("settings") -> get("Irc", "Channel"), $ircmsg);
return true;
}


Find the function gmsg around line 228 and change it to the following
Code: [Select]
/*
This gets called on a msg in the group
*/
function gmsg($name, $group, $msg)
{
$msg = str_replace(">", ">", $msg);
$msg = str_replace("&lt;", "<", $msg);
echo "Debug IRC i am here!! \n";
if (($this -> irc != null) && ((strtolower($this -> bot -> core("settings") -> get("Irc", "Chat")) == "gc")
|| (strtolower($this -> bot -> core("settings") -> get("Irc", "Chat")) == "both")))
{
echo "Debug IRC i am here 2!! \n";
if (!$this -> send_irc($this -> bot -> core("settings") -> get("Irc", "Ircguildprefix"), $name, $msg))
{
echo "Debug IRC i am here 3!! \n";
if ($this -> bot -> core("settings") -> get("Irc", "Notifyondrop"))
{
echo "Debug IRC i am here 4!! \n";
$msg2 = "##error##Last line not relayed to IRC as it's containing too many characters!##end##";
$this -> spam[2][$this -> spam[0][2] + 1] = time();
if($this -> spam[0][2] == 5)
{
echo "Debug IRC i am here 5!! \n";
if($this -> spam[2][1] > time() - 30)
{
    echo "Debug IRC i am here 6!! \n";
$this -> irc_disconnect();
$msg2 = "IRC Spam Detected, Disconnecting IRC";
}
$this -> spam[0][2] = 0;
}
else
$this -> spam[0][2]++;
echo "Debug IRC i am here 6!! \n";
$this -> bot -> send_gc($msg2);
}
}
}
}


This will allow me to see why your bot stops sending to IRC despite still being connected.
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #13 on: July 26, 2009, 07:39:20 pm »
OK, got the new debug code in, on irc.funcom.com this is the debug message:

Lawndart [GROUP]        [MSG]   [Dead Kow Kult] Shartgasm: test
Debug IRC i am here!!
Debug IRC i am here 2!!
Debug IRC: Not connected!!!!
Debug IRC i am here 3!!

I'm now going to try irc.shadow-realm.org and see how that goes.  Will let you know.

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #14 on: July 26, 2009, 08:26:44 pm »
And the same result on irc.shadow-realm.org

Lawndart [GROUP]        [MSG]   [Dead Kow Kult] Shartgasm: test
Debug IRC i am here!!
Debug IRC i am here 2!!
Debug IRC: Not connected!!!!
Debug IRC i am here 3!!

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 298
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal