/** * @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; }
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(); }
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(); }
public function reloadMessages() { $this->messages->reload(); }
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)); }
public function reload() { $this->config->reload(); }
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(); }