diff --git a/src/pocketmine/network/rcon/RCON.php b/src/pocketmine/network/rcon/RCON.php index 60a24aab6..fa60f7837 100644 --- a/src/pocketmine/network/rcon/RCON.php +++ b/src/pocketmine/network/rcon/RCON.php @@ -38,7 +38,7 @@ class RCON{ private $socket; private $password; /** @var RCONInstance[] */ - private $workers; + private $workers = []; private $clientsPerThread; public function __construct(Server $server, $password, $port = 19132, $interface = "0.0.0.0", $threads = 1, $clientsPerThread = 50){ @@ -56,7 +56,7 @@ class RCON{ $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if($this->socket === false or !socket_bind($this->socket, $interface, (int) $port) or !socket_listen($this->socket)){ $this->server->getLogger()->critical("RCON can't be started: " . socket_strerror(socket_last_error())); - + $this->threads = 0; return; } socket_set_block($this->socket);