BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.4 support => Topic started by: exxie on November 14, 2008, 07:08:00 pm

Title: Call to a member function connect() on a non-object
Post by: exxie on November 14, 2008, 07:08:00 pm
hey guys!

i just rebooted my rootserver and right after that I restarted my bebot but it crashloops with this error message:

Fatal error: Call to a member function connect() on a non-object in /home/aobot/cratcom_bebot/Sources/Bot.php on line 237

it worked just fine a few minutes ago!
I did not add any modules, modified anything or changed anything else! i just rebooted the server!

why do i get this error message now? :-/

any help would be greatly appreciated!
Title: Re: Call to a member function connect() on a non-object
Post by: Alreadythere on November 14, 2008, 07:43:47 pm
Some module you are using is registering for connect, but doesn't offer a connect() function.

Search for $commands["connect"][] at the top of your modules, if it's there make sure there is a function connect defined.
Title: Re: Call to a member function connect() on a non-object
Post by: exxie on November 14, 2008, 10:48:39 pm
yeah, I read about that hint in another thread.

I searched every file for $commands["connect"] and every single one has a function connect() in it :-(

every module is loading properly, the error message pops up when the bot is authenticating:

Code: [Select]
Cratcom [2008-11-14 21:50:27]   [LOGIN] [STATUS]        Connecting
Cratcom [2008-11-14 21:50:27]   [LOGIN] [STATUS]        Authenticating
Cratcom [2008-11-14 21:50:30]   [LOGIN] [STATUS]        Logging in
Cratcom [2008-11-14 21:50:30]   [LOGIN] [RESULT]        OK

Fatal error: Call to a member function connect() on a non-object in /home/aobot/cratcom_bebot/Sources/Bot.php on line 237
Title: Re: Call to a member function connect() on a non-object
Post by: Temar on November 14, 2008, 11:09:31 pm
ok in Sources/Bot.php
in function connect() near botton of the function you will see
Code: (php) [Select]
// Tell modules that the bot is connected
if (!empty($this -> commands["connect"]))
{
$keys = array_keys($this -> commands["connect"]);
foreach ($keys as $key)
$this -> commands["connect"][$key] -> connect();
}
replace it with
Code: (php) [Select]
// Tell modules that the bot is connected
if (!empty($this -> commands["connect"]))
{
$keys = array_keys($this -> commands["connect"]);
foreach ($keys as $key)
{
echo "running Connect function in Class: ".$key."\n";
$this -> commands["connect"][$key] -> connect();
}
}
the last 1 it list is the Class that is causeing the problem
Title: Re: Call to a member function connect() on a non-object
Post by: exxie on November 15, 2008, 12:53:56 am
edited the code and got this message:

Code: [Select]
running Connect function in Class: 0

Fatal error: Call to a member function connect() on a non-object in /home/aobot/cratcom_bebot/Sources/Bot.php on line 249

which class is class 0??  ???
Title: Re: Call to a member function connect() on a non-object
Post by: Temar on November 15, 2008, 02:27:11 am
got any custom modules ? old 1's could cause problems
Title: Re: Call to a member function connect() on a non-object
Post by: exxie on November 15, 2008, 11:56:34 am
I disabled the modules one by one and it turns out, that it was the 0.5.0_Support.php-module ...
Title: Re: Call to a member function connect() on a non-object
Post by: Temar on November 15, 2008, 02:13:02 pm
with that module it is also a possibility that its a module that it loads thats causing the problem not the module it self
Title: Re: Call to a member function connect() on a non-object
Post by: exxie on November 15, 2008, 03:29:31 pm
ah okay. I'll try disabling the 0.5.0-modules one by one.
SimplePortal 2.3.7 © 2008-2024, SimplePortal