lwb5-in-2025/scripts/game/beta5/fleet/library/getLocation.inc

23 lines
437 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class beta5_fleet_getLocation {
2024-12-31 10:42:58 +01:00
function __construct($lib) {
2016-01-10 11:01:49 +01:00
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
// Returns the list of fleets in orbit around a planet
function run($pid, $pl = null) {
$q = $this->db->query("SELECT id,name FROM fleet WHERE location = $pid" . (is_null($pl) ? "" : " AND owner=$pl"));
$a = array();
while ($r = dbFetchArray($q)) {
$a[$r[0]] = $r[1];
}
return $a;
}
}
?>