v1.1.1 (#233)
* fixed #194 PHP 5.6 error * - closed #102 added "set waypoint/destination" context menu to route finder module - update "Select2" 4.0.0 -> 4.0.3 - update "Font Awesome" 4.6.1 -> 4.6.3 * - added *.js files for develop branch * - closed #195 fixed "BASE" dir for subDir installations - fixed "Home" menu link * - #195 improved js load path * - added "clear cache" function for manually cache clearing to /setup #200 #105 #158 - added cache size information to /setup - added current pathfinder "VERSION" to /setup - updated "requireJs" 2.1.20 ->2.2.0 - removed unnecessary page cache timings from static templates (page cache) * - added "document_root", "port", "protocol" and "PHP framework version" to /setup page - added new "shattered" wormhole types to "signature table", closed #182, #179 * - added new "delete old signatures" option to "signature reader" dialog, closed #95 * - added new housekeeping cronjob für cached files, closed #200 - added new cache size information to /setup page * - fixed signature groupId/typeId "overwriting" for already known signatures. closed #207 - improved system search dialog. Added trim(); before "api/signatures-> search" request * updated README.me * fixed PHP error "default object from empty value", closed #209 * reduced image file size * - added local storage (IndexedDB) - added local storage for map scroll position. closed #69 * - added "notice" panel for upcoming release information - improved layout for "release dialog" (GitHub API) - improved pagespeed (removed render blocking javascripts) - improved map scrollbar configuration - improved Chrome browser custom scrollbar layout - removed "sign up" buttons from "map panels", closed #214 * - fixed some session and cookie bugs * - added new requirement check for `max_input_vars` to /setup URL, closed #224 * - fixed isWormhole(); bug * -v1.1.1 added js build files
This commit is contained in:
@@ -40,7 +40,7 @@ class GitHub extends Controller\Controller {
|
||||
public function releases($f3){
|
||||
$cacheKey = 'CACHE_GITHUB_RELEASES';
|
||||
$ttl = 60 * 30; // 30min
|
||||
$releaseCount = 3;
|
||||
$releaseCount = 4;
|
||||
|
||||
if( !$f3->exists($cacheKey) ){
|
||||
$apiPath = $this->getF3()->get('PATHFINDER.API.GIT_HUB') . '/repos/exodus4d/pathfinder/releases';
|
||||
|
||||
@@ -780,150 +780,155 @@ class Map extends Controller\AccessController {
|
||||
$sourceSystemId = (int)$this->getF3()->get(User::SESSION_KEY_CHARACTER_PREV_SYSTEM_ID);
|
||||
$targetSystemId = (int)$log->systemId;
|
||||
|
||||
$sourceSystem = null;
|
||||
$targetSystem = null;
|
||||
if($sourceSystemId){
|
||||
$sourceSystem = null;
|
||||
$targetSystem = null;
|
||||
|
||||
// check if source and target systems are equal
|
||||
// -> NO target system available
|
||||
if($sourceSystemId === $targetSystemId){
|
||||
// check if previous (solo) system is already on the map
|
||||
$sourceSystem = $map->getSystemByCCPId($sourceSystemId);
|
||||
$sameSystem = true;
|
||||
}else{
|
||||
// check if previous (source) system is already on the map
|
||||
$sourceSystem = $map->getSystemByCCPId($sourceSystemId);
|
||||
// check if source and target systems are equal
|
||||
// -> NO target system available
|
||||
if($sourceSystemId === $targetSystemId){
|
||||
// check if previous (solo) system is already on the map
|
||||
$sourceSystem = $map->getSystemByCCPId($sourceSystemId);
|
||||
$sameSystem = true;
|
||||
}else{
|
||||
// check if previous (source) system is already on the map
|
||||
$sourceSystem = $map->getSystemByCCPId($sourceSystemId);
|
||||
|
||||
// -> check if system is already on this map
|
||||
$targetSystem = $map->getSystemByCCPId( $targetSystemId );
|
||||
}
|
||||
// -> check if system is already on this map
|
||||
$targetSystem = $map->getSystemByCCPId( $targetSystemId );
|
||||
}
|
||||
|
||||
// if systems don´t already exists on map -> get "blank" systems
|
||||
// -> required for system type check (e.g. wormhole, k-space)
|
||||
if( !$sourceSystem ){
|
||||
$sourceExists = false;
|
||||
$sourceSystem = $map->getNewSystem($sourceSystemId);
|
||||
}else{
|
||||
// system exists -> add target to the "right"
|
||||
$systemPosX = $sourceSystem->posX + $systemOffsetX;
|
||||
$systemPosY = $sourceSystem->posY + $systemOffsetY;
|
||||
}
|
||||
// if systems don´t already exists on map -> get "blank" systems
|
||||
// -> required for system type check (e.g. wormhole, k-space)
|
||||
if(
|
||||
!$sourceSystem &&
|
||||
$sourceSystemId
|
||||
){
|
||||
$sourceExists = false;
|
||||
$sourceSystem = $map->getNewSystem($sourceSystemId);
|
||||
}else{
|
||||
// system exists -> add target to the "right"
|
||||
$systemPosX = $sourceSystem->posX + $systemOffsetX;
|
||||
$systemPosY = $sourceSystem->posY + $systemOffsetY;
|
||||
}
|
||||
|
||||
if(
|
||||
!$sameSystem &&
|
||||
!$targetSystem
|
||||
){
|
||||
$targetExists = false;
|
||||
$targetSystem = $map->getNewSystem( $targetSystemId );
|
||||
}
|
||||
if(
|
||||
!$sameSystem &&
|
||||
!$targetSystem
|
||||
){
|
||||
$targetExists = false;
|
||||
$targetSystem = $map->getNewSystem( $targetSystemId );
|
||||
}
|
||||
|
||||
$addSourceSystem = false;
|
||||
$addTargetSystem = false;
|
||||
$addConnection = false;
|
||||
$addSourceSystem = false;
|
||||
$addTargetSystem = false;
|
||||
$addConnection = false;
|
||||
|
||||
switch($mapScope->name){
|
||||
case 'all':
|
||||
if($sameSystem){
|
||||
$addSourceSystem = true;
|
||||
}else{
|
||||
$addSourceSystem = true;
|
||||
$addTargetSystem = true;
|
||||
$addConnection = true;
|
||||
}
|
||||
break;
|
||||
case 'k-space':
|
||||
if($sameSystem){
|
||||
if( !$sourceSystem->isWormhole() ){
|
||||
switch($mapScope->name){
|
||||
case 'all':
|
||||
if($sameSystem){
|
||||
$addSourceSystem = true;
|
||||
}
|
||||
}elseif(
|
||||
!$sourceSystem->isWormhole() ||
|
||||
!$targetSystem->isWormhole()
|
||||
){
|
||||
$addSourceSystem = true;
|
||||
$addTargetSystem = true;
|
||||
$addConnection = true;
|
||||
}
|
||||
break;
|
||||
case 'wh':
|
||||
default:
|
||||
if($sameSystem){
|
||||
if( $sourceSystem->isWormhole() ){
|
||||
$addSourceSystem = true;
|
||||
}
|
||||
}elseif(
|
||||
$sourceSystem->isWormhole() ||
|
||||
$targetSystem->isWormhole()
|
||||
){
|
||||
$addSourceSystem = true;
|
||||
$addTargetSystem = true;
|
||||
$addConnection = true;
|
||||
}elseif(
|
||||
!$sourceSystem->isWormhole() &&
|
||||
!$targetSystem->isWormhole()
|
||||
){
|
||||
// check distance between systems (in jumps)
|
||||
// -> if > 1 it is !very likely! a wormhole
|
||||
$routeController = new Route();
|
||||
$routeController->initJumpData();
|
||||
$route = $routeController->findRoute($sourceSystem->name, $targetSystem->name, 1);
|
||||
|
||||
if( !$route['routePossible'] ){
|
||||
}else{
|
||||
$addSourceSystem = true;
|
||||
$addTargetSystem = true;
|
||||
$addConnection = true;
|
||||
}
|
||||
break;
|
||||
case 'k-space':
|
||||
if($sameSystem){
|
||||
if( !$sourceSystem->isWormhole() ){
|
||||
$addSourceSystem = true;
|
||||
}
|
||||
}elseif(
|
||||
!$sourceSystem->isWormhole() ||
|
||||
!$targetSystem->isWormhole()
|
||||
){
|
||||
$addSourceSystem = true;
|
||||
$addTargetSystem = true;
|
||||
$addConnection = true;
|
||||
}
|
||||
break;
|
||||
case 'wh':
|
||||
default:
|
||||
if($sameSystem){
|
||||
if( $sourceSystem->isWormhole() ){
|
||||
$addSourceSystem = true;
|
||||
}
|
||||
}elseif(
|
||||
$sourceSystem->isWormhole() ||
|
||||
$targetSystem->isWormhole()
|
||||
){
|
||||
$addSourceSystem = true;
|
||||
$addTargetSystem = true;
|
||||
$addConnection = true;
|
||||
}elseif(
|
||||
!$sourceSystem->isWormhole() &&
|
||||
!$targetSystem->isWormhole()
|
||||
){
|
||||
// check distance between systems (in jumps)
|
||||
// -> if > 1 it is !very likely! a wormhole
|
||||
$routeController = new Route();
|
||||
$routeController->initJumpData();
|
||||
$route = $routeController->findRoute($sourceSystem->name, $targetSystem->name, 1);
|
||||
|
||||
if( !$route['routePossible'] ){
|
||||
$addSourceSystem = true;
|
||||
$addTargetSystem = true;
|
||||
$addConnection = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// save source system -------------------------------------------------------------------------------------
|
||||
if(
|
||||
$addSourceSystem &&
|
||||
$sourceSystem &&
|
||||
!$sourceExists
|
||||
){
|
||||
$sourceSystem = $map->saveSystem($sourceSystem, $systemPosX, $systemPosY, $character);
|
||||
// get updated maps object
|
||||
if($sourceSystem){
|
||||
$map = $sourceSystem->mapId;
|
||||
$sourceExists = true;
|
||||
$clearMapDataCache = true;
|
||||
// increase system position (prevent overlapping)
|
||||
$systemPosX = $sourceSystem->posX + $systemOffsetX;
|
||||
$systemPosY = $sourceSystem->posY + $systemOffsetY;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// save source system -------------------------------------------------------------------------------------
|
||||
if(
|
||||
$addSourceSystem &&
|
||||
$sourceSystem &&
|
||||
!$sourceExists
|
||||
){
|
||||
$sourceSystem = $map->saveSystem($sourceSystem, $systemPosX, $systemPosY, $character);
|
||||
// get updated maps object
|
||||
if($sourceSystem){
|
||||
$map = $sourceSystem->mapId;
|
||||
$sourceExists = true;
|
||||
$clearMapDataCache = true;
|
||||
// increase system position (prevent overlapping)
|
||||
$systemPosX = $sourceSystem->posX + $systemOffsetX;
|
||||
$systemPosY = $sourceSystem->posY + $systemOffsetY;
|
||||
}
|
||||
}
|
||||
|
||||
// save target system -------------------------------------------------------------------------------------
|
||||
if(
|
||||
$addTargetSystem &&
|
||||
$targetSystem &&
|
||||
!$targetExists
|
||||
){
|
||||
$targetSystem = $map->saveSystem($targetSystem, $systemPosX, $systemPosY, $character);
|
||||
// get updated maps object
|
||||
if($targetSystem){
|
||||
$map = $targetSystem->mapId;
|
||||
$clearMapDataCache = true;
|
||||
$targetExists = true;
|
||||
// save target system -------------------------------------------------------------------------------------
|
||||
if(
|
||||
$addTargetSystem &&
|
||||
$targetSystem &&
|
||||
!$targetExists
|
||||
){
|
||||
$targetSystem = $map->saveSystem($targetSystem, $systemPosX, $systemPosY, $character);
|
||||
// get updated maps object
|
||||
if($targetSystem){
|
||||
$map = $targetSystem->mapId;
|
||||
$clearMapDataCache = true;
|
||||
$targetExists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// save connection ----------------------------------------------------------------------------------------
|
||||
if(
|
||||
$addConnection &&
|
||||
$sourceExists &&
|
||||
$targetExists &&
|
||||
$sourceSystem &&
|
||||
$targetSystem &&
|
||||
!$map->searchConnection( $sourceSystem, $targetSystem )
|
||||
){
|
||||
$connection = $map->getNewConnection($sourceSystem, $targetSystem);
|
||||
$connection = $map->saveConnection($connection);
|
||||
// get updated maps object
|
||||
if($connection){
|
||||
$map = $connection->mapId;
|
||||
$clearMapDataCache = true;
|
||||
// save connection ----------------------------------------------------------------------------------------
|
||||
if(
|
||||
$addConnection &&
|
||||
$sourceExists &&
|
||||
$targetExists &&
|
||||
$sourceSystem &&
|
||||
$targetSystem &&
|
||||
!$map->searchConnection( $sourceSystem, $targetSystem )
|
||||
){
|
||||
$connection = $map->getNewConnection($sourceSystem, $targetSystem);
|
||||
$connection = $map->saveConnection($connection);
|
||||
// get updated maps object
|
||||
if($connection){
|
||||
$map = $connection->mapId;
|
||||
$clearMapDataCache = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,8 +589,8 @@ class Route extends \Controller\AccessController {
|
||||
];
|
||||
|
||||
$returnRoutData = [
|
||||
'systemFrom' => $routeData['systemFrom'],
|
||||
'systemTo' => $routeData['systemTo'],
|
||||
'systemFromData' => $routeData['systemFromData'],
|
||||
'systemToData' => $routeData['systemToData'],
|
||||
'maps' => $mapData,
|
||||
'mapIds' => $mapIds
|
||||
];
|
||||
@@ -599,10 +599,14 @@ class Route extends \Controller\AccessController {
|
||||
$returnRoutData += $filterData;
|
||||
|
||||
if(count($mapIds) > 0){
|
||||
$systemFrom = $routeData['systemFromData']['name'];
|
||||
$systemTo = $routeData['systemToData']['name'];
|
||||
|
||||
|
||||
$cacheKey = $this->getRouteCacheKey(
|
||||
$mapIds,
|
||||
$routeData['systemFrom'],
|
||||
$routeData['systemTo'],
|
||||
$systemFrom,
|
||||
$systemTo,
|
||||
$filterData
|
||||
);
|
||||
|
||||
@@ -614,7 +618,7 @@ class Route extends \Controller\AccessController {
|
||||
$this->initJumpData($mapIds, $filterData);
|
||||
|
||||
// no cached route data found
|
||||
$foundRoutData = $this->findRoute($routeData['systemFrom'], $routeData['systemTo']);
|
||||
$foundRoutData = $this->findRoute($systemFrom, $systemTo);
|
||||
$returnRoutData = array_merge($returnRoutData, $foundRoutData);
|
||||
|
||||
// cache if route was found
|
||||
|
||||
@@ -28,7 +28,7 @@ class Signature extends Controller\AccessController{
|
||||
* -> return value of this is limited to a "SINGLE" system
|
||||
* @param \Base $f3
|
||||
*/
|
||||
public function getAll($f3){
|
||||
public function getAll(\Base $f3){
|
||||
$signatureData = [];
|
||||
$systemIds = (array)$f3->get('POST.systemIds');
|
||||
|
||||
@@ -60,12 +60,16 @@ class Signature extends Controller\AccessController{
|
||||
/**
|
||||
* save or update a full signature data set
|
||||
* or save/update just single or multiple signature data
|
||||
* @param $f3
|
||||
* @param \Base $f3
|
||||
*/
|
||||
public function save($f3){
|
||||
public function save(\Base $f3){
|
||||
$requestData = $f3->get('POST');
|
||||
|
||||
$signatureData = null;
|
||||
$systemId = (int)$requestData['systemId'];
|
||||
// delete all signatures that are not available in this request
|
||||
$deleteOldSignatures = (bool)$requestData['deleteOld'];
|
||||
|
||||
|
||||
$return = (object) [];
|
||||
$return->error = [];
|
||||
@@ -83,6 +87,8 @@ class Signature extends Controller\AccessController{
|
||||
$activeCharacter = $this->getCharacter();
|
||||
|
||||
if($activeCharacter){
|
||||
// signature ids that were updated/created
|
||||
$updatedSignatureIds = [];
|
||||
|
||||
/**
|
||||
* @var Model\SystemModel $system
|
||||
@@ -96,7 +102,7 @@ class Signature extends Controller\AccessController{
|
||||
|
||||
$system->getById( (int)$data['systemId']);
|
||||
|
||||
if(!$system->dry()){
|
||||
if( !$system->dry() ){
|
||||
// update/save signature
|
||||
|
||||
/**
|
||||
@@ -156,6 +162,14 @@ class Signature extends Controller\AccessController{
|
||||
unset( $data['typeId'] );
|
||||
}
|
||||
|
||||
// "sig reader" should not overwrite signature group information
|
||||
if(
|
||||
$data['groupId'] == 0 &&
|
||||
$signature->groupId > 0
|
||||
){
|
||||
unset($data['groupId']);
|
||||
}
|
||||
|
||||
$newData = $data;
|
||||
}
|
||||
|
||||
@@ -167,6 +181,7 @@ class Signature extends Controller\AccessController{
|
||||
}
|
||||
|
||||
$signature->save();
|
||||
$updatedSignatureIds[] = $signature->id;
|
||||
|
||||
// get a fresh signature object with the new data. This is a bad work around!
|
||||
// but i could not figure out what the problem was when using the signature model, saved above :(
|
||||
@@ -184,6 +199,28 @@ class Signature extends Controller\AccessController{
|
||||
|
||||
$system->reset();
|
||||
}
|
||||
|
||||
// delete "old" signatures ------------------------------------------------------------------
|
||||
if(
|
||||
$deleteOldSignatures &&
|
||||
$systemId
|
||||
){
|
||||
$system->getById($systemId);
|
||||
if(
|
||||
!$system->dry() &&
|
||||
$system->hasAccess($activeCharacter)
|
||||
){
|
||||
$allSignatures = $system->getSignatures();
|
||||
foreach($allSignatures as $tempSignature){
|
||||
if( !in_array($tempSignature->id, $updatedSignatureIds)){
|
||||
$tempSignature->delete( $activeCharacter );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +231,7 @@ class Signature extends Controller\AccessController{
|
||||
* delete signatures
|
||||
* @param \Base $f3
|
||||
*/
|
||||
public function delete($f3){
|
||||
public function delete(\Base $f3){
|
||||
$signatureIds = $f3->get('POST.signatureIds');
|
||||
$activeCharacter = $this->getCharacter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user