This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/beta5/moving/library/getTrajectory.inc

31 lines
651 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class beta5_moving_getTrajectory {
function beta5_moving_getTrajectory($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
// Get an object's current trajectory
function run($oid) {
$q = $this->db->query("SELECT w.location AS id,w.until_eta AS eta,s.x AS x,s.y AS y,p.orbit AS orbit,p.status AS opacity,p.name AS name "
. "FROM waypoint w,planet p,system s "
. "WHERE w.move_id=$oid AND p.id=w.location AND s.id=p.system "
. "ORDER BY w.until_eta DESC");
if (!($q && dbCount($q))) {
return array();
}
$rv = array();
while ($r = dbFetchHash($q)) {
array_push($rv, $r);
}
return $rv;
}
}
?>