declare(strict_types=0x1);namespace
pocketmine{use
pocketmine\thread\ThreadManager as €;use
pocketmine\utils\Filesystem as �;use
pocketmine\utils\Git as �;use
pocketmine\utils\MainLogger as �;use
pocketmine\utils\Process as �;use
pocketmine\utils\ServerKiller as �;use
pocketmine\utils\Terminal as �;use
pocketmine\utils\Timezone as �;use
pocketmine\utils\VersionString as �;use
pocketmine\wizard\SetupWizard as �;require_once
__DIR__."/VersionInfo.php";const
MIN_PHP_VERSION="7.2.0";function
critical_error($€){echo"[ERROR] $€".\PHP_EOL;}function
check_platform_dependencies(){if(\version_compare(MIN_PHP_VERSION,\PHP_VERSION)>0x0){return["PHP >= ".MIN_PHP_VERSION." is required, but you have PHP ".\PHP_VERSION.];}$�=[];if(\PHP_INT_SIZE<0x8){$乕]="-bit systems/PHP are no longer supported. Please upgrade to a4-bit system, or use a -bit PHP binary if this is a 64-bit system.";}if(\php_sapi_name()!=="cli"){$乕]="Only PHP CLI is supported.";}$�=["bcmath"=>"BC Math","chunkutils2"=>"PocketMine ChunkUtils v2","curl"=>"cURL","crypto"=>"php-crypto","ctype"=>"ctype","date"=>"Date","ds"=>"Data Structures","gmp"=>"GMP","hash"=>"Hash","igbinary"=>"igbinary","json"=>"JSON","leveldb"=>"LevelDB","mbstring"=>"Multibyte String","openssl"=>"OpenSSL","pcre"=>"PCRE","phar"=>"Phar","pthreads"=>"pthreads","reflection"=>"Reflection","sockets"=>"Sockets","spl"=>"SPL","yaml"=>"YAML","zip"=>"Zip","zlib"=>"Zlib"];foreach($�
as$�=>$�){if(!\extension_loaded($�)){$乕]="Unable to find the $刓x20($僜x29 extension.";}}if(\extension_loaded("pthreads")){$�=\phpversion("pthreads");if(\substr_count($�,)<0x2){$�="0.$�";}if(\version_compare($�,"3.2.0")<0x0){$乕]="pthreads >= 3.2.0 is required, while you have $匼56";}}if(\extension_loaded("leveldb")){$�=\phpversion("leveldb");if(\version_compare($�,"0r.1")<0x0){$乕]="php-leveldb >= 0.2.1 is required, while you have $哱56";}}if(\extension_loaded("pocketmine")){$乕]="The native PocketMine extension is no longer supported.";}return$�;}function
emit_performance_warnings(\Logger$�){if(\extension_loaded("xdebug")){$�->warning("Xdebug extension is enabled. This has a major impact on performance.");}if(((int)\ini_get("zend.assertions"))!==-0x1){$�->warning("Debugging assertions are enabled. This may degrade performance. To disable them, set `zend.assertions = i` in php.ini.");}if(\Phar::running(\true)===""){$�->warning("Non-packaged installation detected. This will degrade autoloading speed and make startup times longer.");}}function
set_ini_entries(){\ini_set("allow_url_fopen","1");\ini_set("display_errors","1");\ini_set("display_startup_errors","1");\ini_set("default_charset","utf-8");\ini_set("assert.exception","1");}function
server(){if(\count($�=check_platform_dependencies())>0x0){echo\PHP_EOL;$�=\version_compare(\PHP_VERSION,"5.4")>=
0x0?PHP_BINARY:"unknown";critical_error("Selected PHP binary ($圽x29 does not satisfy some requirements.");foreach($�
as$�){echo" - $�".\PHP_EOL;}critical_error("Please recompile PHP with the needed configuration, or refer to the installation instructions at http://pmmp.rtfd.io/en/rtfd/installation.html.");echo\PHP_EOL;exit(0x1);}unset($�);\error_reporting(-0x1);set_ini_entries();$�=\getopt("",["bootstrap:"]);if(isset($奫"bootstrap"])){$�=($�=\realpath($奫"bootstrap"]))!==\false?$�:$奫"bootstrap"];}else{$�=\dirname(__FILE__,0x2)."/vendor/autoload.php";}\define("pocketmine\COMPOSER_AUTOLOADER_PATH",$�);if(\pocketmine\COMPOSER_AUTOLOADER_PATH
!==
false&&\is_file(\pocketmine\COMPOSER_AUTOLOADER_PATH)){require_once(\pocketmine\COMPOSER_AUTOLOADER_PATH);if(\extension_loaded("parallel")){\parallel\bootstrap(\pocketmine\COMPOSER_AUTOLOADER_PATH);}}else{critical_error("Composer autoloader not found at ".$�);critical_error("Please install/update Composer dependencies or use provided builds.");exit(0x1);}\ErrorUtils::setErrorExceptionHandler();$�=new
�(\pocketmine\BASE_VERSION,\pocketmine\IS_DEVELOPMENT_BUILD,\pocketmine\BUILD_NUMBER);\define("pocketmine\VERSION",$�->getFullVersion(\true));$�=\str_repeat("00",0x14);if(\Phar::running(\true)===""){$�=�::getRepositoryStatePretty(\pocketmine\PATH);}else{$�=new\Phar(\Phar::running(\false));$�=$�->getMetadata();if(isset($怺"git"])){$�=$怺"git"];}}\define("pocketmine\GIT_COMMIT",$�);$�=\getopt("",["data:","plugins:","no-wizard","enable-ansi","disable-ansi"]);$�=isset($奫"data"])?$奫"data"].DIRECTORY_SEPARATOR:\realpath(\getcwd()).\DIRECTORY_SEPARATOR;\define("pocketmine\PLUGIN_PATH",isset($奫"plugins"])?$奫"plugins"].DIRECTORY_SEPARATOR:\realpath(\getcwd()).\DIRECTORY_SEPARATOR."plugins".\DIRECTORY_SEPARATOR);if(!\file_exists($�)){\mkdir($�,0x309,\true);}$�=$�."/server.lock";if(($�=�::createLockFile($�))!==\null){critical_error("Another ".\pocketmine\NAME." instance (PID $揬x29 is already using this folder (".\realpath($�).").");critical_error("Please stop the other server first before running a new one.");exit(0x1);}�::init();if(isset($奫"enable-ansi"])){�::init(\true);}elseif(isset($奫"disable-ansi"])){�::init(\false);}else{�::init();}$�=new
�($�."server.log");\GlobalLogger::set($�);emit_performance_warnings($�);$�=0x0;do{if(!\file_exists($�."server.properties")&&!isset($奫"no-wizard"])){$�=new
�($�);if(!$�->run()){$�=-0x1;break;}}$�=new\BaseClassLoader();$�->register(\false);new
Server($�,$�,$�,\pocketmine\PLUGIN_PATH);$�->info("Stopping other threads");$�=new
�(0x8);$�->start(\PTHREADS_INHERIT_NONE);\usleep(0x2710);if(€::getInstance()->stopAll()>0x0){$�->debug("Some threads could not be stopped, performing a force-kill");�::kill(\getmypid());}}while(\false);$�->shutdown();$�->join();echo
�::$FORMAT_RESET.\PHP_EOL;exit($�);}if(!\defined("pocketmine\_PHPSTAN_ANALYSIS")){\pocketmine\server();}}
© 2023 Quttera Ltd. All rights reserved.