- new route search ESI endpoint implemented, closed #590

This commit is contained in:
Mark Friedrich
2018-03-16 22:08:28 +01:00
parent f2fc821181
commit d1b58d8df5
8 changed files with 254 additions and 155 deletions

View File

@@ -56,24 +56,12 @@ class Connection extends Controller\AccessController {
$connection = Model\BasicModel::getNew('ConnectionModel');
$connection->getById( (int)$connectionData['id'] );
// search if systems are neighbors
$routeController = new Route();
$routeController->initJumpData();
$route = $routeController->findRoute($connectionData['sourceName'], $connectionData['targetName'], 1);
if($route['routePossible'] == true){
// systems are next to each other
$connectionData['scope'] = 'stargate';
$connectionData['type'] = ['stargate'];
}elseif($connectionData['scope'] == 'stargate'){
// connection scope changed -> this can not be a stargate
$connectionData['scope'] = 'wh';
$connectionData['type'] = ['wh_fresh'];
}
$connectionData['mapId'] = $map;
$connection->setData($connectionData);
// change the default type for the new connection
$connection->setDefaultTypeData();
if($connection->save($activeCharacter)){
$return->connectionData = $connection->getData();