finished first "alpha" version of PHP-P10 v2
[PHP-P10.git] / BotLoader / BotLoader.class.php
index b5dc87b252cd482c934e5cf7581a0f91dc1d8e66..0201e4c7f006199488b621ffc3b1b9b6278aae40 100644 (file)
@@ -64,6 +64,7 @@ class BotLoader {
        }
        
        public function save() {
+               $this->saxdb->setSection("BotLoader", $this->botdb);
                $this->saxdb->writeDB("php_p10.db");
        }
        
@@ -115,6 +116,14 @@ class BotLoader {
        
        private function rehashBot($name) {
                if(!(array_key_exists(strtolower($name), $this->loadedBots))) return false;
+               $botfile = null;
+               foreach($this->botdb["bots"] as $botname => $file) {
+                       if(strtolower($botname) == strtolower($name)) {
+                               $botfile = $file;
+                               break;
+                       }
+               }
+               if(!$botfile) break;
                //rehash bot
                $bot = $this->loadedBots[strtolower($name)];
                if(array_key_exists(strtolower($name), $this->botDatabases)) {