I have a few servers that I am checking against, and getting the number of players for. However if the rcon or server isn't on, I get an exception when trying to connect (line 199 in the arc.php file). The exception is great, except when I try to surround it in a try/catch block... it's acting as if the try/catch is ignored completely? Or maybe I'm just not understanding it... but hopefully I can get some help.
Below is the offending area. I have a list of servers that have rcon credentials, and I am getting this single piece of info from each.
foreach($serverInfoArray as $key => $value){
try {
$rcon = new Arc($value['game_ip'], $value['rcon_password'], $value['rcon_port']); //If the server is off, this throws the exception, but then never hits the catch block?
$serverInfoArray[$key]['players_online'] = count($rcon->getPlayersArray());
unset($serverInfoArray[$key]['rcon_password']);
unset($serverInfoArray[$key]['rcon_port']);
} catch (Exception $e) {
echo $e->getMessage(); //This never happens.
}
}
I have a few servers that I am checking against, and getting the number of players for. However if the rcon or server isn't on, I get an exception when trying to connect (line 199 in the arc.php file). The exception is great, except when I try to surround it in a try/catch block... it's acting as if the try/catch is ignored completely? Or maybe I'm just not understanding it... but hopefully I can get some help.
Below is the offending area. I have a list of servers that have rcon credentials, and I am getting this single piece of info from each.