From 7d0e631a75c5cd6019f9c1ec89e057014b133ae1 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Sep 2018 19:47:26 +0100 Subject: [PATCH] RakLibInterface: fixed processing hook being registered too early this would cause bugs if the interface was not added directly to the network. --- src/pocketmine/network/mcpe/RakLibInterface.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/network/mcpe/RakLibInterface.php b/src/pocketmine/network/mcpe/RakLibInterface.php index 797d015c8..6705ac33a 100644 --- a/src/pocketmine/network/mcpe/RakLibInterface.php +++ b/src/pocketmine/network/mcpe/RakLibInterface.php @@ -76,10 +76,6 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{ $this->server = $server; $this->sleeper = new SleeperNotifier(); - $server->getTickSleeper()->addNotifier($this->sleeper, function() : void{ - $this->server->getNetwork()->processInterface($this); - }); - $this->rakLib = new RakLibServer( $this->server->getLogger(), \pocketmine\COMPOSER_AUTOLOADER_PATH, @@ -92,6 +88,9 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{ } public function start(){ + $this->server->getTickSleeper()->addNotifier($this->sleeper, function() : void{ + $this->server->getNetwork()->processInterface($this); + }); $this->rakLib->start(PTHREADS_INHERIT_CONSTANTS | PTHREADS_INHERIT_INI); //HACK: MainLogger needs INI and constants }