mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 10:31:51 +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->dataPath = realpath($dataPath) . DIRECTORY_SEPARATOR;
|
||||||
$this->pluginPath = realpath($pluginPath) . 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());
|
$version = new VersionString($this->getPocketMineVersion());
|
||||||
|
|
||||||
$this->logger->info("Loading pocketmine.yml...");
|
$this->logger->info("Loading pocketmine.yml...");
|
||||||
@ -1538,6 +1531,12 @@ class Server{
|
|||||||
|
|
||||||
$this->doTitleTick = ((bool) $this->getProperty("console.title-tick", true)) && Terminal::hasFormattingCodes();
|
$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)){
|
if($this->getConfigBool("enable-rcon", false)){
|
||||||
try{
|
try{
|
||||||
@ -2050,9 +2049,11 @@ class Server{
|
|||||||
$this->properties->save();
|
$this->properties->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->console instanceof CommandReader){
|
||||||
$this->getLogger()->debug("Closing console");
|
$this->getLogger()->debug("Closing console");
|
||||||
$this->console->shutdown();
|
$this->console->shutdown();
|
||||||
$this->console->notify();
|
$this->console->notify();
|
||||||
|
}
|
||||||
|
|
||||||
if($this->network instanceof Network){
|
if($this->network instanceof Network){
|
||||||
$this->getLogger()->debug("Stopping network interfaces");
|
$this->getLogger()->debug("Stopping network interfaces");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user