Ejemplo n.º 1
0
    }
    $db3->query("SELECT * FROM warp WHERE game_id = {$game_id} AND (sector_id_1 = {$sector_id} OR sector_id_2 = {$sector_id}) LIMIT 1");
    if ($db3->next_record()) {
        $CurrByte = 128;
    } else {
        $CurrByte = 0;
    }
    // locations
    $db2->query("SELECT * FROM location NATURAL JOIN location_type WHERE game_id = {$game_id} AND sector_id = {$sector_id} LIMIT 1");
    $CurrByte += $db2->nf();
    $file .= addbyte($CurrByte);
    // warp
    $db3->query("SELECT * FROM warp WHERE game_id = {$game_id} AND (sector_id_1 = {$sector_id} OR sector_id_2 = {$sector_id}) LIMIT 1");
    if ($db3->next_record()) {
        $warp_id = $db3->f("sector_id_1") == $sector_id ? $db3->f("sector_id_2") : $db3->f("sector_id_1");
        $file .= add2bytes($warp_id);
    }
    while ($db2->next_record()) {
        $file .= add2bytes($db2->f("mgu_id"));
    }
}
$size = strlen($file);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"{$game_name}.cmf\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $size);
echo $file;
Ejemplo n.º 2
0
    }
    $db3->query('SELECT * FROM warp WHERE game_id = ' . $game_id . ' AND (sector_id_1 = ' . $sector_id . ' OR sector_id_2 = ' . $sector_id . ') LIMIT 1');
    if ($db3->nextRecord()) {
        $CurrByte = 128;
    } else {
        $CurrByte = 0;
    }
    // locations
    $db2->query('SELECT * FROM location NATURAL JOIN location_type WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector_id . ' LIMIT 1');
    $CurrByte += $db2->getNumRows();
    $file .= addbyte($CurrByte);
    // warp
    $db3->query('SELECT * FROM warp WHERE game_id = ' . $game_id . ' AND (sector_id_1 = ' . $sector_id . ' OR sector_id_2 = ' . $sector_id . ') LIMIT 1');
    if ($db3->nextRecord()) {
        $warp_id = $db3->getField('sector_id_1') == $sector_id ? $db3->getField('sector_id_2') : $db3->getField('sector_id_1');
        $file .= add2bytes($warp_id);
    }
    while ($db2->nextRecord()) {
        $file .= add2bytes($db2->getField('mgu_id'));
    }
}
$size = strlen($file);
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="$game_name.cmf"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . $size);
echo $file;