mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Fixed server not accepting commands after pressing ctrl+D (non-readline)
This commit is contained in:
parent
31f0437c96
commit
ebd3d207e4
@ -116,7 +116,9 @@ class CommandReader extends Thread{
|
||||
}
|
||||
|
||||
switch($this->type){
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
case self::TYPE_STREAM:
|
||||
//stream_select doesn't work on piped streams for some reason
|
||||
$r = [$stdin];
|
||||
if(($count = stream_select($r, $w, $e, 0, 200000)) === 0){ //nothing changed in 200000 microseconds
|
||||
return true;
|
||||
@ -124,13 +126,6 @@ class CommandReader extends Thread{
|
||||
$this->initStdin();
|
||||
}
|
||||
|
||||
if(($raw = fgets($stdin)) !== false){
|
||||
$line = trim($raw);
|
||||
}else{
|
||||
return false; //user pressed ctrl+c?
|
||||
}
|
||||
|
||||
break;
|
||||
case self::TYPE_PIPED:
|
||||
if(($raw = fgets($stdin)) === false){ //broken pipe or EOF
|
||||
$this->initStdin();
|
||||
|
Loading…
x
Reference in New Issue
Block a user