- UI changes to "build index" button on /setup

- updated `wormhole.csv`
- upgrade SDE dump `eve_lifeblood.sql` -> `eve_abyss.sql`
- upgrade endpoint "getUniverseSystemData()" `v3` -> `v4`
- upgrade endpoint "getUniverseStructureData()" `v1` -> `v2`
- some minor code improvements
This commit is contained in:
Mark Friedrich
2018-06-02 19:29:00 +02:00
parent 0417aafa97
commit c805a2ea0c
30 changed files with 876 additions and 1910 deletions

View File

@@ -91,6 +91,15 @@ class Setup extends Controller\Controller {
$return->countBuildAll = $categoryUniverseModel->getById($categoryId, 0)->getTypesCount(false);
$return->progress = $percent($return->countAll, $return->countBuildAll);
break;
case 'SystemNeighbourModel':
// Becomes deprecated with new Universe DB!!!
$this->setupSystemJumpTable();
$return->countAll = 5214;
$return->countBuild = Database::instance()->getRowCount('system_neighbour');
$return->countBuildAll = $return->countBuild;
$return->progress = $percent($return->countAll, $return->countBuildAll);
break;
}
if($return->countBuildAll < $return->countAll){
@@ -130,5 +139,74 @@ class Setup extends Controller\Controller {
echo json_encode($return);
}
/**
* This function is just for setting up the cache table 'system_neighbour' which is used
* for system jump calculation. Call this function manually when CCP adds Systems/Stargates
*/
protected function setupSystemJumpTable(){
$pfDB = $this->getDB('PF');
$ccpDB = $this->getDB('CCP');
$query = "SELECT
map_sys.solarSystemID system_id,
map_sys.regionID region_id,
map_sys.constellationID constellation_id,
map_sys.solarSystemName system_name,
ROUND( map_sys.security, 4) system_security,
(
SELECT
GROUP_CONCAT( NULLIF(map_sys_inner.solarSystemName, NULL) SEPARATOR ':')
FROM
mapSolarSystemJumps map_jump INNER JOIN
mapSolarSystems map_sys_inner ON
map_sys_inner.solarSystemID = map_jump.toSolarSystemID
WHERE
map_jump.fromSolarSystemID = map_sys.solarSystemID
) system_neighbours
FROM
mapSolarSystems map_sys
HAVING
-- skip systems without neighbors (e.g. WHs)
system_neighbours IS NOT NULL
";
$rows = $ccpDB->exec($query);
if(count($rows) > 0){
// switch DB back to pathfinder DB
// clear cache table
$pfDB->exec("TRUNCATE system_neighbour");
foreach($rows as $row){
$pfDB->exec("
INSERT INTO
system_neighbour(
regionId,
constellationId,
systemName,
systemId,
jumpNodes,
trueSec
)
VALUES(
:regionId,
:constellationId,
:systemName,
:systemId,
:jumpNodes,
:trueSec
)",
[
':regionId' => $row['region_id'],
':constellationId' => $row['constellation_id'],
':systemName' => $row['system_name'],
':systemId' => $row['system_id'],
':jumpNodes' => $row['system_neighbours'],
':trueSec' => $row['system_security']
]);
}
}
}
}