BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => AoC 0.6 support => Topic started by: Capo on August 05, 2009, 04:10:19 am

Title: Small error
Post by: Capo on August 05, 2009, 04:10:19 am
Can anyone explain this one to me?   :)
Im pretty sure I installed everything correctly!

Curl extension loaded

Fatal error: Call to a member function log() on a non-object in C:\BeBot\Sources\MySQL.php on line 164


thx



Title: Re: Small error
Post by: Khalem on August 05, 2009, 09:43:25 am
This is an indication of a database error.

However the logging of such errors is currently not handled correctly at all and will itself cause crashes like you are experiencing.

As a temporary workaround open your Sources/MySQL.php file and find the function error on line 160
change it to the following
Code: [Select]
function error($text, $fatal = false)
{
$msg = mysql_error();
$this -> error_count++;
//$this -> bot -> log("MySQL", "ERROR", "(# " . $this -> error_count . ") on query: $text\n$msg", TRUE);

echo "MYSQL ERROR ""(# " . $this -> error_count . ") on query: $text\n$msg";

// If this error is occuring while we are trying to first connect to the database when starting
// rthe bot its a fatal error.
if ($fatal)
{
DIE("Fatal MySQL error");
}
}

This should allow you to see the actual MySQL error.

I'll look into it when i get home later today or tomorrow.
Title: Re: Small error
Post by: Joe on August 14, 2009, 11:53:40 pm
I had the same problem.

I added this line because yours was all messed up lol

Code: [Select]
echo "MYSQL ERROR (" . $this -> error_count . ") on query: $text\n$msg";

In my case, i accidently put the wrong database name in the config, but yeah error checking can be better.

but now the bot crashes php and it seg faults.

MySQL database connection test successfull
Segmentation fault (core dumped)

It doesnt work with php latest version 5.3. I compiled 5.2.10 and it works. Im not sure what the problem is or if its just my OS (freebsd) but it seems the sockets are crashing php and the bot doesnt run.

Also have a problem with the bot flooding mysql after about 60 seconds of running it, and crashing. Havent figured taht one out yet
SimplePortal 2.3.7 © 2008-2025, SimplePortal