Skip to content

Commit

Permalink
Merge pull request #5 from exodus4d/develop
Browse files Browse the repository at this point in the history
OGB fixes
  • Loading branch information
exodus4d committed Sep 1, 2015
2 parents ed9edd8 + ae60b41 commit 2fe5fde
Show file tree
Hide file tree
Showing 16 changed files with 247 additions and 118 deletions.
2 changes: 1 addition & 1 deletion app/main/controller/api/map.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ public function updateUserData($f3){
if( !is_null($map) ){
$return->mapUserData[] = $map->getUserData();


// request signature data for a system if user has map access!
if( $map->id === $requestSystemData->mapId ){
$system = $map->getSystem( $requestSystemData->systemId );
Expand All @@ -558,6 +557,7 @@ public function updateUserData($f3){
// get current user data -> this should not be cached because each user has different personal data
// even if they have multiple characters using the same map!
$return->userData = $user->getData();

}else{
// user logged off
$return->error[] = $this->getUserLoggedOffError();
Expand Down
9 changes: 6 additions & 3 deletions app/main/controller/mailcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ public function __construct(){
*/
public function sendRegistrationKey($to, $msg){

$this->set('To', '"<' . $to . '>');
$this->set('From', '"PATHFINDER" <' . Controller::getEnvironmentData('SMTP_FROM') . '>');
$this->set('Subject', 'PATHFINDERR - Registration Key');
$this->set('To', '<' . $to . '>');
$this->set('From', 'Pathfinder <' . Controller::getEnvironmentData('SMTP_FROM') . '>');
$this->set('Subject', 'Registration Key');
$this->set('Error-To', '<' . Controller::getEnvironmentData('SMTP_ERROR') . '>');
$this->set('MIME-Version', '1.0');
$this->set('Content-Type', 'text/html; charset=ISO-8859-1');
$status = $this->send($msg);

return $status;
Expand Down
30 changes: 27 additions & 3 deletions app/main/model/usermodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getData(){
// set active character with log data
$activeUserCharacter = $this->getActiveUserCharacter();
if($activeUserCharacter){
$userData->character = $activeUserCharacter->getData();
$userData->character = $activeUserCharacter->getData(true);
}

return $userData;
Expand Down Expand Up @@ -450,11 +450,35 @@ public function updateCharacterLog($ttl = 0){
if( $character->dry() ){
// this can happen if a valid user plays the game with a not registered character
// whose API is not registered -> save new character or update character data
$corporationId = array_key_exists('corpid', $apiController->values) ? $apiController->values['corpid'] : null;
$allianceId = array_key_exists('allianceid', $apiController->values) ? $apiController->values['allianceid'] : null;

// check if corp exists
if( !is_null($corporationId) ){
$corporation = self::getNew('CorporationModel');
$corporation->getById( (int)$corporationId );
if( $corporation->dry() ){
$corporation->id = $corporationId;
$corporation->name = $apiController->values['corpname'];
$corporation->save();
}
}

// check if ally exists
if( !is_null($allianceId) ){
$alliance = self::getNew('AllianceModel');
$alliance->getById( (int)$allianceId );
if( $alliance->dry() ){
$alliance->id = $allianceId;
$alliance->name = $apiController->values['alliancename'];
$alliance->save();
}
}

$character->id = (int) $apiController->values['charid'];
$character->name = $apiController->values['charname'];
$character->corporationId = array_key_exists('corpid', $apiController->values) ? $apiController->values['corpid'] : null;
$character->allianceId = array_key_exists('allianceid', $apiController->values) ? $apiController->values['allianceid'] : null;
$character->corporationId = $corporationId;
$character->allianceId = $allianceId;
$character->save();
}

Expand Down
20 changes: 10 additions & 10 deletions build_js/app/landingpage.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build_js/app/landingpage.js.map

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions build_js/app/mappage.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build_js/app/mappage.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build_js/build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ app/config/system_effect.js
app/config/signature_type.js
lib/bootstrap.min.js
lib/bootbox.min.js
app/ccp.js
lib/velocity.min.js
lib/velocity.ui.min.js
lib/jquery.mCustomScrollbar.concat.min.js
Expand All @@ -20,7 +21,6 @@ app/util.js
lib/mustache.min.js
app/render.js
app/logging.js
app/ccp.js
lib/requirejs/text.js
text!img/logo.svg!strip
text!templates/modules/header.html
Expand Down Expand Up @@ -68,6 +68,7 @@ app/config/system_effect.js
app/config/signature_type.js
lib/bootstrap.min.js
lib/bootbox.min.js
app/ccp.js
lib/velocity.min.js
lib/velocity.ui.min.js
lib/jquery.mCustomScrollbar.concat.min.js
Expand All @@ -80,7 +81,6 @@ lib/bootstrap2-toggle.min.js
app/util.js
lib/mustache.min.js
app/render.js
app/ccp.js
lib/blueimp-helper.js
lib/blueimp-gallery.js
lib/EasePack.min.js
Expand Down
14 changes: 10 additions & 4 deletions js/app/map/contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ define([

$.fn.contextMenu = function (settings) {

// animation
var animationInType = CCP.isInGameBrowser() ? 'fadeIn' : 'transition.flipXIn';
var animationInDuration = CCP.isInGameBrowser() ? 0 : 150;
var animationOutType = CCP.isInGameBrowser() ? 'fadeOut' : 'transition.flipXOut';
var animationOutDuration = CCP.isInGameBrowser() ? 0 : 150;

return this.each(function () {

// Open context menu
Expand Down Expand Up @@ -44,8 +50,8 @@ define([
position: 'absolute',
left: getLeftLocation(originalEvent),
top: getTopLocation(originalEvent)
}).velocity('transition.flipXIn', {
duration: CCP.isInGameBrowser() ? 0 : 150,
}).velocity(animationInType, {
duration: animationInDuration,
complete: function(){
// set context menu "click" observer
$(this).off('click').one('click', {component: component, position:{x: getLeftLocation(originalEvent), y: getTopLocation(originalEvent)}}, function (e) {
Expand All @@ -66,8 +72,8 @@ define([

//make sure menu closes on any click
$(document).one('click.closeContextmenu', function () {
$('.dropdown-menu[role="menu"]').velocity('transition.flipXOut', {
duration: CCP.isInGameBrowser() ? 0 : 150
$('.dropdown-menu[role="menu"]').velocity(animationOutType, {
duration: animationOutDuration
});
});

Expand Down
68 changes: 33 additions & 35 deletions js/app/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -2926,8 +2926,8 @@ define([
userCount: 0 // active user in a map
};

// check if user is currently in "this" system
var currentUserIsHere = false;
// check if current user was found on the map
var currentUserOnMap = false;

// get all systems
var systems = mapElement.find('.' + config.systemClass);
Expand All @@ -2941,6 +2941,9 @@ define([

var tempUserData = null;

// check if user is currently in "this" system
var currentUserIsHere = false;

var j = userData.data.systems.length;

// search backwards to avoid decrement the counter after splice()
Expand All @@ -2960,14 +2963,16 @@ define([
}

// the current user can only be in a single system -------------------------------------------------------
if( !currentUserIsHere){
if( !currentUserOnMap){

if(
currentCharacterLog &&
currentCharacterLog.system &&
currentCharacterLog.system.id === systemId
){
currentUserIsHere = true;
currentUserOnMap = true;

// set current location data for header update
headerUpdateData.currentSystemId = $(system).data('id');
headerUpdateData.currentSystemName = currentCharacterLog.system.name;
Expand Down Expand Up @@ -3008,50 +3013,43 @@ define([
// current user was not found on any map system -> add new system to map where the user is in ----------------
// this is restricted to IGB-usage! CharacterLog data is always set through the IGB
// ->this prevent adding the same system multiple times, if a user if online with the IGB AND OOG

if(
CCP.isInGameBrowser() === true &&
currentUserIsHere === false &&
currentUserOnMap === false &&
currentCharacterLog &&
mapTracking
){

// check if the system where the character is in exists on this map
if(currentUserIsHere === false){
// add new system to the map

var requestData = {
systemData: {
systemId: currentCharacterLog.system.id
},
mapData: {
id: userData.config.id
}
};


// check if a system jump is detected previous system !== current system
// and add a connection to the previous system as well
// hint: if a user just logged on -> there is no active system cached
var sourceSystem = false;
if(
activeSystemCache &&
activeSystemCache.data('systemId') !== currentCharacterLog.system.id
){
// add new system to the map

// draw new connection
sourceSystem = activeSystemCache;
// calculate new system coordinates
requestData.systemData.position = calculateNewSystemPosition(sourceSystem);
var requestData = {
systemData: {
systemId: currentCharacterLog.system.id
},
mapData: {
id: userData.config.id
}
};

mapElement.getMapOverlay('timer').startMapUpdateCounter();

saveSystem(map, requestData, sourceSystem, false);
// check if a system jump is detected previous system !== current system
// and add a connection to the previous system as well
// hint: if a user just logged on -> there is no active system cached
var sourceSystem = false;
if(
activeSystemCache &&
activeSystemCache.data('systemId') !== currentCharacterLog.system.id
){

// draw new connection
sourceSystem = activeSystemCache;
// calculate new system coordinates
requestData.systemData.position = calculateNewSystemPosition(sourceSystem);
}
}

mapElement.getMapOverlay('timer').startMapUpdateCounter();

saveSystem(map, requestData, sourceSystem, false);
}

// trigger document event -> update header
$(document).trigger('pf:updateHeaderMapData', headerUpdateData);
Expand Down
3 changes: 1 addition & 2 deletions js/app/ui/system_signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,7 @@ define([
// jump to "next" editable field on save
var openNextEditDialogOnSave = function(fields){
fields.on('save', function(e, a){
console.log(e);
console.log(a)

var currentField = $(this);

setTimeout(function() {
Expand Down
17 changes: 12 additions & 5 deletions js/app/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ define([
'config/system_effect',
'config/signature_type',
'bootbox',
'app/ccp',
'velocity',
'velocityUI',
'customScrollbar',
Expand All @@ -16,7 +17,7 @@ define([
'hoverIntent',
'bootstrapConfirmation',
'bootstrapToggle'
], function($, Init, SystemEffect, SignatureType, bootbox) {
], function($, Init, SystemEffect, SignatureType, bootbox, CCP) {

'use strict';

Expand Down Expand Up @@ -548,7 +549,7 @@ define([
*/
var showVersionInfo = function(){
var versionNumber = $('body').data('version');
console.info('PATHFINDER', versionNumber);
console.info('PATHFINDER ' + versionNumber);
};

/**
Expand Down Expand Up @@ -1320,14 +1321,20 @@ define([
var getCurrentCharacterLog = function(){

var characterLog = false;

var currentUserData = getCurrentUserData();

if(
currentUserData &&
currentUserData.character &&
currentUserData.character.log
currentUserData.character
){
characterLog = currentUserData.character.log;
if(currentUserData.character.log){
characterLog = currentUserData.character.log;
}else if(CCP.isInGameBrowser() === true){
// if user is IGB online and log data is missing
// -> character API information not found!
showNotify({title: 'Character not found', text: 'Enter API information', type: 'error'});
}
}

return characterLog;
Expand Down
2 changes: 1 addition & 1 deletion public/css/pathfinder.css

Large diffs are not rendered by default.

Binary file added public/img/logo_alpha.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2fe5fde

Please sign in to comment.