Example #1
0
 public function __construct()
 {
     $this->BASE_FILE = ROOT_URL . "Carte.php";
     $this->map = map::getinstance();
     $this->lng = language::getinstance()->GetLngBlock('carte');
     parent::__construct();
 }
Example #2
0
function img_dot($image, $coord, $clr)
{
    $tc = map::getinstance()->taille / 100;
    $td = floor($tc / 2);
    $td = $td % 2 ? $td + 3 : $td + 2;
    list($sX, $sY) = map::ss2xy($coord);
    $x1 = floor($tc * $sX - $tc / 2);
    $y1 = floor($tc * ($sY + 1) - $tc / 2);
    imagefilledellipse($image, $x1, $y1, $td, $td, $clr);
}
/**
 * @author Alex10336
 * Dernière modification: $Id$
 * @license GNU Public License 3.0 ( http://www.gnu.org/licenses/gpl-3.0.txt )
 * @license Creative Commons 3.0 BY-SA ( http://creativecommons.org/licenses/by-sa/3.0/deed.fr )
 *
 **/
require_once './init.php';
require_once INCLUDE_PATH . 'Script.php';
require_once CLASS_PATH . 'parser.class.php';
require_once CLASS_PATH . 'cartographie.class.php';
require_once CLASS_PATH . 'map.class.php';
if (!Members::CheckPermsOrDie('CARTOGRAPHIE')) {
}
$map = map::getinstance();
$carto = cartographie::getinstance();
$lng = language::getinstance()->GetLngBlock('cartographie');
if (isset($_POST['massedit'])) {
    foreach ($_POST['item'] as $k => $arr) {
        if ($arr['delete']) {
            $carto->Delete_Entry($k, $arr['type']);
        } else {
            if ($arr['edit']) {
                unset($arr['edit']);
                if (isset($arr['TROOP'])) {
                    $arr['TROOP'] = DataEngine::strip_number($arr['TROOP']);
                }
                $carto->Edit_Entry($k, $arr);
            }
        }
Example #4
0
 /**
  * @param		mixte				Debug text
  * @param		boolean			New line before
  * @return	boolean
  */
 public static function map_debug($text, $newline = true)
 {
     if (!IN_DEV) {
         return false;
     }
     global $image, $debug_cl;
     static $x = 1, $y = -15, $map;
     if (!$map) {
         $map = map::getinstance();
     }
     if (DEBUG_PLAIN) {
         return print_r($text);
     }
     if (!IS_IMG) {
         return false;
     }
     if (!isset($image)) {
         return false;
     }
     if (is_array($text)) {
         $text = str_replace("\t\t", '', print_r($text, true));
     }
     if ($newline) {
         $x = 1;
         $y += 15;
     }
     $text = utf8_decode($text);
     for ($i = 0; $i < strlen($text); $i++) {
         $c = p_substr($text, $i, 1);
         if ($x - 10 >= $map->taille - 15 or $c == "\n") {
             $x = 1;
             $y += 15;
         }
         if ($c == "\n") {
             continue;
         }
         imagechar($image, 4, $x, $y, $c, $debug_cl);
         $x += 10;
     }
     return true;
 }
 protected static function mysql_die($debug, $die = true)
 {
     if ($die) {
         if (IS_IMG) {
             header('Content-Type: image/png');
             header('Cache-Control: no-cache, must-revalidate');
             // HTTP/1.1
             header('Expires: Mon, 16 Jul 2008 04:21:44 GMT');
             // HTTP/1.0 Date dans le passé
             require_once CLASS_PATH . 'map.class.php';
             $map = map::getinstance();
             $image = imagecreate($map->taille, $map->taille);
             $background_color = imagecolorallocate($image, 0, 0, 0);
             imagefilledrectangle($image, 0, 0, $map->taille, $map->taille, $background_color);
             $debug_cl = imagecolorallocate($image, 254, 254, 254);
             map_debug($debug);
             imagepng($image);
             imagedestroy($image);
             exit;
         } else {
             header('Content-Type: text/plain;charset=utf-8');
         }
         $linebreak = "\n";
     } else {
         echo '<pre>';
         $linebreak = '<br/>';
         $sql = str_replace("\n", $linebreak, $debug);
     }
     echo mysql_error() . $linebreak . $debug . $linebreak;
     if ($die) {
         die;
     }
 }
 /**
  * @since 1.4.1
  */
 public function get_comlevelwithname()
 {
     if (($data = $this->get_universe(false)) === false) {
         return false;
     }
     $map = map::getinstance();
     $com_level = array();
     foreach ($data as $k => $v) {
         $com_level[$k]['ss'] = $map->Parcours()->get_coords_part($v['Coord']);
         $com_level[$k]['name'] = $v['Name'];
         $com_level[$k]['level'] = $v['communication'];
     }
     return $com_level;
 }
Example #7
0
    DataEngine::ErrorAndDie('Paramètre(s) manquant(s)');
}
$scanner = addons::getinstance()->Get_Addons('scanner');
$host = $scanner->ScanServer();
$header = 'Cookie: login_email=' . str_replace('@', '%40', $_SESSION['scanner_email']) . '; testcookie=1; PHPSESSID=' . $_SESSION['scanner_session'] . "\r\n";
$nbplanets = 0;
$skipnb = intval($_GET['step']);
$skipnext = $skipnb + 1;
$carto = cartographie::getinstance();
if (isset($_GET['ss']) && $_GET['ss'] != '') {
    $coord = $_GET['ss'];
} else {
    $coord = ownuniverse::getinstance()->get_comlevel();
    $coord = $coord[intval($_GET['id'])]['ss'];
}
$coords = map::getinstance()->Parcours()->GetListeCoorByRay($coord, $scanner->ScanRay('planets'));
$maxpage = count($coords) - 1;
$curcoord = $coords[$skipnb];
echo '<html><head><title>Scan N°' . $skipnb . '/' . $maxpage . ' (base:' . $coord . ')</title></head><body>';
echo 'Système ' . $curcoord . ':</br>';
if (($page = GetUrl($host, '/galaxy/galaxy_overview.php?area=galaxy&starsystem_id=' . $curcoord . '&fleet_id=&from=', $header)) === false) {
    die('error sock 1');
}
//$page = file_get_contents('../../test/data/galaxy_1.txt');
preg_match_all("#sun,[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([a-fA-f0-9]{32})#", $page, $sun);
if (count($sun[0]) == 0) {
    die('err preg 1');
}
sleep(rand(3, 8));
if (($page = GetUrl($host, '/galaxy/galaxy_info.php?starsystem_id=' . $curcoord . '&hash=' . $sun[1][0], $header)) === false) {
    die('error sock 2');