Пример #1
0
 log_conversion($config['LOG_DIR'] . '/' . $vid . '.log', implode("\n", $output));
 //change permissions to 666 for lighty
 @chmod($config['FLVDO_DIR'] . '/' . $vid . '.flv', 0666);
 // delete temporary flv file
 @unlink($config['FLVDO_DIR'] . '/' . $vid . 'x.flv');
 //extract video thumbs
 extract_video_thumbs($video_path, $vid);
 //activate video
 if (file_exists($config['FLVDO_DIR'] . '/' . $vid . '.flv') && filesize($config['FLVDO_DIR'] . '/' . $vid . '.flv') > 10) {
     $add = NULL;
     if ($config['multi_server'] == '1') {
         require $config['BASE_DIR'] . '/include/function_server.php';
         $server = get_server();
         update_server_used($server);
         upload_video($config['FLVDO_DIR'] . '/' . $vid . '.flv', $server['server_ip'], $server['ftp_username'], $server['ftp_password'], $server['ftp_root']);
         update_server($server);
         $add = ", server = '" . mysql_real_escape_string($server['url']) . "'";
     }
     $active = $config['approve'] == '1' ? '0' : '1';
     $sql = "UPDATE video SET active = '" . $active . "'" . $add . " WHERE VID = " . intval($vid) . " LIMIT 1";
     $conn->execute($sql);
     @unlink($config['TMP_DIR'] . '/logs/' . $vid . '.log');
 }
 //delete original video
 if ($config['del_original_video'] == '1') {
     if (filesize($config['FLVDO_DIR'] . '/' . $vid . '.flv') > 100 && file_exists($config['FLVDO_DIR'] . '/' . $vid . '.flv')) {
         chmod($video_path, 0777);
         unlink($video_path);
     }
 }
 //delete temporary thumb files
Пример #2
0
        print "<td>{$info['at']}:{$info['port']}";
        print "<td>" . $info['name'];
        print "<td>" . $info['info'];
        print "<td>Doomsday {$info['ver']}, {$info['game']}";
        print "<tr><td><th>Setup<td>";
        print "{$info['mode']} <td colspan=2>{$info['map']} {$info['setup']}";
        print "<tr><td><th>WADs<td colspan=3>";
        print "{$info['iwad']} (" . dechex($info['wcrc']) . ") {$info['pwads']}";
        print "<tr><td><th>Players<td colspan=3>";
        print "{$info['nump']} / {$info['maxp']}: ";
        print "{$info['plrn']}";
    }
    print "</table></body></html>\n";
    $db->close();
}
//global $HTTP_SERVER_VARS;
$query = $HTTP_SERVER_VARS['QUERY_STRING'];
$remote = $HTTP_SERVER_VARS['REMOTE_ADDR'];
// There are three operating modes:
// 1. Server announcement processing.
// 2. Answering a request for servers.
// 3. WWW-friendly presentation for web browsers.
if ($HTTP_RAW_POST_DATA && !$query) {
    update_server($HTTP_RAW_POST_DATA, $remote);
} else {
    if ($query == "list") {
        answer_request();
    } else {
        web_page();
    }
}
Пример #3
0
            header("Content-Type: text/xml; charset=utf-8");
            echo mb_ereg_replace('http', 'https', $result);
        }
    }
}
$query = $_SERVER['QUERY_STRING'];
// There are five operating modes:
// 1. Server announcement processing.
// 2. Answering a request for servers in plain text .
// 3. Answering a request for servers with a JSON data graph.
// 4. Retrieve a log of recent events as an XML file.
// 5. Web page.
if (isset($GLOBALS['HTTP_RAW_POST_DATA']) && empty($query)) {
    $announcement = $GLOBALS['HTTP_RAW_POST_DATA'];
    $remote = $_SERVER['REMOTE_ADDR'];
    update_server($announcement, $remote);
} else {
    if ($query === 'list') {
        // A server list request. Our response is a plain-text key ':' value list.
        $ms = new MasterServer();
        $ms->printServerList();
        exit;
        // Thats all folks!
    } else {
        if ($query === 'json') {
            answer_request();
        } else {
            if ($query === 'xml') {
                return_xmllog();
            } else {
                // Forward this request to the server browser interface.
Пример #4
0
        $stmt->bindValue(':name', $obj->name);
        $stmt->bindValue(':haspassword', $obj->haspassword);
        $stmt->bindValue(':description', $obj->description);
        $stmt->bindValue(':version', $obj->version);
        $stmt->bindValue(':players', $obj->players);
        $stmt->bindValue(':maxplayers', $obj->maxplayers);
        $stmt->execute();
    }
}
function remove_old_servers()
{
    global $db;
    $result = $db->query("DELETE FROM servers WHERE time < DATETIME('now', '-70 seconds');");
}
function list_servers()
{
    global $db;
    $servers = array();
    $result = $db->query("SELECT * FROM servers");
    while ($row = $result->fetchArray()) {
        array_push($servers, array('address' => "{$row['address']}:{$row['port']}", 'name' => $row['name'], 'haspassword' => $row['haspassword'], 'description' => $row['description'], 'version' => $row['version'], 'players' => $row['players'], 'maxplayers' => $row['maxplayers']));
    }
    echo json_encode($servers);
}
if ($port) {
    $data = request_gameinfo($address, $port);
    update_server($data);
} else {
    remove_old_servers();
    list_servers();
}