Fixed crashes starting RCON

This commit is contained in:
Dylan K. Taylor
2017-06-21 18:15:57 +01:00
parent c09a5ab301
commit 8cd31c2dc4
2 changed files with 19 additions and 8 deletions

View File

@ -1486,7 +1486,18 @@ class Server{
$this->scheduler = new ServerScheduler();
if($this->getConfigBoolean("enable-rcon", false) === true){
$this->rcon = new RCON($this, $this->getConfigString("rcon.password", ""), $this->getConfigInt("rcon.port", $this->getPort()), ($ip = $this->getIp()) != "" ? $ip : "0.0.0.0", $this->getConfigInt("rcon.threads", 1), $this->getConfigInt("rcon.clients-per-thread", 50));
try{
$this->rcon = new RCON(
$this,
$this->getConfigString("rcon.password", ""),
$this->getConfigInt("rcon.port", $this->getPort()),
($ip = $this->getIp()) != "" ? $ip : "0.0.0.0",
$this->getConfigInt("rcon.threads", 1),
$this->getConfigInt("rcon.clients-per-thread", 50)
);
}catch(\Throwable $e){
$this->getLogger()->critical("RCON can't be started: " . $e->getMessage());
}
}
$this->entityMetadata = new EntityMetadataStore();