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 22608 times)

0 Members and 1 Guest are viewing this topic.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #15 on: July 26, 2009, 08:37:23 pm »
Both those indicate that the bot is not connected. Do messages go trough from irc -> gc?
Is the bot sitting in the assigned channel?
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #16 on: July 26, 2009, 10:22:53 pm »
Both those indicate that the bot is not connected. Do messages go trough from irc -> gc?
Is the bot sitting in the assigned channel?

Yes, bot remains in IRC channel the whole time, and messages from IRC go to GC, but not from GC to IRC.

Doing an !irc connect from ingame will cause the bot to reconnect to IRC and it works for a while again, but always for a limited time.
« Last Edit: July 26, 2009, 10:25:36 pm by Poonjab »

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #17 on: July 27, 2009, 07:07:37 am »
So I got to thinking (usually a bad thing right?), if the debug messages are able to indicate the connection is no longer there, despite the bot being in the IRC channel and IRC chat going to guild chat, couldn't a function just be written in to have the bot reconnect to IRC and start relaying traffic again?

I looked at the code and realized...  I have no idea how to write something like that.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #18 on: July 27, 2009, 12:55:23 pm »
Check your IRC settings. There already is a reconnect function. However there is something very odd going on somewhere since the bot is still connected and sending messages from IRC.
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #19 on: July 28, 2009, 01:56:25 am »
Here's my settings:

Quote
Settings for Irc
AnnounceTo: gc
 Description: Where should joins and leaves to the IRC channel be announced to?
 Change to: [ none | gc | pgmsg | both ]
AnnounceWhat: both
 Description: Which events should be announced to IRC? None, only buddies logging on, only joins to the chatgroup or both?
 Change to: [ none | buddies | joins | both ]
Channel: #dkk
 Description: Which IRC channel should be used?
/tell Lawndart !set Irc Channel <new value>
ChannelKey: passwordremoved
 Description: What is the IRC channel key if any?
/tell Lawndart !set Irc ChannelKey <new value>
Chat: both
 Description: Which channels should be relayed into IRC and vice versa?
 Change to: [ gc | pgroup | both ]
GuildPrefix: [IRC]
 Description: Which prefix should IRC chat relayed to ingame chat get?
/tell Lawndart !set Irc GuildPrefix <new value>
IrcGuestPrefix: [DKK Guest]
 Description: Which prefix should ingame chat in the chat groupf of the bot relayed to IRC get?
/tell Lawndart !set Irc IrcGuestPrefix <new value>
IrcGuildPrefix: [DKK]
 Description: Which prefix should ingame guild chat relayed to IRC get?
/tell Lawndart !set Irc IrcGuildPrefix <new value>
ItemRef: AOMainframe
 Description: Should AO Mainframe of AUNO be used for links in item refs?
 Change to: [ AOMainframe | AUNO ]
MaxRelaySize: 500
 Description: What's the maximum amount of characters relayed to IRC?
/tell Lawndart !set Irc MaxRelaySize <new value>
Nick: Lawndart
 Description: Which nick should the bot use in IRC?
/tell Lawndart !set Irc Nick <new value>
NotifyOnDrop: Off
 Description: Should the chat be notified if something isn't relayed because it's too large?
 Change to: [ On | Off ]
Port: 6667
 Description: Which port is used to connect to the IRC server?
/tell Lawndart !set Irc Port <new value>
Reconnect: On
 Description: Should the bot automatically reconnect to IRC?
 Change to: [ On | Off ]
RelayGuildName:
 Description: What is the name for GC guildrelay?
/tell Lawndart !set Irc RelayGuildName <new value>
Server: irc.funcom.com
 Description: Which IRC server is used?
/tell Lawndart !set Irc Server <new value>
UseGuildRelay: Off
 Description: Should chat coming from IRC also be relayed over the guild relay if it's set up?
 Change to: [ On | Off ]

I do have reconnect turned on, but I don't have anything for RelayGuildName as I'm not sure what it's for and I don't think it applies to me since I'm only running the 1 bot for the guild.

Let me know if you see any problems there.
« Last Edit: July 28, 2009, 07:58:37 pm by Poonjab »

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #20 on: July 29, 2009, 02:14:15 am »
Any thoughts on my settings?  Do I have anything wrong here?

Thanks.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #21 on: July 29, 2009, 01:24:55 pm »
Your settings look fine.

There is something very whacky going on somewhere with your bot somewhere.

Basically, somehow the hidden setting which the bot uses in various functions to check if the bot is connected is being set to FALSE... but not from within the IRC relay from what i can tell. As the only place we do that within the relay is after we have actually disconnected the bot, something would appear to alter this setting for your bot from a custom module or something else.

To put it plainly, given the code, i can see no way what you are experiencing should be possible.

Do you see the following in your logs just as the bot stops sending to IRC?
Code: [Select]
Botname [2009-07-23 11:31:08]   [SETTINGS]      [SAVED] connected for module irc set to FALSE as datatype bool

If you do, the change happens due to the setting being changed by an internal call in the bot. And the only place this happens in the unmodified version of BeBot is when the module is first loaded and when irc_disconnect is called.
The code reads
Code: [Select]
function irc_disconnect()
{
if ($this -> irc != null)
{
$this -> irc -> disconnect();
$this -> irc = null;
$this -> unregister_event("cron", "1sec");
$this -> bot -> core("settings") -> save("irc", "connected", FALSE);
$this -> bot -> db -> query("UPDATE #___online SET status_gc = 0 WHERE botname = '".$this -> bot -> botname . " - IRC'");
return "Disconnected from IRC server.";
}
else
return "IRC already disconnected.";
}
Basically it calls the SmartIRC class and tells it to disconnect the bot from IRC. It then sets the reference to the SmartIRC class to null. Then it removes the internal cronjob which fetches messages from IRC, and then sets the hidden setting to FALSE.

In your case, the hidden setting is being set to FALSE somewhere else.
Do you have multiple bots running on the same database? Do you have anything else interfacing with the bot database?

You could probably try this workaround, but it will only hide the problem by ignoring it:
Code: [Select]
function send_irc($prefix, $name, $msg)
{
if (!$this -> bot -> core("settings") -> get("irc", "connected"))
{
return false;
}
Change to
Code: [Select]
function send_irc($prefix, $name, $msg)
{
if (!$this->irc == NULL)
{
return false;
}
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #22 on: July 29, 2009, 07:01:04 pm »

Do you see the following in your logs just as the bot stops sending to IRC?
Code: [Select]
Botname [2009-07-23 11:31:08]   [SETTINGS]      [SAVED] connected for module irc set to FALSE as datatype bool


Haven't noticed anything like that yet, but I haven't been looking for it either.  I'll see if I can find that happening.

Do you have multiple bots running on the same database? Do you have anything else interfacing with the bot database?

I don't have multiple bots running, but did at one point change the toon that the bot is running from.  As a result of that I see the database now has tables for the old bot and the new bot.  I wasn't sure what to do about that so I left it there and haven't messed with it.  Would it be safe to delete those tables?

Also don't really have anything interfacing with the bot database.  It's a standard XAMPP (x86 I believe) install (quick and easy for a nub like me to setup) running on a Vista x64 box.  I occasionally use phpMyAdmin to get in the alts table of the bot and manually confirm peoples alts as they are unable to do so themselves for some reason, but I've never bothered to ask here why that might be.

You could probably try this workaround, but it will only hide the problem by ignoring it:
Code: [Select]
function send_irc($prefix, $name, $msg)
{
if (!$this -> bot -> core("settings") -> get("irc", "connected"))
{
return false;
}
Change to
Code: [Select]
function send_irc($prefix, $name, $msg)
{
if (!$this->irc == NULL)
{
return false;
}


I will probably give that a shot and see how it goes.  Would just like it to work and have people stop bothering me every time it stops working.

Thanks for the help.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #23 on: July 29, 2009, 07:45:13 pm »
You can safely remove the old tables belonging to your old bot when it was run under a different nickname yes.
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #24 on: July 30, 2009, 02:41:59 am »
OK, so after making that change, the bot doesn't send any guild chat to IRC at all, not even after first connecting.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: IRC relay goes dead
« Reply #25 on: July 30, 2009, 03:01:43 am »
Oh for crying out loud. Thats what i get for coding while still not awake.

Correct code
Code: [Select]
if ($this->irc == NULL)
{
return false;
}
BeBot Founder and Fixer Kingpin

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: IRC relay goes dead
« Reply #26 on: July 30, 2009, 07:51:17 am »
Thanks Khalem.  Working mostly well now.  Only problem left is that it stops sending messages about people joining and leaving the game after a while, but the chat part is getting thru reliably now.

 

* 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: 275
  • 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