- added new "select connection" feature to map - ctrl + click for multiselect, closed #174 - added new "wormhole type" table to "Jump info" dialog, closed #174 - added new re-order drag&drop feature for pannels, #470 closed #234 - fixed PHP-Doc comments - added @throw statements - fixed some Javascript memory leaks with infinite counters - updated "Peity jQuery plugin" `3.2.0` -> `3.2.1`
This commit is contained in:
@@ -17,6 +17,7 @@ class Access extends Controller\AccessController {
|
||||
* search character/corporation or alliance by name
|
||||
* @param \Base $f3
|
||||
* @param $params
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function search($f3, $params){
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class Connection extends Controller\AccessController {
|
||||
* save a new connection or updates an existing (drag/drop) between two systems
|
||||
* if a connection is changed (drag&drop) to another system. -> this function is called for update
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function save(\Base $f3){
|
||||
$postData = (array)$f3->get('POST');
|
||||
|
||||
@@ -21,6 +21,7 @@ class GitHub extends Controller\Controller {
|
||||
/**
|
||||
* get HTTP request options for API (curl) request
|
||||
* @return array
|
||||
* @throws \Exception\PathfinderException
|
||||
*/
|
||||
protected function getRequestOptions(){
|
||||
$requestOptions = [
|
||||
@@ -36,6 +37,7 @@ class GitHub extends Controller\Controller {
|
||||
/**
|
||||
* get release information from GitHub
|
||||
* @param $f3
|
||||
* @throws \Exception\PathfinderException
|
||||
*/
|
||||
public function releases($f3){
|
||||
$cacheKey = 'CACHE_GITHUB_RELEASES';
|
||||
|
||||
@@ -71,6 +71,8 @@ class Map extends Controller\AccessController {
|
||||
/**
|
||||
* Get all required static config data for program initialization
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
* @throws Exception\PathfinderException
|
||||
*/
|
||||
public function init(\Base $f3){
|
||||
// expire time in seconds
|
||||
@@ -159,6 +161,15 @@ class Map extends Controller\AccessController {
|
||||
}
|
||||
$return->connectionScopes = $connectionScopeData;
|
||||
|
||||
// get available wormhole types ---------------------------------------------------------------------------
|
||||
$wormholes = Model\BasicModel::getNew('WormholeModel');
|
||||
$rows = $wormholes->find('id > 0', null, $expireTimeSQL);
|
||||
$wormholesData = [];
|
||||
foreach((array)$rows as $rowData){
|
||||
$wormholesData[$rowData->name] = $rowData->getData();
|
||||
}
|
||||
$return->wormholes = $wormholesData;
|
||||
|
||||
// get available character status -------------------------------------------------------------------------
|
||||
$characterStatus = Model\BasicModel::getNew('CharacterStatusModel');
|
||||
$rows = $characterStatus->find('active = 1', null, $expireTimeSQL);
|
||||
@@ -223,6 +234,7 @@ class Map extends Controller\AccessController {
|
||||
/**
|
||||
* import new map data
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
*/
|
||||
public function import(\Base $f3){
|
||||
$importData = (array)$f3->get('POST');
|
||||
@@ -367,6 +379,7 @@ class Map extends Controller\AccessController {
|
||||
/**
|
||||
* save a new map or update an existing map
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
*/
|
||||
public function save(\Base $f3){
|
||||
$formData = (array)$f3->get('POST.formData');
|
||||
@@ -563,6 +576,7 @@ class Map extends Controller\AccessController {
|
||||
/**
|
||||
* delete a map and all dependencies
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete(\Base $f3){
|
||||
$mapData = (array)$f3->get('POST.mapData');
|
||||
@@ -597,6 +611,9 @@ class Map extends Controller\AccessController {
|
||||
* -> if characters with map access found -> broadcast mapData to them
|
||||
* @param Model\MapModel $map
|
||||
* @param array $characterIds
|
||||
* @throws Exception
|
||||
* @throws Exception\PathfinderException
|
||||
* @throws \ZMQSocketException
|
||||
*/
|
||||
protected function broadcastMapAccess($map, $characterIds){
|
||||
$mapAccess = [
|
||||
@@ -614,6 +631,7 @@ class Map extends Controller\AccessController {
|
||||
* broadcast map delete information to clients
|
||||
* @param int $mapId
|
||||
* @return bool|string
|
||||
* @throws \ZMQSocketException
|
||||
*/
|
||||
protected function broadcastMapDeleted($mapId){
|
||||
return (new Socket( Config::getSocketUri() ))->sendData('mapDeleted', $mapId);
|
||||
@@ -623,6 +641,7 @@ class Map extends Controller\AccessController {
|
||||
* get map access tokens for current character
|
||||
* -> send access tokens via TCP Socket for WebSocket auth
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getAccessData(\Base $f3){
|
||||
$return = (object) [];
|
||||
@@ -656,6 +675,8 @@ class Map extends Controller\AccessController {
|
||||
* update map data
|
||||
* -> function is called continuously (trigger) by any active client
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
* @throws Exception\PathfinderException
|
||||
*/
|
||||
public function updateData(\Base $f3){
|
||||
$mapData = (array)$f3->get('POST.mapData');
|
||||
@@ -805,6 +826,8 @@ class Map extends Controller\AccessController {
|
||||
* get formatted map data
|
||||
* @param Model\MapModel[] $mapModels
|
||||
* @return array
|
||||
* @throws Exception
|
||||
* @throws Exception\PathfinderException
|
||||
*/
|
||||
protected function getFormattedMapsData($mapModels){
|
||||
$mapData = [];
|
||||
@@ -819,6 +842,8 @@ class Map extends Controller\AccessController {
|
||||
* update map data api
|
||||
* -> function is called continuously by any active client
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
* @throws Exception\PathfinderException
|
||||
*/
|
||||
public function updateUserData(\Base $f3){
|
||||
$return = (object) [];
|
||||
@@ -896,6 +921,7 @@ class Map extends Controller\AccessController {
|
||||
* @param Model\CharacterModel $character
|
||||
* @param Model\MapModel $map
|
||||
* @return Model\MapModel
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function updateMapData(Model\CharacterModel $character, Model\MapModel $map){
|
||||
|
||||
@@ -1056,21 +1082,34 @@ class Map extends Controller\AccessController {
|
||||
}
|
||||
}
|
||||
|
||||
// save connection ------------------------------------------------------------------------------------
|
||||
if(
|
||||
$addConnection &&
|
||||
$sourceExists &&
|
||||
$targetExists &&
|
||||
$sourceSystem &&
|
||||
$targetSystem &&
|
||||
!$map->searchConnection( $sourceSystem, $targetSystem )
|
||||
$targetSystem
|
||||
){
|
||||
$connection = $map->getNewConnection($sourceSystem, $targetSystem);
|
||||
$connection = $map->saveConnection($connection, $character);
|
||||
// get updated maps object
|
||||
if($connection){
|
||||
$map = $connection->mapId;
|
||||
$mapDataChanged = true;
|
||||
$connection = $map->searchConnection( $sourceSystem, $targetSystem);
|
||||
|
||||
// save connection --------------------------------------------------------------------------------
|
||||
if(
|
||||
$addConnection &&
|
||||
!$connection
|
||||
){
|
||||
$connection = $map->getNewConnection($sourceSystem, $targetSystem);
|
||||
$connection = $map->saveConnection($connection, $character);
|
||||
// get updated maps object
|
||||
if($connection){
|
||||
$map = $connection->mapId;
|
||||
$mapDataChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
// log jump mass ----------------------------------------------------------------------------------
|
||||
if(
|
||||
$connection &&
|
||||
$connection->isWormhole()
|
||||
){
|
||||
$connection->logMass($log);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1087,9 +1126,13 @@ class Map extends Controller\AccessController {
|
||||
/**
|
||||
* get connectionData
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getConnectionData (\Base $f3){
|
||||
$postData = (array)$f3->get('POST');
|
||||
|
||||
$addData = (array)$postData['addData'];
|
||||
$filterData = (array)$postData['filterData'];
|
||||
$connectionData = [];
|
||||
|
||||
if($mapId = (int)$postData['mapId']){
|
||||
@@ -1102,13 +1145,27 @@ class Map extends Controller\AccessController {
|
||||
$map->getById($mapId);
|
||||
|
||||
if($map->hasAccess($activeCharacter)){
|
||||
$connections = $map->getConnections('wh');
|
||||
foreach($connections as $connection){
|
||||
$data = $connection->getData(true);
|
||||
// skip connections whiteout signature data
|
||||
if($data->signatures){
|
||||
$connectionData[] = $data;
|
||||
// get specific connections by id
|
||||
$connectionIds = null;
|
||||
if(is_array($postData['connectionIds'])){
|
||||
$connectionIds = $postData['connectionIds'];
|
||||
}
|
||||
|
||||
$connections = $map->getConnections($connectionIds, 'wh');
|
||||
foreach($connections as $connection){
|
||||
$check = true;
|
||||
$data = $connection->getData(in_array('signatures', $addData), in_array('logs', $addData));
|
||||
// filter result
|
||||
if(in_array('signatures', $filterData) && !$data->signatures){
|
||||
$check = false;
|
||||
}
|
||||
|
||||
if(in_array('logs', $filterData) && !$data->logs){
|
||||
$check = false;
|
||||
}
|
||||
|
||||
if($check){
|
||||
$connectionData[] = $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1120,6 +1177,8 @@ class Map extends Controller\AccessController {
|
||||
/**
|
||||
* get map log data
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
* @throws Exception\PathfinderException
|
||||
*/
|
||||
public function getLogData(\Base $f3){
|
||||
$postData = (array)$f3->get('POST');
|
||||
|
||||
@@ -509,6 +509,8 @@ class Route extends Controller\AccessController {
|
||||
/**
|
||||
* search multiple route between two systems
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
* @throws \Exception\PathfinderException
|
||||
*/
|
||||
public function search($f3){
|
||||
$requestData = (array)$f3->get('POST');
|
||||
|
||||
@@ -18,6 +18,7 @@ class Signature extends Controller\AccessController {
|
||||
* get signature data for systems
|
||||
* -> return value of this is limited to a "SINGLE" system
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getAll(\Base $f3){
|
||||
$signatureData = [];
|
||||
@@ -50,6 +51,7 @@ class Signature extends Controller\AccessController {
|
||||
* save or update a full signature data set
|
||||
* or save/update just single or multiple signature data
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function save(\Base $f3){
|
||||
$requestData = $f3->get('POST');
|
||||
@@ -221,6 +223,7 @@ class Signature extends Controller\AccessController {
|
||||
/**
|
||||
* delete signatures
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function delete(\Base $f3){
|
||||
$signatureIds = $f3->get('POST.signatureIds');
|
||||
|
||||
@@ -123,6 +123,7 @@ class Statistic extends Controller\AccessController {
|
||||
* @param int $yearEnd
|
||||
* @param int $weekEnd
|
||||
* @return array
|
||||
* @throws \Exception\PathfinderException
|
||||
*/
|
||||
protected function queryStatistic( CharacterModel $character, $typeId, $yearStart, $weekStart, $yearEnd, $weekEnd){
|
||||
$data = [];
|
||||
@@ -231,6 +232,7 @@ class Statistic extends Controller\AccessController {
|
||||
/**
|
||||
* get statistics data
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getData(\Base $f3){
|
||||
$postData = (array)$f3->get('POST');
|
||||
|
||||
@@ -175,6 +175,7 @@ class System extends Controller\AccessController {
|
||||
/**
|
||||
* save a new system to a a map
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function save(\Base $f3){
|
||||
$postData = (array)$f3->get('POST');
|
||||
@@ -278,6 +279,7 @@ class System extends Controller\AccessController {
|
||||
* get system log data from CCP API import
|
||||
* system Kills, Jumps,....
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function graphData(\Base $f3){
|
||||
$graphData = [];
|
||||
@@ -329,6 +331,8 @@ class System extends Controller\AccessController {
|
||||
* get system data for all systems within a constellation
|
||||
* @param \Base $f3
|
||||
* @param array $params
|
||||
* @throws \Exception
|
||||
* @throws \Exception\PathfinderException
|
||||
*/
|
||||
public function constellationData(\Base $f3, $params){
|
||||
$return = (object) [];
|
||||
@@ -363,6 +367,7 @@ class System extends Controller\AccessController {
|
||||
/**
|
||||
* set destination for specific systemIds
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function setDestination(\Base $f3){
|
||||
$postData = (array)$f3->get('POST');
|
||||
@@ -405,6 +410,8 @@ class System extends Controller\AccessController {
|
||||
/**
|
||||
* send Rally Point poke
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
* @throws \Exception\PathfinderException
|
||||
*/
|
||||
public function pokeRally(\Base $f3){
|
||||
$rallyData = (array)$f3->get('POST');
|
||||
@@ -437,6 +444,7 @@ class System extends Controller\AccessController {
|
||||
* delete systems and all its connections from map
|
||||
* -> set "active" flag
|
||||
* @param \Base $f3
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function delete(\Base $f3){
|
||||
$mapId = (int)$f3->get('POST.mapId');
|
||||
|
||||
@@ -44,6 +44,7 @@ class User extends Controller\Controller{
|
||||
* @param Model\CharacterModel $characterModel
|
||||
* @param string $browserTabId
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function loginByCharacter(Model\CharacterModel &$characterModel, string $browserTabId){
|
||||
$login = false;
|
||||
@@ -108,6 +109,8 @@ class User extends Controller\Controller{
|
||||
* validate cookie character information
|
||||
* -> return character data (if valid)
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
* @throws Exception\PathfinderException
|
||||
*/
|
||||
public function getCookieCharacter(\Base $f3){
|
||||
$data = $f3->get('POST');
|
||||
@@ -188,6 +191,7 @@ class User extends Controller\Controller{
|
||||
/**
|
||||
* delete the character log entry for the current active (main) character
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
*/
|
||||
public function deleteLog(\Base $f3){
|
||||
if($activeCharacter = $this->getCharacter()){
|
||||
@@ -198,6 +202,8 @@ class User extends Controller\Controller{
|
||||
/**
|
||||
* log the current user out + clear character system log data
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
* @throws \ZMQSocketException
|
||||
*/
|
||||
public function logout(\Base $f3){
|
||||
$this->logoutCharacter(false, true, true, true);
|
||||
@@ -211,6 +217,7 @@ class User extends Controller\Controller{
|
||||
* remote open ingame information window (character, corporation or alliance) Id
|
||||
* -> the type is auto-recognized by CCP
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
*/
|
||||
public function openIngameWindow(\Base $f3){
|
||||
$data = $f3->get('POST');
|
||||
@@ -241,6 +248,7 @@ class User extends Controller\Controller{
|
||||
* -> a fresh user automatically generated on first login with a new character
|
||||
* -> see SSO login
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
*/
|
||||
public function saveAccount(\Base $f3){
|
||||
$data = $f3->get('POST');
|
||||
@@ -361,6 +369,8 @@ class User extends Controller\Controller{
|
||||
/**
|
||||
* delete current user account from DB
|
||||
* @param \Base $f3
|
||||
* @throws Exception
|
||||
* @throws \ZMQSocketException
|
||||
*/
|
||||
public function deleteAccount(\Base $f3){
|
||||
$data = $f3->get('POST.formData');
|
||||
|
||||
Reference in New Issue
Block a user