mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
ConsoleReaderThread: remove useless code
This commit is contained in:
parent
1cc57afd25
commit
32588d79c8
@ -1357,7 +1357,6 @@ class Server{
|
|||||||
|
|
||||||
if(isset($this->console)){
|
if(isset($this->console)){
|
||||||
$this->getLogger()->debug("Closing console");
|
$this->getLogger()->debug("Closing console");
|
||||||
$this->console->shutdown();
|
|
||||||
$this->console->quit();
|
$this->console->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,22 +46,16 @@ final class ConsoleReaderThread extends Thread{
|
|||||||
private \Threaded $buffer;
|
private \Threaded $buffer;
|
||||||
private ?SleeperNotifier $notifier;
|
private ?SleeperNotifier $notifier;
|
||||||
|
|
||||||
public bool $shutdown = false;
|
|
||||||
|
|
||||||
public function __construct(\Threaded $buffer, ?SleeperNotifier $notifier = null){
|
public function __construct(\Threaded $buffer, ?SleeperNotifier $notifier = null){
|
||||||
$this->buffer = $buffer;
|
$this->buffer = $buffer;
|
||||||
$this->notifier = $notifier;
|
$this->notifier = $notifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shutdown() : void{
|
|
||||||
$this->shutdown = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function onRun() : void{
|
protected function onRun() : void{
|
||||||
$buffer = $this->buffer;
|
$buffer = $this->buffer;
|
||||||
$notifier = $this->notifier;
|
$notifier = $this->notifier;
|
||||||
|
|
||||||
while(!$this->shutdown){
|
while(!$this->isKilled){
|
||||||
$this->runSubprocess($buffer, $notifier);
|
$this->runSubprocess($buffer, $notifier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +99,7 @@ final class ConsoleReaderThread extends Thread{
|
|||||||
throw new AssumptionFailedError("stream_socket_accept() returned false");
|
throw new AssumptionFailedError("stream_socket_accept() returned false");
|
||||||
}
|
}
|
||||||
stream_socket_shutdown($server, STREAM_SHUT_RDWR);
|
stream_socket_shutdown($server, STREAM_SHUT_RDWR);
|
||||||
while(!$this->shutdown){
|
while(!$this->isKilled){
|
||||||
$r = [$client];
|
$r = [$client];
|
||||||
$w = null;
|
$w = null;
|
||||||
$e = null;
|
$e = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user