mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Fix :D
This commit is contained in:
parent
d7a54123e2
commit
47e9a7b6a1
@ -262,24 +262,28 @@ class ConsoleLoop extends Thread{
|
||||
$line = trim(fgets($fp));
|
||||
if($line != ""){
|
||||
$this->line = $line;
|
||||
$this->wait();
|
||||
$this->line = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function run(){
|
||||
$fp = fopen("php://stdin", "r");
|
||||
if(HAS_EVENT){
|
||||
$this->base = new EventBase();
|
||||
$this->ev = new Event($this->base, STDIN, Event::READ | Event::PERSIST, array($this, "readLine"));
|
||||
$this->ev = new Event($this->base, $fp, Event::READ | Event::PERSIST, array($this, "readLine"));
|
||||
$this->ev->add();
|
||||
$this->base->loop();
|
||||
}else{
|
||||
$fp = fopen("php://stdin", "r");
|
||||
while($this->stop === false){
|
||||
$this->base->loop(EventBase::LOOP_ONCE);
|
||||
if($this->line !== false){
|
||||
$this->wait();
|
||||
$this->line = false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
while($this->stop === false){
|
||||
$this->readLine($fp);
|
||||
}
|
||||
@fclose($fp);
|
||||
}
|
||||
@fclose($fp);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user