From b8f192868801ce81fefcd657e7f1b5b70c415f76 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 15 Mar 2014 00:01:05 +0000 Subject: [PATCH 01/56] website: update for new release --- website/page/home.php | 6 ++++++ website/page/news.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/website/page/home.php b/website/page/home.php index 9d1faccb..9c47def2 100644 --- a/website/page/home.php +++ b/website/page/home.php @@ -13,6 +13,12 @@ offers many more features. It is available for

Latest news

+

14th March 2014

+

+IITC 0.16.6 and IITC Mobile 0.10.6 have just been released. This is a critical update required to successfully load +portals when zoomed in (L3+ or closer) to the map. +

+

22nd February 2014

IITC 0.16.5 and IITC Mobile 0.10.5 have just been released. This version is required to work with a change made to the diff --git a/website/page/news.php b/website/page/news.php index 4b5c2d0e..61c375b1 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -1,5 +1,11 @@

News

+

14th March 2014

+

+IITC 0.16.6 and IITC Mobile 0.10.6 have just been released. This is a critical update required to successfully load +portals when zoomed in (L3+ or closer) to the map. +

+

22nd February 2014

IITC 0.16.5 and IITC Mobile 0.10.5 have just been released. This version is required to work with a change made to the From cb8dc7bd41b19d7ba99fefae1b06771427d69260 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 15 Mar 2014 00:02:17 +0000 Subject: [PATCH 02/56] oops - some debug code was accidentally committed - portals should be brought to front --- code/map_data_render.js | 1 - 1 file changed, 1 deletion(-) diff --git a/code/map_data_render.js b/code/map_data_render.js index 8c38d398..baace48d 100644 --- a/code/map_data_render.js +++ b/code/map_data_render.js @@ -167,7 +167,6 @@ window.Render.prototype.endRenderPass = function() { } window.Render.prototype.bringPortalsToFront = function() { -return; for (var lvl in portalsFactionLayers) { // portals are stored in separate layers per faction // to avoid giving weight to one faction or another, we'll push portals to front based on GUID order From 0a96440f77f5498a1e1861df919d7e987755f2be Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 15 Mar 2014 00:03:12 +0000 Subject: [PATCH 03/56] bump version numbers --- main.js | 2 +- mobile/AndroidManifest.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index ebb8e0d3..78eb42fd 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,7 @@ // ==UserScript== // @id ingress-intel-total-conversion@jonatkins // @name IITC: Ingress intel map total conversion -// @version 0.16.6.@@DATETIMEVERSION@@ +// @version 0.16.7.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index 5284cb0f..c39c6020 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="68" + android:versionName="0.10.7"> Date: Sat, 15 Mar 2014 16:10:20 +0000 Subject: [PATCH 04/56] website: update news entry with change details --- website/page/home.php | 19 ++++++++++++++++++- website/page/news.php | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/website/page/home.php b/website/page/home.php index 9c47def2..463081f1 100644 --- a/website/page/home.php +++ b/website/page/home.php @@ -16,8 +16,25 @@ offers many more features. It is available for

14th March 2014

IITC 0.16.6 and IITC Mobile 0.10.6 have just been released. This is a critical update required to successfully load -portals when zoomed in (L3+ or closer) to the map. +portals when zoomed in (L3+ or closer) to the map. Changes include:

+

22nd February 2014

diff --git a/website/page/news.php b/website/page/news.php index 61c375b1..814fa95d 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -3,8 +3,25 @@

14th March 2014

IITC 0.16.6 and IITC Mobile 0.10.6 have just been released. This is a critical update required to successfully load -portals when zoomed in (L3+ or closer) to the map. +portals when zoomed in (L3+ or closer) to the map. Changes include:

+

22nd February 2014

From 3232aa5c10c356be4b962cdc008f867876d5c41f Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 15 Mar 2014 17:21:12 +0000 Subject: [PATCH 05/56] fix @player level tooltip - was looking for player with the '@' - which failed --- plugins/guess-player-levels.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/guess-player-levels.user.js b/plugins/guess-player-levels.user.js index c67ec530..2ade227f 100644 --- a/plugins/guess-player-levels.user.js +++ b/plugins/guess-player-levels.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-guess-player-levels@breunigs // @name IITC plugin: guess player level // @category Info -// @version 0.5.1.@@DATETIMEVERSION@@ +// @version 0.5.2.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -84,6 +84,7 @@ window.plugin.guessPlayerLevels.setLevelTitle = function(dom) { var el = $(dom); var nick = el.text(); + if (nick[0] == '@') nick = nick.substring(1); var details = window.plugin.guessPlayerLevels.fetchLevelDetailsByPlayer(nick); From 246fa1a7d7879cbb1818686bedcc6f7c4ae53bdd Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 17 Mar 2014 07:07:02 +0000 Subject: [PATCH 06/56] double-timeout on debug tile fading - helps when rendering goes slow --- code/map_data_debug.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/map_data_debug.js b/code/map_data_debug.js index 7796b809..0aff2b37 100644 --- a/code/map_data_debug.js +++ b/code/map_data_debug.js @@ -72,8 +72,11 @@ window.RenderDebugTiles.prototype.setState = function(id,state) { window.RenderDebugTiles.prototype.startTimer = function(waitTime) { var _this = this; - if (!this.timer) { - this.timer = setTimeout ( function() { _this.timer = undefined; _this.runClearPass(); }, waitTime ); + if (!_this.timer) { + // a timeout of 0 firing the actual timeout - helps things run smoother + _this.timer = setTimeout ( function() { + _this.timer = setTimeout ( function() { _this.timer = undefined; _this.runClearPass(); }, waitTime ); + }, 0); } } From 16cabd89bc1b1f4aadf9cfda25a3e4a31603c00e Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 17 Mar 2014 23:28:51 +0000 Subject: [PATCH 07/56] remove some events/timers left over from the stock intel site code --- main.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 78eb42fd..c97e5368 100644 --- a/main.js +++ b/main.js @@ -23,7 +23,6 @@ window.iitcBuildDate = '@@BUILDDATE@@'; window.onload = function() {}; document.body.onload = function() {}; - // rescue user data from original page var scr = document.getElementsByTagName('script'); for(var x in scr) { @@ -115,6 +114,16 @@ function wrapper(info) { // (not the full GM_info - it contains the ENTIRE script source!) window.script_info = info; +// disabling of some cruft left behind by the stock site +try { + goog.events.removeAll(); + goog.Timer.clear(); +} catch(e) { + console.warn('Exception from trying to clear stock site stuff'); + console.warn(e); + debugger; // debugger break +} + // LEAFLET PREFER CANVAS /////////////////////////////////////////////// // Set to true if Leaflet should draw things using Canvas instead of SVG From e1752954a1136241b385eff145063647ff20396c Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Tue, 18 Mar 2014 22:14:10 +0000 Subject: [PATCH 08/56] and Niantic revert the changes to tile sizes a few days later... --- code/map_data_calc_tools.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js index 07fb01e1..eaecdaa1 100755 --- a/code/map_data_calc_tools.js +++ b/code/map_data_calc_tools.js @@ -24,9 +24,9 @@ window.getMapZoomTileParameters = function(zoom) { } catch(e) { console.warn(e); - // known correct as of 2014-03-14 - ZOOM_TO_TILES_PER_EDGE = [32, 32, 32, 32, 256, 256, 256, 1024, 1024, 1536, 4096, 4096, 6500, 6500, 6500]; - MAX_TILES_PER_EDGE = 9000; + // known correct as of 2014-03-18 + ZOOM_TO_TILES_PER_EDGE = [32, 32, 32, 32, 256, 256, 256, 1024, 1024, 1536, 4096, 4096, 16384, 16384, 16384]; + MAX_TILES_PER_EDGE = 65536; ZOOM_TO_LEVEL = [8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1]; // for developers, let's stop in the debugger From df4bf0bbc076b481eaf9d047dd6958d9eb8f4dee Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Tue, 18 Mar 2014 22:14:55 +0000 Subject: [PATCH 09/56] remove experimental exception catching code in boot func - was never that helpful --- code/boot.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/code/boot.js b/code/boot.js index d9d4f884..6a54870f 100644 --- a/code/boot.js +++ b/code/boot.js @@ -520,7 +520,6 @@ window.setupLayerChooserApi = function() { // BOOTING /////////////////////////////////////////////////////////// function boot() { - try { //EXPERIMENTAL TEST if(!isSmartphone()) // TODO remove completely? window.debug.console.overwriteNativeIfRequired(); @@ -644,13 +643,6 @@ function boot() { android.bootFinished(); } - //EXPERIMENTAL TEST - } catch(e) { - console.log('Exception caught in IITC boot function - will fail to start'); - console.log(e); - debugger; - throw e; - } } From 584b8bcd72b3a19bfba358b08fd821c581626af1 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Tue, 18 Mar 2014 22:16:20 +0000 Subject: [PATCH 10/56] changes to queue processing timeouts after errors - should be friendlier to the servers when things fail --- code/map_data_request.js | 44 ++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/code/map_data_request.js b/code/map_data_request.js index dddfe568..2355910f 100644 --- a/code/map_data_request.js +++ b/code/map_data_request.js @@ -38,15 +38,14 @@ window.MapDataRequest = function() { // a short delay between one request finishing and the queue being run for the next request. // this gives a chance of other requests finishing, allowing better grouping of retries in new requests - this.RUN_QUEUE_DELAY = 0.5; + this.RUN_QUEUE_DELAY = 0.2; - // delay before requeuing tiles in failed requests - this.BAD_REQUEST_REQUEUE_DELAY = 10; // longer delay before retrying a completely failed request - as in this case the servers are struggling + // delay before processing the queue after failed requests + this.BAD_REQUEST_RUN_QUEUE_DELAY = 10; // longer delay before doing anything after errors (other than TIMEOUT) + + // delay before processing the queue after error==TIMEOUT requests. this is a less severe error than other errors + this.TIMEOUT_REQUEST_RUN_QUEUE_DELAY = 2; - // a delay before processing the queue after requeuing tiles. this gives a chance for other requests to finish - // or other requeue actions to happen before the queue is processed, allowing better grouping of requests - // however, the queue may be processed sooner if a previous timeout was set - this.REQUEUE_DELAY = 1; this.REFRESH_CLOSE = 120; // refresh time to use for close views z>12 when not idle and not moving @@ -248,7 +247,8 @@ window.MapDataRequest.prototype.refresh = function() { //TODO: with recent backend changes there are now multiple zoom levels of data that is identical except perhaps for some // reduction of detail when zoomed out. to take good advantage of the cache, a check for cached data at a closer zoom // but otherwise the same parameters (min portal level, tiles per edge) will mean less downloads when zooming out - +// (however, the default code in getDataZoomForMapZoom currently reduces the need for this, as it forces the furthest +// out zoom tiles for a detail level) if (this.cache && this.cache.isFresh(tile_id) ) { // data is fresh in the cache - just render it this.debugTiles.setState(tile_id, 'cache-fresh'); @@ -532,9 +532,12 @@ window.MapDataRequest.prototype.handleResponse = function (data, tiles, success) window.runHooks('requestFinished', {success: true}); } + // set the queue delay based on any errors or timeouts + var nextQueueDelay = errorTiles.length > 0 ? this.BAD_REQUEST_RUN_QUEUE_DELAY : + timeoutTiles.length > 0 ? this.TIMEOUT_REQUEST_RUN_QUEUE_DELAY : + this.RUN_QUEUE_DELAY; - console.log ('getThinnedEntities status: '+tiles.length+' tiles: '+successTiles.length+' successful, '+timeoutTiles.length+' timed out, '+errorTiles.length+' failed'); - + console.log ('getThinnedEntities status: '+tiles.length+' tiles: '+successTiles.length+' successful, '+timeoutTiles.length+' timed out, '+errorTiles.length+' failed. delay '+nextQueueDelay+' seconds'); // requeue any 'timeout' tiles immediately if (timeoutTiles.length > 0) { @@ -545,27 +548,20 @@ window.MapDataRequest.prototype.handleResponse = function (data, tiles, success) } } - // but for other errors, delay before retrying (as the server is having issues) if (errorTiles.length > 0) { - //setTimeout has no way of passing the 'context' (aka 'this') to it's function - var savedContext = this; - - setTimeout (function() { - for (var i in errorTiles) { - var id = errorTiles[i]; - delete savedContext.requestedTiles[id]; - savedContext.requeueTile(id, true); - } - savedContext.delayProcessRequestQueue(this.REQUEUE_DELAY); - }, this.BAD_REQUEST_REQUEUE_DELAY*1000); + for (var i in errorTiles) { + var id = errorTiles[i]; + delete this.requestedTiles[id]; + this.requeueTile(id, true); + } } - for (var i in successTiles) { var id = successTiles[i]; delete this.requestedTiles[id]; } + //.. should this also be delayed a small amount? - this.delayProcessRequestQueue(this.RUN_QUEUE_DELAY); + this.delayProcessRequestQueue(nextQueueDelay); } From 4dd944a642e51c86bf6fc3da6574dcf6ac44b305 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 19 Mar 2014 04:44:20 +0000 Subject: [PATCH 11/56] move portal level layer enable/disable out of status bar code into a map.on(zoomend) event instead --- code/boot.js | 18 ++++++++++++++++++ code/status_bar.js | 9 --------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/code/boot.js b/code/boot.js index 6a54870f..c82afd4d 100644 --- a/code/boot.js +++ b/code/boot.js @@ -78,6 +78,21 @@ window.setupLayerChooserStatusRecorder = function() { }); } +window.layerChooserSetDisabledStates = function() { +// layer selector - enable/disable layers that aren't visible due to zoom level + var minlvl = getMinPortalLevel(); + var portalSelection = $('.leaflet-control-layers-overlays label'); + //it's an array - 0=unclaimed, 1=lvl 1, 2=lvl 2, ..., 8=lvl 8 - 9 relevant entries + //mark all levels below (but not at) minlvl as disabled + portalSelection.slice(0, minlvl).addClass('disabled').attr('title', 'Zoom in to show those.'); + //and all from minlvl to 8 as enabled + portalSelection.slice(minlvl, 8+1).removeClass('disabled').attr('title', ''); + +//TODO? some generic mechanism where other layers can have their disabled state marked on/off? a few +//plugins have code to do it by hand already +} + + window.setupStyles = function() { $('head').append('