Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Improve #2238, do not crash when an invalid/corrupt RCON stop event h…
Browse files Browse the repository at this point in the history
…appens
  • Loading branch information
shoghicp committed Oct 28, 2014
1 parent 4299ebe commit 6949247
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pocketmine/network/rcon/RCON.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -56,7 +56,7 @@ public function __construct(Server $server, $password, $port = 19132, $interface
$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);
Expand Down

0 comments on commit 6949247

Please sign in to comment.