Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Could not execute task Skywars\Update

Comments in 'Plugin Development' started by Praxthisnovcht, Nov 1, 2015.

  1. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    hello the guy I have a problem with this means of a reset world

    ERROR :

    Code:
    [10:52:08] [Server thread/CRITICAL]: Could not execute task Skywars\Update: opendir(../DEV1/copys/SW-1,../DEV1/copys/SW-1): Le chemin d▒acc▒s sp▒cifi▒ est introuvable. (code: 3)
    [10:52:08] [Server thread/WARNING]: RuntimeException: "opendir(../DEV1/copys/SW-1,../DEV1/copys/SW-1): Le chemin d▒acc▒s sp▒cifi▒ est introuvable. (code: 3)" (E_WARNING) in "/Skywars/src/Skywars/Main" at line 1176
    

    PHP:
        public function recurse_copy($src,$dst) {
        
    $dir opendir($src); # LINES 1176
        
    @mkdir($dst);
        while(
    false !== ( $file readdir($dir)) ) {
            if (( 
    $file != '.' ) && ( $file != '..' )) {
                if ( 
    is_dir($src '/' $file) ) {
                    
    recurse_copy($src '/' $file,$dst '/' $file);
                }
                else {
                    
    copy($src '/' $file,$dst '/' $file);
                }
            }
        }
        
    closedir($dir);
        }
        public function 
    unload(Level $w$name) {
            
    $path $this->getConfig()->get("WorldsFilePath");
            
    $this->getServer()->unloadLevel($w);
            
    $files glob("../$path/worlds/$name/region"); // get all file names
            
    foreach($files as $file){ // iterate files
              
    if(is_file($file))
                
    unlink($file); // delete file
            
    }
            
    $path $this->getConfig()->get("WorldsFilePath");
            
    $this->recurse_copy("../$path/copys/$name""../$path/worlds/$name/region");
            
    $this->getServer()->getScheduler()->scheduleDelayedTask(new Update($this4false$namefalse), 20);
            echo 
    "TEST2";
            return 
    true;
        }
     
        public function 
    load($w) {
            
    $this->getServer()->loadLevel($w);
            return 
    true;
        }
    }

    PHP:
    WorldsFilePathDEV1
    Code:
    C:\Users\Alex\Desktop\DEV1\worlds
    Last edited: Nov 1, 2015
  2. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    resolved

Share This Page

Advertisement