本文整理汇总了PHP中pocketmine\utils\Utils::javaStringHash方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils::javaStringHash方法的具体用法?PHP Utils::javaStringHash怎么用?PHP Utils::javaStringHash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\utils\Utils
的用法示例。
在下文中一共展示了Utils::javaStringHash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
//.........这里部分代码省略.........
ini_set('assert.exception', 1);
if ($this->logger instanceof MainLogger) {
$this->logger->setLogDebug(\pocketmine\DEBUG > 1);
}
if (\pocketmine\DEBUG >= 0) {
@cli_set_process_title($this->getName() . " " . $this->getPocketMineVersion());
}
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.networkStart", [$this->getIp() === "" ? "*" : $this->getIp(), $this->getPort()]));
define("BOOTUP_RANDOM", random_bytes(16));
$this->serverID = Utils::getMachineUniqueId($this->getIp() . $this->getPort());
$this->getLogger()->debug("Server unique id: " . $this->getServerUniqueId());
$this->getLogger()->debug("Machine unique id: " . Utils::getMachineUniqueId());
$this->network = new Network($this);
$this->network->setName($this->getMotd());
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.info", [$this->getName(), $this->getPocketMineVersion(), $this->getCodename(), $this->getApiVersion(), $this->getPocketMineBuild()]));
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.license", [$this->getName()]));
Timings::init();
$this->consoleSender = new ConsoleCommandSender();
$this->commandMap = new SimpleCommandMap($this);
$this->registerEntities();
$this->registerTiles();
InventoryType::init();
Block::init();
Item::init();
Biome::init();
Effect::init();
Enchantment::init();
Attribute::init();
EnchantmentLevelTable::init();
Color::init();
$this->craftingManager = new CraftingManager();
$this->pluginManager = new PluginManager($this, $this->commandMap);
$this->pluginManager->subscribeToPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this->consoleSender);
$this->pluginManager->setUseTimings($this->getProperty("settings.enable-profiling", false));
$this->profilingTickRate = (double) $this->getProperty("settings.profile-report-trigger", 20);
$this->pluginManager->registerInterface(PharPluginLoader::class);
$this->pluginManager->registerInterface(ScriptPluginLoader::class);
register_shutdown_function([$this, "crashDump"]);
$this->queryRegenerateTask = new QueryRegenerateEvent($this, 5);
$this->network->registerInterface(new RakLibInterface($this));
$this->pluginManager->loadPlugins($this->pluginPath);
$this->updater = new AutoUpdater($this, $this->getProperty("auto-updater.host", "jenkins.clearskyteam.org"));
$this->enablePlugins(PluginLoadOrder::STARTUP);
LevelProviderManager::addProvider($this, Anvil::class);
LevelProviderManager::addProvider($this, McRegion::class);
if (extension_loaded("leveldb")) {
$this->logger->debug($this->getLanguage()->translateString("pocketmine.debug.enable"));
LevelProviderManager::addProvider($this, LevelDB::class);
}
Generator::addGenerator(Flat::class, "flat");
Generator::addGenerator(Normal::class, "normal");
Generator::addGenerator(Normal::class, "default");
Generator::addGenerator(Nether::class, "hell");
Generator::addGenerator(Nether::class, "nether");
foreach ((array) $this->getProperty("worlds", []) as $name => $worldSetting) {
if ($this->loadLevel($name) === false) {
$seed = $this->getProperty("worlds.{$name}.seed", time());
$options = explode(":", $this->getProperty("worlds.{$name}.generator", Generator::getGenerator("default")));
$generator = Generator::getGenerator(array_shift($options));
if (count($options) > 0) {
$options = ["preset" => implode(":", $options)];
} else {
$options = [];
}
$this->generateLevel($name, $seed, $generator, $options);
}
}
if ($this->getDefaultLevel() === null) {
$default = $this->getConfigString("level-name", "world");
if (trim($default) == "") {
$this->getLogger()->warning("level-name cannot be null, using default");
$default = "world";
$this->setConfigString("level-name", "world");
}
if ($this->loadLevel($default) === false) {
$seed = getopt("", ["level-seed::"])["level-seed"] ?? $this->properties->get("level-seed", time());
if (!is_numeric($seed) or bccomp($seed, "9223372036854775807") > 0) {
$seed = Utils::javaStringHash($seed);
} elseif (PHP_INT_SIZE === 8) {
$seed = (int) $seed;
}
$this->generateLevel($default, $seed === 0 ? time() : $seed);
}
$this->setDefaultLevel($this->getLevelByName($default));
}
$this->properties->save(true);
if (!$this->getDefaultLevel() instanceof Level) {
$this->getLogger()->emergency($this->getLanguage()->translateString("pocketmine.level.defaultError"));
$this->forceShutdown();
return;
}
if ($this->getProperty("ticks-per.autosave", 6000) > 0) {
$this->autoSaveTicks = (int) $this->getProperty("ticks-per.autosave", 6000);
}
$this->enablePlugins(PluginLoadOrder::POSTWORLD);
$this->start();
} catch (\Throwable $e) {
$this->exceptionHandler($e);
}
}