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);
|
@define("INT32_MASK", is_int(0xffffffff) ? 0xffffffff : -1);
|
||||||
@ini_set("opcache.mmap_base", bin2hex(random_bytes(8))); //Fix OPCache address errors
|
@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"])){
|
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) === ""){
|
if(\Phar::running(true) === ""){
|
||||||
$logger->warning("Non-packaged PocketMine-MP installation detected, do not use on production.");
|
$logger->warning("Non-packaged PocketMine-MP installation detected, do not use on production.");
|
||||||
}
|
}
|
||||||
@ -496,7 +503,6 @@ namespace pocketmine {
|
|||||||
$killer->start();
|
$killer->start();
|
||||||
|
|
||||||
$erroredThreads = 0;
|
$erroredThreads = 0;
|
||||||
|
|
||||||
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
||||||
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
|
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
|
||||||
try{
|
try{
|
||||||
|
@ -38,6 +38,10 @@ class Installer{
|
|||||||
private $lang;
|
private $lang;
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function run(){
|
||||||
echo "[*] PocketMine-MP set-up wizard\n";
|
echo "[*] PocketMine-MP set-up wizard\n";
|
||||||
echo "[*] Please select a language:\n";
|
echo "[*] Please select a language:\n";
|
||||||
foreach(InstallerLang::$languages as $short => $native){
|
foreach(InstallerLang::$languages as $short => $native){
|
||||||
@ -57,13 +61,12 @@ class Installer{
|
|||||||
echo "[*] " . $this->lang->language_has_been_selected . "\n";
|
echo "[*] " . $this->lang->language_has_been_selected . "\n";
|
||||||
|
|
||||||
if(!$this->showLicense()){
|
if(!$this->showLicense()){
|
||||||
\pocketmine\kill(getmypid());
|
return false;
|
||||||
exit(-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "[?] " . $this->lang->skip_installer . " (y/N): ";
|
echo "[?] " . $this->lang->skip_installer . " (y/N): ";
|
||||||
if(strtolower($this->getInput()) === "y"){
|
if(strtolower($this->getInput()) === "y"){
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
echo "\n";
|
echo "\n";
|
||||||
$this->welcome();
|
$this->welcome();
|
||||||
@ -73,6 +76,7 @@ class Installer{
|
|||||||
$this->networkFunctions();
|
$this->networkFunctions();
|
||||||
|
|
||||||
$this->endWizard();
|
$this->endWizard();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function showLicense(){
|
private function showLicense(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user