mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Start console reader in a more sensible place
This commit is contained in:
parent
0b9ce8a0d4
commit
f51743765d
@ -1438,13 +1438,6 @@ class Server{
|
||||
$this->dataPath = realpath($dataPath) . DIRECTORY_SEPARATOR;
|
||||
$this->pluginPath = realpath($pluginPath) . DIRECTORY_SEPARATOR;
|
||||
|
||||
$consoleNotifier = new SleeperNotifier();
|
||||
$this->console = new CommandReader($consoleNotifier);
|
||||
$this->tickSleeper->addNotifier($consoleNotifier, function() : void{
|
||||
$this->checkConsole();
|
||||
});
|
||||
$this->console->start(PTHREADS_INHERIT_NONE);
|
||||
|
||||
$version = new VersionString($this->getPocketMineVersion());
|
||||
|
||||
$this->logger->info("Loading pocketmine.yml...");
|
||||
@ -1538,6 +1531,12 @@ class Server{
|
||||
|
||||
$this->doTitleTick = ((bool) $this->getProperty("console.title-tick", true)) && Terminal::hasFormattingCodes();
|
||||
|
||||
$consoleNotifier = new SleeperNotifier();
|
||||
$this->console = new CommandReader($consoleNotifier);
|
||||
$this->tickSleeper->addNotifier($consoleNotifier, function() : void{
|
||||
$this->checkConsole();
|
||||
});
|
||||
$this->console->start(PTHREADS_INHERIT_NONE);
|
||||
|
||||
if($this->getConfigBool("enable-rcon", false)){
|
||||
try{
|
||||
@ -2050,9 +2049,11 @@ class Server{
|
||||
$this->properties->save();
|
||||
}
|
||||
|
||||
$this->getLogger()->debug("Closing console");
|
||||
$this->console->shutdown();
|
||||
$this->console->notify();
|
||||
if($this->console instanceof CommandReader){
|
||||
$this->getLogger()->debug("Closing console");
|
||||
$this->console->shutdown();
|
||||
$this->console->notify();
|
||||
}
|
||||
|
||||
if($this->network instanceof Network){
|
||||
$this->getLogger()->debug("Stopping network interfaces");
|
||||
|
Loading…
x
Reference in New Issue
Block a user