You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console("[ERROR] Failed to start server once :(");
continue;
}
console("[*] The server has been started. Type '-die' to stop the server and prevent this script from restarting. Type '-kill' to terminate the server and stop this script.");
$reader = newStreamReader($pipes[1]);
while(proc_get_status($server)["running"]){
while($line = $reader->getLine()){
echo$line . PHP_EOL;
}
while(($line = nonBlockReadLine()) !== null){
if(strtolower($line) === "-mypid"){
console("Wrapper PID: " . getmypid());
continue;
}elseif(strtolower($line) === "-pmpid"){
console("PocketMine server PID: " . proc_get_status($server)["pid"]);
}elseif(strtolower($line) === "-die"){
$restarts = 0;
$line = "stop";
}elseif(strtolower($line) === "-kill"){
fclose($pipes[0]);
fclose($pipes[1]);
if(isset($pipes[2])){
fclose($pipes[2]);
}
$pid = proc_get_status($server)["pid"];
kill($pid);
console("Server killed");
proc_terminate($server);
console("Process terminated.");
// switch(CommandReader::getOS()){
// case "win":
// $tasks = `umic process where (ParentProcessId=$pid) get ProcessId`;