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/fleet/library.inc

51 lines
809 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class beta5_fleet_library {
var $fleets = array();
var $fleetDepartures = array();
var $fleetArrivals = array();
var $index = array (
"arrival",
"autoSplit",
"disband",
"get",
"getLocation",
"getPlayerLocations",
"getPower",
"getStats",
"getUpkeep",
"merge",
"sendMoveMessages",
"setOrders",
"split",
"switchStatus"
);
function beta5_fleet_library($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
// Invalidates the fleet cache
function invCache($id = null) {
if (is_null($id)) {
$this->fleets = array();
} else {
$this->fleets[$id] = null;
}
}
// Renames a fleet
function rename($fid, $name) {
$n = addslashes($name);
$this->db->query("UPDATE fleet SET name='$n' WHERE id=$fid");
$this->fleets[$fid] = null;
}
}
?>