コード例 #1
0
ファイル: server.php プロジェクト: grinco/cccaminfo
    $nodes = $servers[$sh_host];
}
if (isset($nodes) && count($nodes)) {
    $info_total = 0;
    if (isset($total_host_shares[$sh_host]["total"])) {
        $info_total = $total_host_shares[$sh_host]["total"];
    }
    $info_total_unic = count($nodes) - 1;
    $info_uniqueIndex = 0;
    if ($info_total != 0) {
        $info_uniqueIndex = (int) ($info_total_unic / $info_total * 100);
    }
    //$info_total_reshare = $total_reshare[$sh_host]["total"];
    //$info_reshareIndex = (int)($info_total_reshare/$info_total_unic *100);
    list($host_DNS, $host_PORT) = explode(":", $sh_host);
    $host_IP = trim(getHostIP($host_DNS));
    $tara_host = taraNameSaved($sh_host);
    $IPServer = trim($tara_host[1]);
    $tara_code = tara($host_IP, $sh_host);
    if ($host_IP != "" && $IPServer != "" && $host_IP != $IPServer) {
        loadGlobalServers();
        $globalServers[$sh_host][1] = $IPServer;
        saveGlobalServers();
    }
    if ($country_whois == true) {
        $tara_nume = taraName($tara_code["tara"]);
    }
    echo "<table border=0 cellpadding=0 cellspacing=0>";
    echo "<tr>";
    echo "<td VALIGN = \"top\">";
    format1("Server", $sh_host);
コード例 #2
0
ファイル: common.php プロジェクト: grinco/cccaminfo
function UpdateServersCountryIP()
{
    loadGlobalServers();
    loadECMServers();
    global $servers_file;
    global $globalServers;
    global $Server_Conectat_Local;
    global $SERVER_PAIR;
    global $clientConectat;
    initPairs();
    initClients();
    $servers_data = file($servers_file);
    foreach ($servers_data as $currentline) {
        $inceput1 = substr($currentline, 0, 1);
        $inceput2 = substr($currentline, 1, 2);
        if ($inceput1 == "|" && $inceput2 != " H") {
            $server = explode("|", $currentline);
            $server_Host = trim($server[1]);
            $server_Time = trim($server[2]);
            $server_Type = trim($server[3]);
            $server_Ver = trim($server[4]);
            $server_Nodeid = trim($server[5]);
            $server_Cards = trim($server[6]);
            $server_Idents = trim($server[7]);
            if ($server_Host != "") {
                list($host_DNS, $host_PORT) = explode(":", $server_Host);
                $taraSaved = taraNameSaved($server_Host);
                $checkIP = true;
                if (isset($SERVER_PAIR[$server_Host])) {
                    foreach ($SERVER_PAIR[$server_Host] as $Client_afisat) {
                        $IPdiferit = false;
                        if (isset($clientConectat[$Client_afisat]["Info"][0])) {
                            $IPClient = trim($clientConectat[$Client_afisat]["Info"][0]);
                        }
                        $IPServer = trim($taraSaved[1]);
                        if ($IPClient == $IPServer) {
                            $checkIP = false;
                            break;
                        }
                    }
                } else {
                    $checkIP = false;
                }
                if ($checkIP == true || $taraSaved[0] == "" || $taraSaved[1] == "") {
                    $host_IP = getHostIP($host_DNS);
                    tara($host_IP, $server_Host);
                    $globalServers[$server_Host] = array($server_Nodeid, $host_IP, $taraSaved[0]["tara"]);
                } else {
                    $globalServers[$server_Host] = array($server_Nodeid, $taraSaved[1], $taraSaved[0]["tara"]);
                }
                $Server_Conectat_Local[$server_Nodeid] = $server_Host;
                $lastServer = $server_Host;
            }
        }
    }
    saveGlobalServers();
    saveGlobalNodeID();
}