Exemple #1
0
}
if (!$u) {
    $pid = $argv[2];
    if (!$pid) {
        $pid = $_REQUEST['pid'];
    }
    if (!$pid) {
        $pid = $_COOKIE['user_name'];
    }
    if (!$pid) {
        die("no param");
    }
    $data = TTGenid::getbypid($pid);
} else {
    $data = TTGenid::getbyid($u);
}
if ($data['id']) {
    $u = $data['id'];
}
if (!$data) {
    die("{$u} {$pid} no u get");
}
$tu = new TTUser($u);
print_r($data);
$tt = $tu->getAll(false);
print_r(TTExtend::processmap($tt));
print_r($tt);
?>
</body>
</html>
Exemple #2
0
        die("no param");
    }
    $data = TTGenid::getbypid($pid);
} else {
    $data = TTGenid::getbyid($u);
}
if ($data['id']) {
    $u = $data['id'];
}
if (!$data) {
    die("{$u} {$pid} no u get");
}
$tu = new TTUser($u, true);
print_r($data);
$tt = $tu->getAll(false);
$all = TTExtend::processmap($tt);
print_r($all);
print_r($tt);
//检查是否有位置重叠的卡车 (只检查横向重叠)
$car_pos = array();
foreach ($all['c'] as $car_obj) {
    $x = $car_obj['pos']['x'];
    $y = $car_obj['pos']['y'];
    $car = ItemConfig::getItem($car_obj['tag']);
    for ($i = 0; $i < $car['gridWidth']; $i++) {
        if (!$car_pos[$x + $i][$y]) {
            $car_pos[$x + $i][$y] = 1;
        } else {
            echo "出现重叠车位: \n";
            print_r($car_obj);
            break;