예제 #1
0
 public function LoadModule($Key, $Name, $AliasOf)
 {
     if ($this->KeyExists($Key)) {
         $Name = strtolower($Name);
         $AliasOf = strtolower($AliasOf);
         $Lua = false;
         if (IsLuaFilename($Name)) {
             $Lua = true;
         }
         if (IsLuaFilename($AliasOf)) {
             $Lua = true;
         }
         if ($Lua) {
             $this->Modules[$Key][$Name] = new LuaModule($this, $this->WhatsBot, $this->WhatsApp, $Key, $Name, $AliasOf);
         } else {
             $this->Modules[$Key][$Name] = new PHPModule($this, $this->WhatsBot, $this->WhatsApp, $Key, $Name, $AliasOf);
         }
         $Loaded = $this->Modules[$Key][$Name]->IsLoaded();
         if (!$Loaded) {
             $this->UnloadModule($Key, $Name);
         }
         return $Loaded;
     }
     return false;
 }
예제 #2
0
 private function LoadThread($Name)
 {
     if (IsLuaFilename($Name)) {
         $this->Threads[$Name] = new LuaThread($Name);
     } else {
         $this->Threads[$Name] = new PHPThread($Name);
     }
     $Loaded = $this->Threads[$Name]->IsLoaded();
     if (!$Loaded) {
         $this->UnloadThread($Name);
     }
     return $Loaded;
 }