Fixed plugins not getting loaded

This commit is contained in:
Shoghi Cervantes Pueyo 2012-12-26 14:02:50 +01:00
parent 196b0a4263
commit 4e9df899c2

View File

@ -154,8 +154,9 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
}
}
foreach($this->apiList as $a){
if(method_exists($this->$a, "init")){
$this->$a->init();
if(method_exists($a[1], "init")){
$a[1]->init();
usleep(1);
}
}
@ -354,7 +355,7 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
}
require_once($file);
$this->$name = new $class($this->server);
$this->apiList[] = $name;
$this->apiList[] = array($name, $this->$name);
console("[INFO] API ".$name." [".$class."] loaded");
}