当前位置: 首页>>代码示例>>PHP>>正文


PHP Config::reload方法代码示例

本文整理汇总了PHP中pocketmine\utils\Config::reload方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::reload方法的具体用法?PHP Config::reload怎么用?PHP Config::reload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\utils\Config的用法示例。


在下文中一共展示了Config::reload方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setOriginalNametag

 /**
  * @param PPGroup $group
  * @param $nameTag
  * @param null $levelName
  * @return bool
  */
 public function setOriginalNametag(PPGroup $group, $nameTag, $levelName = null)
 {
     if ($levelName === null) {
         $this->config->setNested("groups." . $group->getName() . ".nametag", $nameTag);
     } else {
         $this->config->setNested("groups." . $group->getName() . "worlds.{$levelName}.nametag", $nameTag);
     }
     $this->config->save();
     $this->config->reload();
     return true;
 }
开发者ID:mad-hon,项目名称:PureChat,代码行数:17,代码来源:PureChat.php

示例2: reload

 public function reload()
 {
     $this->logger->info("Saving levels...");
     foreach ($this->levels as $level) {
         $level->save();
     }
     $this->pluginManager->disablePlugins();
     $this->pluginManager->clearPlugins();
     $this->commandMap->clearCommands();
     $this->logger->info("Reloading properties...");
     $this->properties->reload();
     $this->maxPlayers = $this->getConfigInt("max-players", 20);
     if ($this->getConfigBoolean("hardcore", false) === true and $this->getDifficulty() < 3) {
         $this->setConfigInt("difficulty", 3);
     }
     $this->banByIP->load();
     $this->banByName->load();
     $this->reloadWhitelist();
     $this->operators->reload();
     $this->memoryManager->doObjectCleanup();
     foreach ($this->getIPBans()->getEntries() as $entry) {
         $this->getNetwork()->blockAddress($entry->getName(), -1);
     }
     $this->pluginManager->registerInterface(PharPluginLoader::class);
     $this->pluginManager->registerInterface(ScriptPluginLoader::class);
     $this->pluginManager->loadPlugins($this->pluginPath);
     $this->enablePlugins(PluginLoadOrder::STARTUP);
     $this->enablePlugins(PluginLoadOrder::POSTWORLD);
     TimingsHandler::reload();
 }
开发者ID:ZenaGamingsky,项目名称:PocketBox,代码行数:30,代码来源:Server.php

示例3: reload

 public function reload()
 {
     $this->logger->info("Saving levels...");
     foreach ($this->levels as $level) {
         $level->save();
     }
     $this->pluginManager->disablePlugins();
     $this->pluginManager->clearPlugins();
     $this->commandMap->clearCommands();
     $this->logger->info("Reloading properties...");
     $this->properties->reload();
     $this->maxPlayers = $this->getConfigInt("max-players", 20);
     if (($memory = str_replace("B", "", strtoupper($this->getConfigString("memory-limit", "256M")))) !== false) {
         $value = ["M" => 1, "G" => 1024];
         $real = (int) substr($memory, 0, -1) * $value[substr($memory, -1)];
         if ($real < 256) {
             $this->logger->warning($this->getName() . " may not work right with less than 256MB of RAM", true, true, 0);
         }
         @ini_set("memory_limit", $memory);
     } else {
         $this->setConfigString("memory-limit", "256M");
     }
     if ($this->getConfigBoolean("hardcore", false) === true and $this->getDifficulty() < 3) {
         $this->setConfigInt("difficulty", 3);
     }
     $this->banByIP->load();
     $this->banByName->load();
     $this->reloadWhitelist();
     $this->operators->reload();
     foreach ($this->getIPBans()->getEntries() as $entry) {
         $this->blockAddress($entry->getName(), -1);
     }
     $this->pluginManager->registerInterface(PharPluginLoader::class);
     $this->pluginManager->loadPlugins($this->pluginPath);
     $this->enablePlugins(PluginLoadOrder::STARTUP);
     $this->enablePlugins(PluginLoadOrder::POSTWORLD);
     TimingsHandler::reload();
 }
开发者ID:ZenaGamingsky,项目名称:Steadfast2,代码行数:38,代码来源:Server.php

示例4: reloadMessages

 public function reloadMessages()
 {
     $this->messages->reload();
 }
开发者ID:blah123454321,项目名称:PurePerms,代码行数:4,代码来源:PPMessages.php

示例5: loadWarps

 private function loadWarps()
 {
     $cfg = new Config($this->getDataFolder() . "Warps.yml", Config::YAML);
     $cfg->reload();
     $children = [];
     foreach ($cfg->getAll() as $n => $v) {
         if ($this->getServer()->isLevelGenerated($v[3])) {
             if (!$this->getServer()->isLevelLoaded($v[3])) {
                 $this->getServer()->loadLevel($v[3]);
             }
             $this->warps[$n] = new BaseLocation($n, $v[0], $v[1], $v[2], $this->getServer()->getLevelByName($v[3]), $v[4], $v[5]);
             $children[] = new Permission("essentials.warps." . $n);
         }
     }
     $this->getServer()->getPluginManager()->addPermission(new Permission("essentials.warps", null, null, $children));
 }
开发者ID:mwvent,项目名称:WattzEssentialsPE,代码行数:16,代码来源:Loader.php

示例6: reload

 public function reload()
 {
     $this->config->reload();
 }
开发者ID:TBNRFrags2468,项目名称:Economy,代码行数:4,代码来源:YAMLStore.php

示例7: turnWl

 public function turnWl($on)
 {
     $cfg = new Config($this->getDataFolder() . "players.yml", Config::YAML);
     if (strtolower($on) == "on") {
         $this->getConfig()->set("enable_whitelist", "true");
     }
     if (strtolower($on) == "off") {
         $this->getConfig()->set("enable_whitelist", "false");
     }
     $cfg->reload();
 }
开发者ID:kinect3000,项目名称:ReasonWL,代码行数:11,代码来源:Main.php


注:本文中的pocketmine\utils\Config::reload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。