Пример #1
0
$map_info = new map_info($uid);
$fog_of_war = $map_info->get_fog_of_war();
if (!in_array($sid, $map_info->get_scanned_systems()) && !$fog_of_war[$sid]) {
    return false;
}
if (!in_array($sid, $map_info->get_scanned_systems())) {
    $fog_mode = true;
} else {
    $fog_mode = false;
}
if ($fog_mode) {
    $planets = array_values($fog_of_war[$sid]);
} else {
    $planets = $map_info->get_systemplanets($sid);
}
$globalTransform = get_global_SVGTransform($uid, 1, $sid, $availHeight, $availWidth);
$abstand = 30;
$inner_moves = array();
echo "<g id=\"planets" . $sid . "\" transform=\"translate(" . $globalTransform . ")\"" . ($fog_mode ? " fogged=\"1\" style=\"opacity:0.5\"" : " fogged=\"0\"") . ">";
if (is_array($planets)) {
    $planet_count = sizeof($planets) + 1;
    $max_size = $planet_count * $abstand + 10;
    echo "<g class=\"displayMarker\">";
    echo "<path d=\"M-10,0 v-10 h10\"/>";
    echo "<path d=\"M10,0 v10 h-10\"/>";
    echo "</g>";
    echo "<g pointer-events=\"none\" class=\"planetsOrbits\">\n";
    for ($j = 1; $j < $planet_count; $j++) {
        echo "<circle cx=\"0\" cy=\"0\" r=\"" . $abstand * ($j + 1) . "\"/>\n";
    }
    echo "</g>\n";
Пример #2
0
function startup()
{
    global $uid;
    global $ses;
    global $globalTranslate;
    $availHeight = $_GET["availHeight"];
    $availWidth = $_GET["availWidth"];
    $globalTranslate = get_global_SVGTransform($uid, 0, 0, $availHeight, $availWidth);
    $ses->reg("globalTranslate");
    $universe = new universe();
    $cids = $universe->get_surrounding_constellations(get_cid_by_sid(get_sid_by_pid(get_homeworld($uid))));
    $GLOBALS["map_info"] = new map_info($uid, $cids);
    get_svg_stars_of_cids($cids, $fleet_symbols, $fleet_routes, $scans, $systems);
    echo "<g id=\"startranslate\" transform=\"translate(" . $globalTranslate . ")\">";
    // runelord: zuerst die scans, damit die nix verdecken
    echo "<g id=\"fleet_scans\">\n";
    echo $scans;
    echo "</g>\n";
    // mop: dann die constellationen malen, damit die sterne drüberliegen können
    echo "<g id=\"constellationgrid\">";
    constellation_grid();
    echo "</g>";
    echo "<g id=\"stars\">";
    echo $systems;
    echo "</g>";
    echo "<g id=\"flottenpfade\">\n";
    echo $fleet_routes;
    echo "</g>\n";
    echo "<g id=\"fleet_symbols\">\n";
    echo $fleet_symbols;
    echo "</g>\n";
    echo "</g>";
    $coords = $universe->get_coords_by_cids($cids);
    $translate = explode(" ", $globalTranslate);
    echo "\n<!-- " . ($coords[0] + $translate[0]) . " " . ($coords[1] + $translate[0]) . " " . ($coords[2] + $translate[1]) . " " . ($coords[3] + $translate[1]) . " -->";
}