* 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:
Mark Friedrich
2016-07-05 20:44:12 +02:00
committed by GitHub
parent e6cd694df6
commit e01f299d2b
120 changed files with 1547 additions and 807 deletions

View File

@@ -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;
}
}
}
}