コード例 #1
0
ファイル: GameLevelManager.php プロジェクト: robozeri/SG
 public function addWorld(Level $level, $base, $competition)
 {
     $fileutil = new FileUtil();
     $source = $level->getServer()->getDataPath() . "worlds/" . $base . "/";
     $dest = $level->getServer()->getDataPath() . "worlds/" . $competition . "/";
     $this->deleteWorld($level, $competition);
     if ($fileutil->xcopy($source, $dest)) {
         $this->plugin->log("New Hunger Game Competition World [" . $competition . "] created!");
         try {
             $level->getServer()->loadLevel($competition);
         } catch (\Exception $e) {
             $this->plugin->printError($e);
         }
         $this->plugin->log("loaded world: " . $competition);
     } else {
         $this->plugin->log("problem creating new map. please contact administrator.");
     }
 }