//require_once("include/sql.inc.php");
require_once "include/rcon_hl_net.inc";
//fetch server_information
$resource2 = mysql_query("SELECT * FROM " . $config->db_prefix . "_serverinfo ORDER BY hostname ASC") or die(mysql_error());
while ($result2 = mysql_fetch_object($resource2)) {
    $split_address = explode(":", $result2->address);
    $ip = $split_address['0'];
    $port = $split_address['1'];
    if ($ip && $port) {
        $server = new Rcon();
        $ip = gethostbyname($ip);
        $server->Connect($ip, $port, $result2->rcon);
        $infos = $server->Info();
        if ($infos) {
            //yes, infos ok
            $players = $server->Players();
            $rules = $server->ServerRules();
            //copy rules to rules array for template
            if (is_array($rules)) {
                foreach ($rules as $k => $v) {
                    $rules_array[] = array("name" => $k, "value" => $v);
                }
            }
            //check if mappic exists
            if (file_exists("images/maps/" . $infos[mod] . "/" . $infos[map] . ".jpg")) {
                $mappic = $infos[map];
            } else {
                $mappic = "noimage";
            }
            //create addons array
            if (is_array($rules)) {