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

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

Author Topic: Strangest problems with bot  (Read 3939 times)

0 Members and 1 Guest are viewing this topic.

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Strangest problems with bot
« on: April 04, 2007, 05:27:32 pm »
Lately, I am getting some very strange behavior from the bot, and so far, I have been unable to pinpoint it. I posted in the !alts thread before, but that is probably the wrong place.
I am using a 2.11 bot with most of the modules that are confirmed to work from JJ's list.

The first thing is very annoying: Me (Luuv) gets my id in the members table set to 0 occasionally. This results in the bot crashing when I log on. If I delete the row and do a "!member del Luuv" and then a "!member Luuv", it works again - for a while.

The second thing is stranger, I noticed it with the new Alts-module that JJ posted, but the !is command gets confused as well. http://bebot.link/index.php/topic,204.msg5504.html#msg5504 shows some of my pain. :)

Another example: I have someone on guestlist that is not in org. Now check out the following crap and tell me why this happens:
Code: [Select]
[2007-04-04 15:15:52]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:15:52]   [BUDDY] [LOG]   Ilikethongs logged [on] (guest)
[2007-04-04 15:15:52]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
[2007-04-04 15:16:30]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:30]   [BUDDY] [ERROR] Ilikethongs logged on despite of already being marked as logged on!!
[2007-04-04 15:16:34]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:34]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
[2007-04-04 15:16:35]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:35]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
[2007-04-04 15:16:37]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:37]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
[2007-04-04 15:16:38]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:38]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
After that, the person logs off, and I get the following without stating another !is:
Code: [Select]
[2007-04-04 15:23:58]   [BUDDY] [LOG]   Ilikethongs logged [off] (guest)
[2007-04-04 15:23:58]   [TELL]  [OUT]   -> Luuv: Ilikethongs is offline
So the first time I do !is, the bot notices a logon and tells me the guy is online. The second time, the bot complains that he is already logged on, but never tells me that he is online. Each time after that, ths !is command works ok. All the time, the !alts command shows him as offline.

I can't figure out when and why this started to happen. I can install a vanilla bot and see if it happens there as well. Any other ideas what I could try, or why this might happen? Looks to me like the problems come from the buddy functions in AOChat.php, but I never touched that file -  I use the one that came with the 2.11 bot.
« Last Edit: April 04, 2007, 05:33:05 pm by pusikas »
Luuv  Bot-Keeper of Vengeance ^^*

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Strangest problems with bot
« Reply #1 on: April 07, 2007, 03:49:59 am »
The first thing is very annoying: Me (Luuv) gets my id in the members table set to 0 occasionally. This results in the bot crashing when I log on. If I delete the row and do a "!member del Luuv" and then a "!member Luuv", it works again - for a while.

Could you get me the error that gets output to console/log when this happens as i'd like to fix the crash at the very least :)

I'm not quite sure where this actually occurs. But i think the best way to track it down would be to add a debug line to all instances in the bot where the id is potentially inserted into the database and output a warning to console/log with debug info.

Quote
The second thing is stranger, I noticed it with the new Alts-module that JJ posted, but the !is command gets confused as well. http://bebot.link/index.php/topic,204.msg5504.html#msg5504 shows some of my pain. :)

Another example: I have someone on guestlist that is not in org. Now check out the following crap and tell me why this happens:
Code: [Select]
[2007-04-04 15:15:52]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:15:52]   [BUDDY] [LOG]   Ilikethongs logged [on] (guest)
[2007-04-04 15:15:52]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
[2007-04-04 15:16:30]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:30]   [BUDDY] [ERROR] Ilikethongs logged on despite of already being marked as logged on!!
[2007-04-04 15:16:34]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:34]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
[2007-04-04 15:16:35]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:35]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
[2007-04-04 15:16:37]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:37]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
[2007-04-04 15:16:38]   [TELL]  [INC]   Luuv: !is ilikethongs
[2007-04-04 15:16:38]   [TELL]  [OUT]   -> Luuv: Ilikethongs is online
After that, the person logs off, and I get the following without stating another !is:
Code: [Select]
[2007-04-04 15:23:58]   [BUDDY] [LOG]   Ilikethongs logged [off] (guest)
[2007-04-04 15:23:58]   [TELL]  [OUT]   -> Luuv: Ilikethongs is offline
So the first time I do !is, the bot notices a logon and tells me the guy is online. The second time, the bot complains that he is already logged on, but never tells me that he is online. Each time after that, ths !is command works ok. All the time, the !alts command shows him as offline.

I can't figure out when and why this started to happen. I can install a vanilla bot and see if it happens there as well. Any other ideas what I could try, or why this might happen? Looks to me like the problems come from the buddy functions in AOChat.php, but I never touched that file -  I use the one that came with the 2.11 bot.

Ohh boy. I knew this would come back to bite me in the arse somehow.
Basically this is whats happening:
- Person logs on, gets tagged as logged on by the online cache
- !is is called for this person, adds the person as a buddy to generate a logged on/off event. Cache catches said event, throws a warning to console and never passes the event on to anything in the bot.
- !is sits and waits for the event which never arrives, until the person logs off and generates an event that is different from the cached event.

Although im a bit puzzled towards why you get a response to subsequent !is commands for the same person O.o
BeBot Founder and Fixer Kingpin

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #2 on: April 07, 2007, 04:53:45 pm »
Could you get me the error that gets output to console/log when this happens as i'd like to fix the crash at the very least :)

I'm not quite sure where this actually occurs. But i think the best way to track it down would be to add a debug line to all instances in the bot where the id is potentially inserted into the database and output a warning to console/log with debug info.


The crash happens here:
Code: [Select]
[04-Apr-2007 17:00:51] PHP Fatal error:  Cannot use string offset as an array in /usr/local/vbot/modules/Logon_GUILD.php on line 108The line 108 looks like this:
Code: [Select]
$res .= " (Lvl <font color=#ffffff>" . $result[0][3] . "</font> / <font color=#00ff60>" . $result[0][6] . " (" . $result[0][7] . ")</font> <font color=#ffffff>" . $result[0][4] . "</font> " . $result[0][5] . ") logged on.";I think that line is slightly modified, not the original anymore. But if I am not mistaken, the problem is this line:
Code: [Select]
$id = $this -> bot -> aoc -> get_uid($name);That gets the "real" ID of the user logging on, not the one that is in the database (due to the default value of zero, it is 0 in the database). The following SELECT on the members table doesn't fetch any rows. But maybe I misinterpret the code here. No idea. :)

It hasn't happened to my own toons anymore. I inserted some debug messages and am hoping for the error that causes the 0 to be inserted into the ID column to come back. Well, I wouldn't mind if I never get it again, either. :)
Some sanity check on the SELECT might help, so that the logon message is surpressed if the SELECT returns no rows, and a message like "$name logged on, but his entry in the members table is faulty" as output.

Edit: I changed the Logon_GUILD.php a bit, so that it no longer crashes the bot when a toon with ID = 0 i nthe database logs on. Dunno if I am the only one with this problem, but still, here it is. :) Contains my own take on the colors for logons, so it may not be for everyone...
« Last Edit: April 07, 2007, 05:22:03 pm by pusikas »
Luuv  Bot-Keeper of Vengeance ^^*

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #3 on: April 08, 2007, 04:07:45 am »
Try inserting a line above the one that is causing the error that reads
Code: [Select]
var_dump($result);

That should print out what $result contains. The error message indicates that it does not contain an array as is expected. (ie it might be NULL, FALSE or contain a string).

Hope that helps.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #4 on: April 08, 2007, 04:50:44 am »
Reason why the bot crashes is clear - just update any character id with 0 in the database and see what happens when that person logs on. :)

What I do not understand is why the ID gets updated with zero in the first place. It has happened to my own toon twice and to one other toon in the org so far. I have added some debug code in the Roster_GUILD module where I suspect it may happen (I booby-trapped the area around the REPLACE command), but this crap hasnt occured again so far, so no news on that one. I am sitting here an HOPING for the bot messing it up again. That's new. :)
« Last Edit: April 08, 2007, 04:56:12 am by pusikas »
Luuv  Bot-Keeper of Vengeance ^^*

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Strangest problems with bot
« Reply #5 on: April 08, 2007, 03:00:18 pm »
Crash fixed in SVN.
Improper error checking.
BeBot Founder and Fixer Kingpin

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Strangest problems with bot
« Reply #6 on: April 08, 2007, 07:32:35 pm »
Small note on the !is problem.

The only real solution here is to rewrite !Is to take into account the cache as the cache is needed.
BeBot Founder and Fixer Kingpin

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #7 on: April 10, 2007, 01:40:29 am »
Sooo... nothing I can do, I guess. I do not even think I fully undersdtand what the problem is. ^^
Luuv  Bot-Keeper of Vengeance ^^*

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Strangest problems with bot
« Reply #8 on: April 10, 2007, 05:49:14 pm »
Not unless we can figure out where and why it's inserting a 0.

I'll see if i can find some time to look over this once again and maybe add some error checking to avoid null id's from being entered in the first place. But 0.2.x is a mess.
BeBot Founder and Fixer Kingpin

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #9 on: April 10, 2007, 07:48:55 pm »
Today the bot did it again, but a bit differently, which is why my booby-traps didnt fire. It did not REPLACE with zero - it just deleted me entirely.
Code: [Select]
[2007-04-10 03:08:16]   [BUDDY] [ADD]   0
[2007-04-10 03:08:16]   [BUDDY] [ADD]   Younggunz
[2007-04-10 03:08:16]   [BUDDY] [ADD]   Miiii
[2007-04-10 03:08:16]   [BUDDY] [DEL]   Luuv
[2007-04-10 03:08:16]   [ROSTER]        [UPDATE]        Luuv removed
[2007-04-10 03:08:16]   [ROSTER]        [UPDATE]        Roster update complete. Added 3 members, removed 1.

WTH? Not only did it remove me for no apparent reason, it also added a member named  "0". Way to go. I checked for PHP errors or warnings, and there were none in the logs around that time.

The whois-cache seems to work smoothly, I am currently thinking about just removing that roster update as it currently is and just copy over the relevant stuff form the whois-cache twice a day or so... is there any reason not to do it this way? Before I try that and find out the hard way, someone tell me please. :)
« Last Edit: April 10, 2007, 07:51:19 pm by pusikas »
Luuv  Bot-Keeper of Vengeance ^^*

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #10 on: April 10, 2007, 08:59:31 pm »
I use the cache 100% for our raidbot, it works fine.

-jj-

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #11 on: April 11, 2007, 09:50:54 am »
Yep, that works nicely so far, and is faster as well. :)
Luuv  Bot-Keeper of Vengeance ^^*

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #12 on: April 11, 2007, 02:27:07 pm »
In the end, you may possibly get the same error, unless you keep the whois cache up to date.  I'd not thought of doing this for the org, can you PM me with the code? :-)

-jj-

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Strangest problems with bot
« Reply #13 on: April 15, 2007, 02:38:23 am »
Curious. Could it be Funcom XML somehow screwing up? If my memory serves, nickname is taken directly from XML, which means in the XML version there should have been a member with the nickname 0. Bizarre.
BeBot Founder and Fixer Kingpin

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: Strangest problems with bot
« Reply #14 on: April 15, 2007, 04:21:48 am »
Hmmm... what might have happened (didn't check the time) is that the Roster Update and the whois-cache update ran at the same time. They won't interfere directly, but accessing those FC pages isn't exactly fast from where I live. Didn't see any timeouts in the php-errorlog, tho. Also, I am sitting behind a transparent proxy - maybe it messed those requests up. But I Dunno how I should test THAT. Good news is, that I haven't had any more problems since I am updating the members table from the whois cache. If they did interfere before, they can't do that anymore, and I have never spotted any wrong entries in the cache.

!is and JJ's !alts command still are a bit unreliable, and spam my console with strange messages, but nothing I can't bear.
Luuv  Bot-Keeper of Vengeance ^^*

 

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


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


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


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 496
  • 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