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: Call to a member function connect() on a non-object  (Read 17745 times)

0 Members and 1 Guest are viewing this topic.

Offline exxie

  • BeBot User
  • **
  • Posts: 25
  • Karma: +0/-0
Call to a member function connect() on a non-object
« 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!

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Call to a member function connect() on a non-object
« Reply #1 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.

Offline exxie

  • BeBot User
  • **
  • Posts: 25
  • Karma: +0/-0
Re: Call to a member function connect() on a non-object
« Reply #2 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
« Last Edit: November 14, 2008, 10:52:15 pm by exxie »

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Call to a member function connect() on a non-object
« Reply #3 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

Offline exxie

  • BeBot User
  • **
  • Posts: 25
  • Karma: +0/-0
Re: Call to a member function connect() on a non-object
« Reply #4 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??  ???

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Call to a member function connect() on a non-object
« Reply #5 on: November 15, 2008, 02:27:11 am »
got any custom modules ? old 1's could cause problems

Offline exxie

  • BeBot User
  • **
  • Posts: 25
  • Karma: +0/-0
Re: Call to a member function connect() on a non-object
« Reply #6 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 ...

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Call to a member function connect() on a non-object
« Reply #7 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

Offline exxie

  • BeBot User
  • **
  • Posts: 25
  • Karma: +0/-0
Re: Call to a member function connect() on a non-object
« Reply #8 on: November 15, 2008, 03:29:31 pm »
ah okay. I'll try disabling the 0.5.0-modules one by one.

 

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