Skip to content

Commit

Permalink
Merge pull request #77 from exodus4d/develop
Browse files Browse the repository at this point in the history
v0.0.16
  • Loading branch information
exodus4d committed Nov 19, 2015
2 parents 1f19783 + 0408756 commit 3047137
Show file tree
Hide file tree
Showing 61 changed files with 496 additions and 211 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Mapping tool for [*EVE ONLINE*](https://www.eveonline.com)

- Project [https://www.pathfinder.exodus4d.de](https://www.pathfinder.exodus4d.de)
- Community [google +](https://plus.google.com/u/0/b/110257318165279088853/110257318165279088853)
- Official Forum post [https://forums.eveonline.com](https://forums.eveonline.com/default.aspx?g=posts&m=6021776#post6021776)
- Screenshots [imgur.com](http://imgur.com/a/k2aVa)
- Media [youtube.com](https://www.youtube.com/channel/UC7HU7XEoMbqRwqxDTbMjSPg)
- Video [youtube.com](https://www.youtube.com/channel/UC7HU7XEoMbqRwqxDTbMjSPg)
- Community [google +](https://plus.google.com/u/0/b/110257318165279088853/110257318165279088853)
- Licence [MIT](http://opensource.org/licenses/MIT)

##### IMPORTANT Information
Expand All @@ -23,10 +24,6 @@ If you are looking for installation help, please check the [wiki](https://github
|-- cron.ini --> config cronjobs
|-- pathfinder.ini --> config pathfinder
|-- routes.ini --> config routes
|-- (0755) build_js --> JS build folder and source maps (minified, uglified)
|-- app --> "PATHFINDER" core files
|-- lib --> 3rd partie extension/library
|-- build.txt --> generated build summary
|-- (0755) js --> JS source files (raw)
|-- app --> "PASTHFINDER" core files (not used for production )
|-- lib --> 3rd partie extension/library (not used for production )
Expand All @@ -39,7 +36,7 @@ If you are looking for installation help, please check the [wiki](https://github
|-- css --> CSS dist/build folder (minified)
|-- fonts --> (icon)-Fonts
|-- img --> images
|-- js --> JS dist/build folder
|-- js --> JS dist/build folder and source maps (minified, uglified)
|-- templates --> templates
|-- sass --> SCSS source (not used for production )
|-- ...
Expand Down
23 changes: 16 additions & 7 deletions app/main/controller/api/signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@ public function save($f3){
$user = $this->_getUser();

if($user){
$activeCharacter = $user->getActiveUserCharacter();
$activeUserCharacter = $user->getActiveUserCharacter();
$activeCharacter = $activeUserCharacter->getCharacter();
$system = Model\BasicModel::getNew('SystemModel');

// update/add all submitted signatures
foreach($signatureData as $data){
// this key should not be saved (it is an obj)
unset($data['updated']);

$system->getById( (int)$data['systemId']);

if(!$system->dry()){
Expand All @@ -99,12 +103,11 @@ public function save($f3){
$signature = Model\BasicModel::getNew('SystemSignatureModel');
}

$signature->updatedCharacterId = $activeCharacter->getCharacter();

if($signature->dry()){
// new signature
$signature->systemId = $system;
$signature->createdCharacterId = $activeCharacter->getCharacter();
$signature->updatedCharacterId = $activeCharacter;
$signature->createdCharacterId = $activeCharacter;
$signature->setData($data);
}else{
// update signature
Expand All @@ -126,21 +129,27 @@ public function save($f3){
}else{
// update complete signature (signature reader dialog)

// systemId should not be updated
unset( $data['systemId'] );

// description should not be updated
unset( $data['description'] );

// wormhole typeID can´t figured out/saved by the sig reader dialog
// wormhole typeID can not figured out/saved by the sig reader dialog
if($data['groupId'] == 5){
unset( $data['typeId'] );
}

$newData = $data;
}

$signature->setData($newData);
if( $signature->hasChanged($newData) ){
// Character should only be changed if something else has changed
$signature->updatedCharacterId = $activeCharacter;
$signature->setData($newData);
}
}


$signature->save();

// get a fresh signature object with the new data. This is a bad work around!
Expand Down
27 changes: 23 additions & 4 deletions app/main/data/mapper/ccpsystemsmapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,36 @@ public function getData(){
$iterator['security'] == 8 ||
$iterator['security'] == 9
){
// k-space system
$trueSec = round($iterator['trueSec'], 3);

if($trueSec <= 0){
$security = '0.0';
}elseif($trueSec < 0.5){
$security = 'L';
}else{
$security = 'H';
// more precise rounding required for "low sec" and "high sec" distinction
$trueSec = round($trueSec, 1);

if($trueSec < 0.5){
$security = 'L';
}else{
$security = 'H';
}
}
}else{
}elseif(
$iterator['security'] == 1 ||
$iterator['security'] == 2 ||
$iterator['security'] == 3 ||
$iterator['security'] == 4 ||
$iterator['security'] == 5 ||
$iterator['security'] == 6
){
// standard wormhole system
$security = 'C' . $iterator['security'];
}elseif(
$iterator['security'] == 13
){
// shattered wormhole system
$security = 'SH';
}

return $security;
Expand Down
4 changes: 2 additions & 2 deletions app/main/model/systemmodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ protected function getStaticWormholeData(){

// check if this system is a wormhole
if($this->isWormhole()){
$systemStaticModel = self::getNew('SystemStaticModel');
$systemStatics = $systemStaticModel->find([
$systemWormholeModel = self::getNew('SystemWormholeModel');
$systemStatics = $systemWormholeModel->find([
'constellationId = :constellationId',
':constellationId' => $this->constellationId
]);
Expand Down
23 changes: 22 additions & 1 deletion app/main/model/systemsignaturemodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,33 @@ public function getData(){
'character' => $this->updatedCharacterId->getData(),
'updated' => strtotime($this->updated)
]

];

return $signatureData;
}

/**
* compares a new data set (array) with the current values
* and checks if something has changed
* @param $signatureData
* @return bool
*/
public function hasChanged($signatureData){
$hasChanged = false;

foreach((array)$signatureData as $key => $value){
if(
$this->exists($key) &&
$this->$key != $value
){
$hasChanged = true;
break;
}
}

return $hasChanged;
}

/**
* check object for model access
* @param $accessObject
Expand Down
28 changes: 0 additions & 28 deletions app/main/model/systemstaticmodel.php

This file was deleted.

32 changes: 32 additions & 0 deletions app/main/model/systemwormholemodel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Created by PhpStorm.
* User: exodus4d
* Date: 07.06.15
* Time: 18:16
*/

namespace Model;


class SystemWormholeModel extends BasicModel {

protected $table = 'system_wormhole';

protected $fieldConf = [
'wormholeId' => [
'belongs-to-one' => 'Model\WormholeModel'
]
];

/**
* get wormhole data as object
* @return object
*/
public function getData(){

$systemWormholeData = $this->wormholeId->getData();

return $systemWormholeData;
}
}
4 changes: 2 additions & 2 deletions app/main/model/usermodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class UserModel extends BasicModel {
protected $table = 'user';

protected $fieldConf = [
'lastLogin' => array(
'lastLogin' => [
'type' => Schema::DT_TIMESTAMP
),
],
'apis' => [
'has-many' => ['Model\UserApiModel', 'userId']
],
Expand Down
60 changes: 60 additions & 0 deletions app/main/model/wormholemodel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Exodus
* Date: 14.11.2015
* Time: 22:21
*/

namespace Model;

class WormholeModel extends BasicModel {

protected $table = 'wormhole';

/**
* format mass values
* - no decimal separator
* - char '.' for thousands separator
* @param $value
* @return string
*/
static function formatMassValue($value){
return number_format( $value, 0, '', '.' );
}

/**
* get wormhole data as object
* @return object
*/
public function getData(){

$systemStaticData = (object) [];
$systemStaticData->name = $this->name;
$systemStaticData->security = $this->security;

// total (max) available wormhole mass
$systemStaticData->massTotal = (object) [];
$systemStaticData->massTotal->value = $this->massTotal;
$systemStaticData->massTotal->format = self::formatMassValue($this->massTotal) . ' Kg';

// individual jump mass (max) per jump
$systemStaticData->massIndividual = (object) [];
$systemStaticData->massIndividual->value = $this->massIndividual;
$systemStaticData->massIndividual->format = self::formatMassValue($this->massIndividual) . ' Kg';

// lifetime (max) for this wormhole
$systemStaticData->maxStableTime = (object) [];
$systemStaticData->maxStableTime->value = $this->maxStableTime;
$systemStaticData->maxStableTime->format = $this->maxStableTime . ' h';

// mass regeneration value per day
if($this->massRegeneration > 0){
$systemStaticData->massRegeneration = (object) [];
$systemStaticData->massRegeneration->value = $this->massRegeneration;
$systemStaticData->massRegeneration->format = self::formatMassValue($this->massRegeneration) . ' Kg/day';
}

return $systemStaticData;
}
}
2 changes: 1 addition & 1 deletion app/pathfinder.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[PATHFINDER]
NAME = "PATHFINDER"
; installed version (used for CSS/JS cache busting)
VERSION = "v0.0.15"
VERSION = "v0.0.16"
; contact information (DO NOT CHANGE)
CONTACT = "https://github.com/exodus4d"
; source code (DO NOT CHANGE)
Expand Down
36 changes: 36 additions & 0 deletions js/app/config/signature_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,42 @@ define([], function() {
7: { // Ghost
1: 'Superior Blood Raider Covert Research Facility' //*
}
},
13: { // Shattered Wormholes
5: { // Wormhole (some of them are static)
1: 'P060 - C1',
2: 'Z647 - C1',
3: 'D382 - C2',
4: 'L005 - C2',
5: 'N766 - C2',
6: 'C247 - C3',
7: 'K346 - C3',
8: 'M267 - C3',
9: 'O477 - C3',
10: 'X877 - C4',
11: 'Y683 - C4',
12: 'H296 - C5',
13: 'H900 - C5',
14: 'H296 - C5',
15: 'N062 - C5',
16: 'V911 - C5',
17: 'U574 - C6',
18: 'V753 - C6',
19: 'W237 - C6',
20: 'B274 - HS',
21: 'D792 - HS',
22: 'D845 - HS',
23: 'N110 - HS',
24: 'A239 - LS',
25: 'C391 - LS',
26: 'J244 - LS',
27: 'U201 - LS',
28: 'U210 - LS',
29: 'C248 - NS',
30: 'E545 - NS',
31: 'K346 - NS',
32: 'Z060 - NS'
}
}
}, // system type (k-space)
2: {
Expand Down
13 changes: 13 additions & 0 deletions js/app/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ define(['jquery'], function($) {
security: {
class: 'pf-system-sec'
},
'SH': {
class: 'pf-system-sec-unknown'
},
'H': {
class: 'pf-system-sec-highSec'
},
Expand Down Expand Up @@ -352,6 +355,16 @@ define(['jquery'], function($) {
1: 'E004 - C1',
2: 'Z006 - C3',
5: 'Q003 - 0.0'
},
13: { // Shattered Wormholes (some of them are static)
1: 'E004 - C1',
2: 'L005 - C2',
3: 'Z006 - C3',
4: 'M001 - C4',
5: 'C008 - C5',
6: 'G008 - C6',
7: 'Q003 - C7'

}
},
// incoming wormholes
Expand Down
Loading

0 comments on commit 3047137

Please sign in to comment.