From 17fee801e6acd8cf7fbbda24a54819a54553e050 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 22 Jan 2019 13:43:55 +0000 Subject: [PATCH] RCON: remove unnecessary function --- src/pocketmine/network/rcon/RCON.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/pocketmine/network/rcon/RCON.php b/src/pocketmine/network/rcon/RCON.php index 09aa4be24..d911aad45 100644 --- a/src/pocketmine/network/rcon/RCON.php +++ b/src/pocketmine/network/rcon/RCON.php @@ -100,7 +100,13 @@ class RCON{ $notifier = new SleeperNotifier(); $this->server->getTickSleeper()->addNotifier($notifier, function() : void{ - $this->check(); + $response = new RemoteConsoleCommandSender(); + $this->server->dispatchCommand($response, $this->instance->cmd); + + $this->instance->response = TextFormat::clean($response->getMessage()); + $this->instance->synchronized(function(RCONInstance $thread){ + $thread->notify(); + }, $this->instance); }); $this->instance = new RCONInstance($this->socket, $password, (int) max(1, $maxClients), $this->server->getLogger(), $this->ipcThreadSocket, $notifier); @@ -117,14 +123,4 @@ class RCON{ @socket_close($this->ipcMainSocket); @socket_close($this->ipcThreadSocket); } - - public function check() : void{ - $response = new RemoteConsoleCommandSender(); - $this->server->dispatchCommand($response, $this->instance->cmd); - - $this->instance->response = TextFormat::clean($response->getMessage()); - $this->instance->synchronized(function(RCONInstance $thread){ - $thread->notify(); - }, $this->instance); - } }