mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Installer: No need for force-kills
This commit is contained in:
parent
eb1ec2df05
commit
82cf38d46c
@ -479,10 +479,17 @@ namespace pocketmine {
|
||||
@define("INT32_MASK", is_int(0xffffffff) ? 0xffffffff : -1);
|
||||
@ini_set("opcache.mmap_base", bin2hex(random_bytes(8))); //Fix OPCache address errors
|
||||
|
||||
|
||||
if(!file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])){
|
||||
new Installer();
|
||||
$installer = new Installer();
|
||||
if(!$installer->run()){
|
||||
$logger->shutdown();
|
||||
$logger->join();
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(\Phar::running(true) === ""){
|
||||
$logger->warning("Non-packaged PocketMine-MP installation detected, do not use on production.");
|
||||
}
|
||||
@ -496,7 +503,6 @@ namespace pocketmine {
|
||||
$killer->start();
|
||||
|
||||
$erroredThreads = 0;
|
||||
|
||||
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
||||
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
|
||||
try{
|
||||
|
@ -38,6 +38,10 @@ class Installer{
|
||||
private $lang;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
}
|
||||
|
||||
public function run(){
|
||||
echo "[*] PocketMine-MP set-up wizard\n";
|
||||
echo "[*] Please select a language:\n";
|
||||
foreach(InstallerLang::$languages as $short => $native){
|
||||
@ -57,13 +61,12 @@ class Installer{
|
||||
echo "[*] " . $this->lang->language_has_been_selected . "\n";
|
||||
|
||||
if(!$this->showLicense()){
|
||||
\pocketmine\kill(getmypid());
|
||||
exit(-1);
|
||||
return false;
|
||||
}
|
||||
|
||||
echo "[?] " . $this->lang->skip_installer . " (y/N): ";
|
||||
if(strtolower($this->getInput()) === "y"){
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
echo "\n";
|
||||
$this->welcome();
|
||||
@ -73,6 +76,7 @@ class Installer{
|
||||
$this->networkFunctions();
|
||||
|
||||
$this->endWizard();
|
||||
return true;
|
||||
}
|
||||
|
||||
private function showLicense(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user