From cc9c186f6394f2c595a2df94366b554bf5e54358 Mon Sep 17 00:00:00 2001 From: Peter Sorger Date: Wed, 25 Sep 2013 10:20:28 +0200 Subject: [PATCH 01/14] Added Mitigation column Added mitigation column to portals list --- plugins/portals-list.user.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index 84dfa1a1..089e0966 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -301,6 +301,7 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { + 'M2' + 'M3' + 'M4' + + 'Mit.' + 'AP Gain' + 'E/AP' + 'Age'; @@ -314,6 +315,9 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { + '' + portal.level + '' + '' + portal.team + ''; + var mitigationDetails = getPortalMitigationDetails(portal.portal); + portal.mitigation = mitigationDetails.total + mitigationDetails.excess; + var title; var percent; $.each([0, 1, 2, 3 ,4 ,5 ,6 ,7], function(ind, slot) { @@ -333,6 +337,7 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { + '' + portal.mods[1][2] + '' + '' + portal.mods[2][2] + '' + '' + portal.mods[3][2] + '' + + '' + portal.mitigation + '' + '' + portal.APgain + '' + '' + portal.EAP + '' + '' + portal.age_string_short + ''; From edbf583cccb6ae084ab952a1efd16742be22b022 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Sun, 29 Sep 2013 00:38:38 +0200 Subject: [PATCH 02/14] bugfix: run setLoadingState on UI thread in CheckHttpResponse --- .../com/cradle/iitc_mobile/async/CheckHttpResponse.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mobile/src/com/cradle/iitc_mobile/async/CheckHttpResponse.java b/mobile/src/com/cradle/iitc_mobile/async/CheckHttpResponse.java index 431dee3c..057b0c74 100644 --- a/mobile/src/com/cradle/iitc_mobile/async/CheckHttpResponse.java +++ b/mobile/src/com/cradle/iitc_mobile/async/CheckHttpResponse.java @@ -43,7 +43,13 @@ public class CheckHttpResponse extends AsyncTask { int code = response.getStatusLine().getStatusCode(); if (code != HttpStatus.SC_OK) { Log.d("iitcm", "received error code: " + code); - ((IITC_Mobile) mContext).setLoadingState(false); + final IITC_Mobile iitc = (IITC_Mobile) mContext; + iitc.runOnUiThread(new Runnable() { + @Override + public void run() { + iitc.setLoadingState(false); + } + }); // TODO: remove when google login issue is fixed if (urls[0].contains("uberauth=WILL_NOT_SIGN_IN")) { return true; From c371d2fb6aeaf9cae13290fe4024e975c5d76e96 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Sun, 29 Sep 2013 00:59:02 +0200 Subject: [PATCH 03/14] added status bar tap to the info-screen hint --- mobile/res/values/strings.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mobile/res/values/strings.xml b/mobile/res/values/strings.xml index 8699ebec..6c810a6f 100644 --- a/mobile/res/values/strings.xml +++ b/mobile/res/values/strings.xml @@ -63,7 +63,9 @@ to evoke the Layer Drawer]]> - +
+ • tap and hold a portal for a second
+ • tap on the left half of the status bar]]>
UI @@ -109,4 +111,4 @@ Base Layer Overlay Layers - \ No newline at end of file + From 2f66953774c806852aab57137c4b6666c54909dd Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 29 Sep 2013 00:11:48 +0100 Subject: [PATCH 04/14] draw-tools: update edit colour to match that used while drawing - with only dashed lines being used as in stock Leaflet.Draw --- plugins/draw-tools.user.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/draw-tools.user.js b/plugins/draw-tools.user.js index a9ee160d..335825f3 100644 --- a/plugins/draw-tools.user.js +++ b/plugins/draw-tools.user.js @@ -33,6 +33,7 @@ window.plugin.drawTools.loadExternals = function() { } window.plugin.drawTools.setOptions = function() { + window.plugin.drawTools.lineOptions = { stroke: true, color: '#a24ac3', @@ -42,16 +43,15 @@ window.plugin.drawTools.setOptions = function() { clickable: true }; - window.plugin.drawTools.polygonOptions = { - stroke: true, - color: '#a24ac3', - weight: 4, - opacity: 0.5, + window.plugin.drawTools.polygonOptions = L.extend({}, window.plugin.drawTools.lineOptions, { fill: true, - fillColor: null, - fillOpacity: 0.2, - clickable: true - }; + fillColor: null, // to use the same as 'color' for fill + fillOpacity: 0.2 + }); + + window.plugin.drawTools.editOptions = L.extend({}, window.plugin.drawTools.polygonOptions, { + dashArray: [10,10] + }); window.plugin.drawTools.markerOptions = { icon: new L.Icon.Default(), @@ -113,7 +113,8 @@ window.plugin.drawTools.addDrawControl = function() { featureGroup: window.plugin.drawTools.drawnItems, edit: { - title: 'Edit drawn items' + title: 'Edit drawn items', + selectedPathOptions: window.plugin.drawTools.editOptions, }, remove: { From 888eb10efe9a72d6de0889439bdc0e8dbd6833e4 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 30 Sep 2013 22:43:35 +0100 Subject: [PATCH 05/14] first attempt at updating munge parameters for new niantic intel site update have commented out old munges for now - they don't include parameters needed in some new requests, so are unlikely to be used again for #589 --- code/utils_misc.js | 181 +++++++++++++++++++++++++++------------------ 1 file changed, 108 insertions(+), 73 deletions(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index e559a974..f2d7e4bd 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -96,82 +96,116 @@ window.digits = function(d) { window.requestParameterMunges = [ +// set 0 and 1 were brought online at the same time - an attempt to confuse us, or others hacking on the web interface? // set 0 - { - method: '4kr3ofeptwgary2j', - boundsParamsList: 'n27qzc8389kgakyv', - id: '39031qie1i4aq563', - minLatE6: 'pg98bwox95ly0ouu', - minLngE6: 'eib1bkq8znpwr0g7', - maxLatE6: 'ilfap961rwdybv63', - maxLngE6: 'lpf7m1ifx0ieouzq', - timestampMs: '2ewujgywmum1yp49', - qk: 'bgxibcomzoto63sn', - desiredNumItems: 'tmb0vgxgp5grsnhp', - minTimestampMs: 'hljqffkpwlx0vtjt', - maxTimestampMs: 'sw317giy6x2xj9zm', - guids: 'pusjrhxxtyp5nois', - inviteeEmailAddress: 'cltkepgqkepfsyaq', - message: 'q0d6n7t1801bb6xu', - latE6: '5ygbhpxfnt1u9e4t', - lngE6: 'ak6twnljwwcgd7cj', - factionOnly: '0dvtbatgzcfccchh', - ascendingTimestampOrder: 'f6u1iqep9s2lc5y5' - }, +// { +// method: '4kr3ofeptwgary2j', +// boundsParamsList: 'n27qzc8389kgakyv', +// id: '39031qie1i4aq563', +// minLatE6: 'pg98bwox95ly0ouu', +// minLngE6: 'eib1bkq8znpwr0g7', +// maxLatE6: 'ilfap961rwdybv63', +// maxLngE6: 'lpf7m1ifx0ieouzq', +// timestampMs: '2ewujgywmum1yp49', +// qk: 'bgxibcomzoto63sn', +// desiredNumItems: 'tmb0vgxgp5grsnhp', +// minTimestampMs: 'hljqffkpwlx0vtjt', +// maxTimestampMs: 'sw317giy6x2xj9zm', +// guids: 'pusjrhxxtyp5nois', +// inviteeEmailAddress: 'cltkepgqkepfsyaq', +// message: 'q0d6n7t1801bb6xu', +// latE6: '5ygbhpxfnt1u9e4t', +// lngE6: 'ak6twnljwwcgd7cj', +// factionOnly: '0dvtbatgzcfccchh', +// ascendingTimestampOrder: 'f6u1iqep9s2lc5y5' +// }, // set 1 - { - method: 'uuo2zqhhy5bw80fu', - boundsParamsList: '5rc0561uauf6x13u', - id: 'bzeizowtguoyrrtt', - minLatE6: '7qej3eqg4sefuaac', - minLngE6: 'yqegc976egk5q9vo', - maxLatE6: '2odsgh99ix9bbtsb', - maxLngE6: 'g9jess8dwa2j8pwi', - timestampMs: '604f34zcu9zna0a5', - qk: 'y853tux9h7cb6xp3', - desiredNumItems: 'sfv5i7l6ouljz8vf', - minTimestampMs: 'y3g07dbnw6sklloj', - maxTimestampMs: '3pdl28aa27xvyhke', - guids: 'xp1pl2jm5hrh3bna', - inviteeEmailAddress: '2pyrttrp3gh38mmu', - message: 'zz54435vfc57nlg9', - latE6: 'cyltxjod3jhxgj8q', - lngE6: 'h9whcgcz6kpqkz80', - factionOnly: '37okcr7gvd5yn2lj', - ascendingTimestampOrder: 'iimftkq7flskwrx9' - }, +// { +// method: 'uuo2zqhhy5bw80fu', +// boundsParamsList: '5rc0561uauf6x13u', +// id: 'bzeizowtguoyrrtt', +// minLatE6: '7qej3eqg4sefuaac', +// minLngE6: 'yqegc976egk5q9vo', +// maxLatE6: '2odsgh99ix9bbtsb', +// maxLngE6: 'g9jess8dwa2j8pwi', +// timestampMs: '604f34zcu9zna0a5', +// qk: 'y853tux9h7cb6xp3', +// desiredNumItems: 'sfv5i7l6ouljz8vf', +// minTimestampMs: 'y3g07dbnw6sklloj', +// maxTimestampMs: '3pdl28aa27xvyhke', +// guids: 'xp1pl2jm5hrh3bna', +// inviteeEmailAddress: '2pyrttrp3gh38mmu', +// message: 'zz54435vfc57nlg9', +// latE6: 'cyltxjod3jhxgj8q', +// lngE6: 'h9whcgcz6kpqkz80', +// factionOnly: '37okcr7gvd5yn2lj', +// ascendingTimestampOrder: 'iimftkq7flskwrx9' +// }, // set 2 - first seen 2013-09-12 21:30 - { - method: '42suxeca8ttud7je', - boundsParamsList: '5uwd21hkedg3zh2c', - id: 'drtt302ebaj6ek2g', - minLatE6: 'l933r0l8brrt1x5b', - minLngE6: 'qg3xb340zed41jof', - maxLatE6: 'sw485z1n3tusdkul', - maxLngE6: '6meahm3f9xup9krb', - timestampMs: '6meahm3f9xup9krb', - qk: 'fpi9b1z0os0x9yjj', - desiredNumItems: 'inr3js77cetyibi6', - minTimestampMs: 'zfb2e5iqmggrxe98', - maxTimestampMs: '8c4imy17gfpfrl9l', - guids: '5d5hp2p3rkmanqn7', - inviteeEmailAddress: 'i1a5yp6p1l6iqk08', - message: 'xzhbk3ri04lx9xvj', - latE6: 'njg0zny4fb39mf0a', - lngE6: 'ti2rx4ltmg6d1zsr', - factionOnly: 'jegpo8rwhtuuuuhh', - ascendingTimestampOrder: '1ennke6gykwzziun', - // in this set, also the request method names are obsfucated! - 'dashboard.getThinnedEntitiesV4': 'ufxcmvve3eirsf2b', - 'dashboard.getPaginatedPlextsV2': 'd9dgziiw8vzhyecv', - 'dashboard.getPlayersByGuids': 's53izqpxedtd0hv8', - 'dashboard.sendInviteEmail': 'kn9plnbree2aeuh9', - 'dashboard.redeemReward': 'les8vribyxb899wd', - 'dashboard.sendPlext': '9u1ukkkx1euxf02a' - }, + // (very briefly - and removed a few hours later) +// { +// method: '42suxeca8ttud7je', +// boundsParamsList: '5uwd21hkedg3zh2c', +// id: 'drtt302ebaj6ek2g', +// minLatE6: 'l933r0l8brrt1x5b', +// minLngE6: 'qg3xb340zed41jof', +// maxLatE6: 'sw485z1n3tusdkul', +// maxLngE6: '6meahm3f9xup9krb', +// timestampMs: '6meahm3f9xup9krb', +// qk: 'fpi9b1z0os0x9yjj', +// desiredNumItems: 'inr3js77cetyibi6', +// minTimestampMs: 'zfb2e5iqmggrxe98', +// maxTimestampMs: '8c4imy17gfpfrl9l', +// guids: '5d5hp2p3rkmanqn7', +// inviteeEmailAddress: 'i1a5yp6p1l6iqk08', +// message: 'xzhbk3ri04lx9xvj', +// latE6: 'njg0zny4fb39mf0a', +// lngE6: 'ti2rx4ltmg6d1zsr', +// factionOnly: 'jegpo8rwhtuuuuhh', +// ascendingTimestampOrder: '1ennke6gykwzziun', +// // in this set, also the request method names are obsfucated! +// 'dashboard.getThinnedEntitiesV4': 'ufxcmvve3eirsf2b', +// 'dashboard.getPaginatedPlextsV2': 'd9dgziiw8vzhyecv', +// 'dashboard.getPlayersByGuids': 's53izqpxedtd0hv8', +// 'dashboard.sendInviteEmail': 'kn9plnbree2aeuh9', +// 'dashboard.redeemReward': 'les8vribyxb899wd', +// 'dashboard.sendPlext': '9u1ukkkx1euxf02a' +// }, + // set 3 - in the update of 2013-09-30 (addition of 'alerts' chat tab) + { + method: '22ux2z96jwq5zn78', + version: 'kf6hgl9yau03ws0o', //guessed parameter name - only seen munged + boundsParamsList: '29t16cmsn6l3r2xg', + id: '7rogqhp5pzcqobcw', + minLatE6: 'yzbnp7z9bd28p0yr', + minLngE6: '2pdhntvo85cd90bw', + maxLatE6: 'c4ivr013h4dr68pd', + maxLngE6: '4p8oorcrwalc1mzf', + timestampMs: 'vd2rsa9v6f8q606s', + qk: 'cblh9xe0bgwjy5ij', + desiredNumItems: '3ymaq7slb165porj', + minTimestampMs: 's9jf2seni33y3gyu', + maxTimestampMs: '2kh3vti98rhp3g29', + chatTab: '7n7ocqfq1p18352b', //guessed parameter name - only seen munged + guids: '5hyiwhwc0jyljvro', + inviteeEmailAddress: 's9z6zt03eymzxhkj', + message: 'e8qm0kptw2trrcrw', + latE6: 'fja1phtsqxm71dqm', + lngE6: 'iut1tb7c0x726hwn', + factionOnly: 'p88a2ztchtjhiazl', + ascendingTimestampOrder: 'p88a2ztchtjhiazl', + // in this set, also the request method names are obsfucated! + 'dashboard.getGameScore': 'fhlzntzkl5v7hcfh', // GET_GAME_SCORE + 'dashboard.getPaginatedPlextsV2': 'wzuitnswoda7w028', // GET_PAGINATED_PLEXTS + 'dashboard.getThinnedEntitiesV4': 'scgrm4lf2371esgw', // GET_THINNED_ENTITIES + 'dashboard.getPlayersByGuids': '81l6usczczoi3lfi', // LOOKUP_PLAYERS + 'dashboard.redeemReward': '8kop2koeld9b4c26', // REDEEM_REWARD + 'dashboard.sendInviteEmail': 't0ccodsm1nuo5uso', // SEND_INVITE_EMAIL + 'dashboard.sendPlext': 'k04cfjwwsg3h3827' // SEND_PLEXT + }, ]; window.activeRequestMungeSet = undefined; @@ -179,10 +213,10 @@ window.activeRequestMungeSet = undefined; window.detectActiveMungeSet = function() { for (var m in window) { // try and find the stock page functions - if (typeof window[m] == 'function' && m.length <= 3) { + if (typeof window[m] == 'function') { var stockFunc = window[m].toString(); for (var i in window.requestParameterMunges) { - if (stockFunc.indexOf (window.requestParameterMunges[i]['id']) >= 0) { + if (stockFunc.indexOf (window.requestParameterMunges[i]['method']) >= 0) { console.log('IITC: found request munge set '+i+' in stock intel function "window.'+m+'()"'); window.activeRequestMungeSet = i; } @@ -248,9 +282,10 @@ window.postAjax = function(action, data, success, error) { var activeMunge = window.requestParameterMunges[window.activeRequestMungeSet]; var methodName = 'dashboard.'+action; + var versionStr = "4608f4356a6f55690f127fb542f557f98de66169"; // unsure of parameter value meaning. appears to be a constant used as a 'version'. added to all requests along with the method name in the stock site // optional munging of the method name - seen in Set 2 (onwards?) if (methodName in activeMunge) methodName = activeMunge[methodName]; - var post_data = JSON.stringify(window.requestDataMunge($.extend({method: methodName}, data))); + var post_data = JSON.stringify(window.requestDataMunge($.extend({method: methodName, version: versionStr}, data))); var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); }; var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); }; var result = $.ajax({ From ed210ed6b657e06303a031408ac0d70de91ad400 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 30 Sep 2013 22:51:06 +0100 Subject: [PATCH 06/14] quick fix for chat, for protocol changes for #589 --- code/chat.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/chat.js b/code/chat.js index 747e23b9..f6749a71 100644 --- a/code/chat.js +++ b/code/chat.js @@ -81,7 +81,8 @@ window.chat.genPostData = function(isFaction, storageHash, getOlderMsgs) { maxLngE6: Math.round(ne.lng*1E6), minTimestampMs: -1, maxTimestampMs: -1, - factionOnly: isFaction + factionOnly: isFaction, + chatTab: isFaction ? 'faction' : 'all' } if(getOlderMsgs) { @@ -689,7 +690,8 @@ window.chat.postMsg = function() { var data = {message: msg, latE6: Math.round(latlng.lat*1E6), lngE6: Math.round(latlng.lng*1E6), - factionOnly: !publik}; + factionOnly: !publik, + chatTab: publik ? 'all' : 'faction'}; var errMsg = 'Your message could not be delivered. You can copy&' + 'paste it here and try again if you want:\n\n' + msg; From 5aac7758ba23d6d2948d4d6669083e24ecb20f90 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 30 Sep 2013 23:13:53 +0100 Subject: [PATCH 07/14] remove old factionOnly flag from chat requests. although the stock site appears to send it still at first glance of the code, this appears to be incorrect - and sending it causes old messages to come first rather than new ones! (perhaps i've mis-identified the flag - and it's the one for getting older messages first?) for #589 --- code/chat.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/chat.js b/code/chat.js index f6749a71..ad1032ce 100644 --- a/code/chat.js +++ b/code/chat.js @@ -81,7 +81,6 @@ window.chat.genPostData = function(isFaction, storageHash, getOlderMsgs) { maxLngE6: Math.round(ne.lng*1E6), minTimestampMs: -1, maxTimestampMs: -1, - factionOnly: isFaction, chatTab: isFaction ? 'faction' : 'all' } @@ -690,7 +689,6 @@ window.chat.postMsg = function() { var data = {message: msg, latE6: Math.round(latlng.lat*1E6), lngE6: Math.round(latlng.lng*1E6), - factionOnly: !publik, chatTab: publik ? 'all' : 'faction'}; var errMsg = 'Your message could not be delivered. You can copy&' + From 85c69b0405936941c3d86ace100f7b36fe50b34f Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 30 Sep 2013 23:23:13 +0100 Subject: [PATCH 08/14] factionOnly was not correct - had mis-entered this mapping (and was already there for ascendingTimestampOrder - it's real meaning) --- code/utils_misc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index f2d7e4bd..d2a5a807 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -195,7 +195,6 @@ window.requestParameterMunges = [ message: 'e8qm0kptw2trrcrw', latE6: 'fja1phtsqxm71dqm', lngE6: 'iut1tb7c0x726hwn', - factionOnly: 'p88a2ztchtjhiazl', ascendingTimestampOrder: 'p88a2ztchtjhiazl', // in this set, also the request method names are obsfucated! 'dashboard.getGameScore': 'fhlzntzkl5v7hcfh', // GET_GAME_SCORE From 3df7762656766c1be8a0ea7e0996d5c76ab2a7ef Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 30 Sep 2013 23:23:58 +0100 Subject: [PATCH 09/14] reduce faction messages to 50 at a time - as they're no longer cluttered with user-specific alerts (these now appear in a separate 'alerts' tab on the stock site - yet to be implemented in IITC) --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index 15169627..bf304d6d 100644 --- a/main.js +++ b/main.js @@ -137,7 +137,7 @@ window.VIEWPORT_PAD_RATIO = 0.3; // how many items to request each query window.CHAT_PUBLIC_ITEMS = 200; -window.CHAT_FACTION_ITEMS = 100; +window.CHAT_FACTION_ITEMS = 50; // how many pixels to the top before requesting new data window.CHAT_REQUEST_SCROLL_TOP = 200; window.CHAT_SHRINKED = 60; From 8c22c9afefb356594bae1c29b6a89ab8a7ac460b Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Tue, 1 Oct 2013 00:25:56 +0100 Subject: [PATCH 10/14] website - remove old URL from commented out 'IITC broken' section --- website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.php b/website/index.php index 8ac2c4c9..2d01c87b 100644 --- a/website/index.php +++ b/website/index.php @@ -71,7 +71,7 @@ if ( file_exists ( 'tracking.php' ) ) From 4413fb9adbe1bcbf00efaefdfcde5c768f0b9898 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Tue, 1 Oct 2013 01:02:08 +0100 Subject: [PATCH 11/14] another mungs set was pushed live. update the code also reordered munge list to match the order found in the stock page (makes it easier to update) and tweaked the code that detects and auto-tries munge sets --- code/game_status.js | 4 +- code/utils_misc.js | 167 ++++++++++++++++++-------------------------- 2 files changed, 69 insertions(+), 102 deletions(-) diff --git a/code/game_status.js b/code/game_status.js index 87e17e5c..5ae4bfa1 100644 --- a/code/game_status.js +++ b/code/game_status.js @@ -15,9 +15,9 @@ window.updateGameScore = function(data) { // detecting which munge set should be used is tricky - even the stock site gets it wrong sometimes // to detect the problem and try a different set is easiest in a place where there's only a single request of that type // sent at once, and it has no extra parameters. this method matches those requirements - if (data == '{"error": "invalid method params"}' || data.error) { + if (data.error || (data.indexOf && data.indexOf('"error"') != -1)) { window.window.updateGameScoreFailCount++; - if (window.window.updateGameScoreFailCount < 5) { + if (window.window.updateGameScoreFailCount <= window.requestParameterMunges.length) { window.activeRequestMungeSet = (window.activeRequestMungeSet+1) % window.requestParameterMunges.length; console.warn('IITC munge issue - cycling to set '+window.activeRequestMungeSet); diff --git a/code/utils_misc.js b/code/utils_misc.js index d2a5a807..1da80f29 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -96,88 +96,22 @@ window.digits = function(d) { window.requestParameterMunges = [ -// set 0 and 1 were brought online at the same time - an attempt to confuse us, or others hacking on the web interface? - // set 0 -// { -// method: '4kr3ofeptwgary2j', -// boundsParamsList: 'n27qzc8389kgakyv', -// id: '39031qie1i4aq563', -// minLatE6: 'pg98bwox95ly0ouu', -// minLngE6: 'eib1bkq8znpwr0g7', -// maxLatE6: 'ilfap961rwdybv63', -// maxLngE6: 'lpf7m1ifx0ieouzq', -// timestampMs: '2ewujgywmum1yp49', -// qk: 'bgxibcomzoto63sn', -// desiredNumItems: 'tmb0vgxgp5grsnhp', -// minTimestampMs: 'hljqffkpwlx0vtjt', -// maxTimestampMs: 'sw317giy6x2xj9zm', -// guids: 'pusjrhxxtyp5nois', -// inviteeEmailAddress: 'cltkepgqkepfsyaq', -// message: 'q0d6n7t1801bb6xu', -// latE6: '5ygbhpxfnt1u9e4t', -// lngE6: 'ak6twnljwwcgd7cj', -// factionOnly: '0dvtbatgzcfccchh', -// ascendingTimestampOrder: 'f6u1iqep9s2lc5y5' -// }, + // now obsolete (they don't have some of the new parameters) munge sets deleted - // set 1 -// { -// method: 'uuo2zqhhy5bw80fu', -// boundsParamsList: '5rc0561uauf6x13u', -// id: 'bzeizowtguoyrrtt', -// minLatE6: '7qej3eqg4sefuaac', -// minLngE6: 'yqegc976egk5q9vo', -// maxLatE6: '2odsgh99ix9bbtsb', -// maxLngE6: 'g9jess8dwa2j8pwi', -// timestampMs: '604f34zcu9zna0a5', -// qk: 'y853tux9h7cb6xp3', -// desiredNumItems: 'sfv5i7l6ouljz8vf', -// minTimestampMs: 'y3g07dbnw6sklloj', -// maxTimestampMs: '3pdl28aa27xvyhke', -// guids: 'xp1pl2jm5hrh3bna', -// inviteeEmailAddress: '2pyrttrp3gh38mmu', -// message: 'zz54435vfc57nlg9', -// latE6: 'cyltxjod3jhxgj8q', -// lngE6: 'h9whcgcz6kpqkz80', -// factionOnly: '37okcr7gvd5yn2lj', -// ascendingTimestampOrder: 'iimftkq7flskwrx9' -// }, - - // set 2 - first seen 2013-09-12 21:30 - // (very briefly - and removed a few hours later) -// { -// method: '42suxeca8ttud7je', -// boundsParamsList: '5uwd21hkedg3zh2c', -// id: 'drtt302ebaj6ek2g', -// minLatE6: 'l933r0l8brrt1x5b', -// minLngE6: 'qg3xb340zed41jof', -// maxLatE6: 'sw485z1n3tusdkul', -// maxLngE6: '6meahm3f9xup9krb', -// timestampMs: '6meahm3f9xup9krb', -// qk: 'fpi9b1z0os0x9yjj', -// desiredNumItems: 'inr3js77cetyibi6', -// minTimestampMs: 'zfb2e5iqmggrxe98', -// maxTimestampMs: '8c4imy17gfpfrl9l', -// guids: '5d5hp2p3rkmanqn7', -// inviteeEmailAddress: 'i1a5yp6p1l6iqk08', -// message: 'xzhbk3ri04lx9xvj', -// latE6: 'njg0zny4fb39mf0a', -// lngE6: 'ti2rx4ltmg6d1zsr', -// factionOnly: 'jegpo8rwhtuuuuhh', -// ascendingTimestampOrder: '1ennke6gykwzziun', -// // in this set, also the request method names are obsfucated! -// 'dashboard.getThinnedEntitiesV4': 'ufxcmvve3eirsf2b', -// 'dashboard.getPaginatedPlextsV2': 'd9dgziiw8vzhyecv', -// 'dashboard.getPlayersByGuids': 's53izqpxedtd0hv8', -// 'dashboard.sendInviteEmail': 'kn9plnbree2aeuh9', -// 'dashboard.redeemReward': 'les8vribyxb899wd', -// 'dashboard.sendPlext': '9u1ukkkx1euxf02a' -// }, // set 3 - in the update of 2013-09-30 (addition of 'alerts' chat tab) { + 'dashboard.getGameScore': 'fhlzntzkl5v7hcfh', // GET_GAME_SCORE + 'dashboard.getPaginatedPlextsV2': 'wzuitnswoda7w028', // GET_PAGINATED_PLEXTS + 'dashboard.getThinnedEntitiesV4': 'scgrm4lf2371esgw', // GET_THINNED_ENTITIES + 'dashboard.getPlayersByGuids': '81l6usczczoi3lfi', // LOOKUP_PLAYERS + 'dashboard.redeemReward': '8kop2koeld9b4c26', // REDEEM_REWARD + 'dashboard.sendInviteEmail': 't0ccodsm1nuo5uso', // SEND_INVITE_EMAIL + 'dashboard.sendPlext': 'k04cfjwwsg3h3827', // SEND_PLEXT + method: '22ux2z96jwq5zn78', version: 'kf6hgl9yau03ws0o', //guessed parameter name - only seen munged + version_parameter: '4608f4356a6f55690f127fb542f557f98de66169', // passed as the value to the above parameter boundsParamsList: '29t16cmsn6l3r2xg', id: '7rogqhp5pzcqobcw', minLatE6: 'yzbnp7z9bd28p0yr', @@ -190,36 +124,65 @@ window.requestParameterMunges = [ minTimestampMs: 's9jf2seni33y3gyu', maxTimestampMs: '2kh3vti98rhp3g29', chatTab: '7n7ocqfq1p18352b', //guessed parameter name - only seen munged - guids: '5hyiwhwc0jyljvro', - inviteeEmailAddress: 's9z6zt03eymzxhkj', + ascendingTimestampOrder: 'p88a2ztchtjhiazl', message: 'e8qm0kptw2trrcrw', latE6: 'fja1phtsqxm71dqm', lngE6: 'iut1tb7c0x726hwn', - ascendingTimestampOrder: 'p88a2ztchtjhiazl', - // in this set, also the request method names are obsfucated! - 'dashboard.getGameScore': 'fhlzntzkl5v7hcfh', // GET_GAME_SCORE - 'dashboard.getPaginatedPlextsV2': 'wzuitnswoda7w028', // GET_PAGINATED_PLEXTS - 'dashboard.getThinnedEntitiesV4': 'scgrm4lf2371esgw', // GET_THINNED_ENTITIES - 'dashboard.getPlayersByGuids': '81l6usczczoi3lfi', // LOOKUP_PLAYERS - 'dashboard.redeemReward': '8kop2koeld9b4c26', // REDEEM_REWARD - 'dashboard.sendInviteEmail': 't0ccodsm1nuo5uso', // SEND_INVITE_EMAIL - 'dashboard.sendPlext': 'k04cfjwwsg3h3827' // SEND_PLEXT + guids: '5hyiwhwc0jyljvro', + inviteeEmailAddress: 's9z6zt03eymzxhkj', }, + + // set 4 - second update of 2013-09-30 + { + 'dashboard.getGameScore': 'ija9jgrf5hj7wm9r', // GET_GAME_SCORE + 'dashboard.getPaginatedPlextsV2': '0elftx739mkbzi1b', // GET_PAGINATED_PLEXTS + 'dashboard.getThinnedEntitiesV4': 'prv0ez8cbsykh63g', // GET_THINNED_ENTITIES + 'dashboard.getPlayersByGuids': 'i0lxy6nc695z9ka3', // LOOKUP_PLAYERS + 'dashboard.redeemReward': '376oivna8rf8qbfj', // REDEEM_REWARD + 'dashboard.sendInviteEmail': '96y930v5q96nrcrw', // SEND_INVITE_EMAIL + 'dashboard.sendPlext': 'c04kceytofuqvyqg', // SEND_PLEXT + + method: '9we4b31i48ui4sdm', + version: 'q402kn5zqisuo1ym', //guessed parameter name - only seen munged + version_parameter: 'dbad4485024d446ae946e3d287b5d640029ef3e3', // passed as the value to the above parameter + boundsParamsList: '3r5ctyvc2f653zjd', + id: 'izey8ciqg2dz2oqc', + minLatE6: 'cein0n4jrifa7ui2', + minLngE6: 'lbd1juids3johtdo', + maxLatE6: 'h4kyot9kmvd3g284', + maxLngE6: 'sbci6jjc2d5g9uy4', + timestampMs: '2wurn9giagbvv6bt', + qk: 'hq73mwpjqyvcp6ul', + desiredNumItems: 'kyo6vh5n58hmrnua', + minTimestampMs: 'hu4swdftcp7mvkdi', + maxTimestampMs: 'ly6ylae5lv1z9072', + chatTab: 'q5kxut5rmbtlqbf9', //guessed parameter name - only seen munged + ascendingTimestampOrder: 'hvfd0io35rahwjgr', + message: 'z4hf7tzl27o14455', + latE6: 'zyzh3bdxyd47vk1x', + lngE6: 'n5d1f8pql51t641x', + guids: 'gl16ehqoc3i3oi07', + inviteeEmailAddress: 'orc9ufg7rp7g1y9j', + }, + ]; window.activeRequestMungeSet = undefined; // attempt to guess the munge set in use, by looking therough the functions of the stock intel page for one of the munged params window.detectActiveMungeSet = function() { - for (var m in window) { - // try and find the stock page functions - if (typeof window[m] == 'function') { - var stockFunc = window[m].toString(); - for (var i in window.requestParameterMunges) { - if (stockFunc.indexOf (window.requestParameterMunges[i]['method']) >= 0) { - console.log('IITC: found request munge set '+i+' in stock intel function "window.'+m+'()"'); - window.activeRequestMungeSet = i; - } - } + if (window.requestParameterMunges.length == 1) { + // no point in searching through the code when there's only one set in use + window.activeRequestMungeSet = 0; + return; + } + + // try and find the stock page functions + // FIXME? revert to searching through all the code? is that practical? + var stockFunc = nemesis.dashboard.network.DataFetcher.prototype.sendRequest_.toString() + for (var i in window.requestParameterMunges) { + if (stockFunc.indexOf (window.requestParameterMunges[i]['method']) >= 0) { + console.log('IITC: found request munge set index '+i+' in stock intel function nemesis.dashboard.network.DataFetcher.prototype.sendRequest_'); + window.activeRequestMungeSet = i; } } @@ -281,9 +244,13 @@ window.postAjax = function(action, data, success, error) { var activeMunge = window.requestParameterMunges[window.activeRequestMungeSet]; var methodName = 'dashboard.'+action; - var versionStr = "4608f4356a6f55690f127fb542f557f98de66169"; // unsure of parameter value meaning. appears to be a constant used as a 'version'. added to all requests along with the method name in the stock site - // optional munging of the method name - seen in Set 2 (onwards?) - if (methodName in activeMunge) methodName = activeMunge[methodName]; + var versionStr = 'version_parameter'; + + // munging of the method name - seen in Set 2 (onwards?) + methodName = activeMunge[methodName]; + // and of the 'version' parameter + versionStr = activeMunge[versionStr]; + var post_data = JSON.stringify(window.requestDataMunge($.extend({method: methodName, version: versionStr}, data))); var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); }; var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); }; From 90a3ae7348861f9a04888db5832dee870e0adf0b Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Tue, 1 Oct 2013 03:22:45 +0200 Subject: [PATCH 12/14] fixed typo --- website/page/faq.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/page/faq.php b/website/page/faq.php index f32d4843..c5d2572a 100644 --- a/website/page/faq.php +++ b/website/page/faq.php @@ -68,7 +68,7 @@ From here you can remove/disable individual plugins or IITC itself.

Is it possible to add external plugins to IITC Mobile?

Yes it is!
    -
  • Create a folder named "IITC Mobile" in your home directory.
  • +
  • Create a folder named "IITC_Mobile" in your home directory.
  • Inside this folder, create a new folder named "plugins".
  • Copy all your additional plugins to this folder.
  • You should see your plugins listed above the official plugins.
  • From 08d91218f5b7a699c118b549f1b6734d51263b3d Mon Sep 17 00:00:00 2001 From: 3ch01c <3ch01c@gmail.com> Date: Wed, 28 May 2014 23:26:27 -0600 Subject: [PATCH 13/14] unique portals plugin branch created --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index af7e35cf..1df2b76f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ localbuildsettings.py *.swp *~ *.bak +*.project From af1bc9006c207f2b877f0d3c9a7b0f935851701f Mon Sep 17 00:00:00 2001 From: 3ch01c <3ch01c@gmail.com> Date: Sat, 31 May 2014 00:09:18 -0600 Subject: [PATCH 14/14] Fixed Realtime API sync issue --- .gitignore | 1 + plugins/unique.css | 17 ++++ plugins/uniques.user.js | 216 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 plugins/unique.css create mode 100644 plugins/uniques.user.js diff --git a/.gitignore b/.gitignore index 1df2b76f..55ccd51b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ localbuildsettings.py *~ *.bak *.project +.pydevproject diff --git a/plugins/unique.css b/plugins/unique.css new file mode 100644 index 00000000..f5454699 --- /dev/null +++ b/plugins/unique.css @@ -0,0 +1,17 @@ +#uniques-content-outer { + display: table; + width: 100%; + height: 26px; + text-align: center; +} + +#uniques-content-outer > div{ + display: inline-block; + vertical-align: middle; + margin: 6px 3px 1px 3px; +} + +#uniques-label { + padding: 0 4px; + cursor: help; +} diff --git a/plugins/uniques.user.js b/plugins/uniques.user.js new file mode 100644 index 00000000..7b838020 --- /dev/null +++ b/plugins/uniques.user.js @@ -0,0 +1,216 @@ +//==UserScript== +//@id iitc-plugin-uniques@3ch01c +//@name IITC plugin: Uniques +//@category Misc +//@version 0.2.0.@@DATETIMEVERSION@@ +//@namespace https://github.com/3ch01c/ingress-intel-total-conversion +//@updateURL @@UPDATEURL@@ +//@downloadURL @@DOWNLOADURL@@ +//@description [@@BUILDNAME@@-@@BUILDDATE@@] Allow manual entry of portals hacked/captured. Use the 'highlighter-uniques' plugin to show the uniques on the map, and 'sync' to share between multiple browsers or desktop/mobile. +//@include https://www.ingress.com/intel* +//@include http://www.ingress.com/intel* +//@match https://www.ingress.com/intel* +//@match http://www.ingress.com/intel* +//@grant none +//==/UserScript== + +@@PLUGINSTART@@ +//PLUGIN START //////////////////////////////////////////////////////// + +//use own namespace for plugin +window.plugin.uniques = function() {}; + +//delay in ms +window.plugin.uniques.SYNC_DELAY = 10000; + +window.plugin.uniques.LOCAL_STORAGE_KEY = 'plugin-uniques-data'; + +window.plugin.uniques.KEY = {key: window.plugin.uniques.LOCAL_STORAGE_KEY, field: 'uniques'}; +window.plugin.uniques.UPDATE_QUEUE = {key: 'plugin-uniques-data-queue', field: 'updateQueue'}; +window.plugin.uniques.UPDATING_QUEUE = {key: 'plugin-uniques-data-updating-queue', field: 'updatingQueue'}; + +window.plugin.uniques.uniques = {}; +window.plugin.uniques.updateQueue = {}; +window.plugin.uniques.updatingQueue = {}; + +window.plugin.uniques.enableSync = false; + +window.plugin.uniques.disabledMessage = null; +window.plugin.uniques.contentHTML = null; + +window.plugin.uniques.addToSidebar = function() { + if(typeof(Storage) === "undefined") { + $('#portaldetails > .imgpreview').after(plugin.uniques.disabledMessage); + return; + } + + $('#portaldetails > .imgpreview').after(plugin.uniques.contentHTML); + plugin.uniques.updateChecked(); +} + +window.plugin.uniques.updateChecked = function() { + var guid = window.selectedPortal, + hacked = (plugin.uniques.uniques[guid] && plugin.uniques.uniques[guid].hacked) || false, + captured = (plugin.uniques.uniques[guid] && plugin.uniques.uniques[guid].captured) || false; + $('#hacked').prop('checked', hacked); + $('#captured').prop('checked', captured); +} + +window.plugin.uniques.updateHacked = function(hacked) { + var guid = window.selectedPortal; + if (hacked) { + // add entry + if (guid in plugin.uniques.uniques) { plugin.uniques.uniques[guid].hacked = true; } + else { plugin.uniques.uniques[guid] = {hacked: true}; } + if (guid in plugin.uniques.updateQueue) { plugin.uniques.updateQueue[guid].hacked = true; } + else { plugin.uniques.updateQueue[guid] = {hacked: true}; } + } else if (guid in plugin.uniques.uniques) { + // remove entry + if (plugin.uniques.uniques[guid].captured === undefined) { delete plugin.uniques.uniques[guid]; } + else { delete plugin.uniques.uniques[guid].hacked; } + } + plugin.uniques.storeLocal(plugin.uniques.KEY); + plugin.uniques.storeLocal(plugin.uniques.UPDATE_QUEUE); + plugin.uniques.delaySync(); +} + +window.plugin.uniques.updateCaptured = function(captured) { + var guid = window.selectedPortal; + if (captured) { + // add entry + if (guid in plugin.uniques.uniques) { plugin.uniques.uniques[guid].captured = true; } + else { plugin.uniques.uniques[guid] = {captured: true}; } + if (guid in plugin.uniques.updateQueue) { plugin.uniques.updateQueue[guid].captured = true; } + else { plugin.uniques.updateQueue[guid] = {captured: true}; } + } else if (guid in plugin.uniques.uniques) { + // remove entry + if (plugin.uniques.uniques[guid].captured === undefined) { delete plugin.uniques.uniques[guid]; } + else { delete plugin.uniques.uniques[guid].captured; } + } + plugin.uniques.storeLocal(plugin.uniques.KEY); + plugin.uniques.storeLocal(plugin.uniques.UPDATE_QUEUE); + plugin.uniques.delaySync(); +} + +//Delay the syncing to group a few updates in a single request +window.plugin.uniques.delaySync = function() { + if(!plugin.uniques.enableSync) return; + clearTimeout(plugin.uniques.delaySync.timer); + plugin.uniques.delaySync.timer = setTimeout(function() { + plugin.uniques.delaySync.timer = null; + window.plugin.uniques.syncNow(); + }, plugin.uniques.SYNC_DELAY); +} + +//Store the updateQueue in updatingQueue and upload +window.plugin.uniques.syncNow = function() { + if(!plugin.uniques.enableSync) return; + $.extend(plugin.uniques.updatingQueue, plugin.uniques.updateQueue); + plugin.uniques.updateQueue = {}; + plugin.uniques.storeLocal(plugin.uniques.UPDATING_QUEUE); + plugin.uniques.storeLocal(plugin.uniques.UPDATE_QUEUE); + + plugin.sync.updateMap('uniques', 'uniques', plugin.uniques.updatingQueue); +} + +//Call after IITC and all plugin loaded +window.plugin.uniques.registerFieldForSyncing = function() { + if(!window.plugin.sync) return; + window.plugin.sync.registerMapForSync('uniques', 'uniques', window.plugin.uniques.syncCallback, window.plugin.uniques.syncInitialed); +} + +//Call after local or remote change uploaded +window.plugin.uniques.syncCallback = function(pluginName, fieldName, e, fullUpdated) { + if(fieldName === 'uniques') { + plugin.uniques.storeLocal(plugin.uniques.KEY); + // All data is replaced if other client update the data during this client + // offline, + // fire 'pluginUniquesRefreshAll' to notify a full update + if(fullUpdated) { + plugin.uniques.updateChecked(); + window.runHooks('pluginUniquesRefreshAll'); + return; + } + + if(!e) return; + if(e.isLocal) { + // Update pushed successfully, remove it from updatingQueue + delete plugin.uniques.updatingQueue[e.property]; + } else { + // Remote update + delete plugin.uniques.updateQueue[e.property]; + plugin.uniques.storeLocal(plugin.uniques.UPDATE_QUEUE); + plugin.uniques.updateChecked(); + window.runHooks('pluginUniquesUpdateUniques', {guid: e.property}); + } + } +} + +//syncing of the field is initialed, upload all queued update +window.plugin.uniques.syncInitialed = function(pluginName, fieldName) { + if(fieldName === 'uniques') { + plugin.uniques.enableSync = true; + if(Object.keys(plugin.uniques.updateQueue).length > 0) { + plugin.uniques.delaySync(); + } + } +} + +window.plugin.uniques.storeLocal = function(mapping) { + if(typeof(plugin.uniques[mapping.field]) !== 'undefined' && plugin.uniques[mapping.field] !== null) { + localStorage[mapping.key] = JSON.stringify(plugin.uniques[mapping.field]); + } else { + localStorage.removeItem(mapping.key); + } +} + +window.plugin.uniques.loadLocal = function(mapping) { + if (localStorage[mapping.key] !== undefined) { plugin.uniques[mapping.field] = JSON.parse(localStorage[mapping.key]); } +} + +/***************************************************************************************************************************************************************/ +/** HIGHLIGHTER ************************************************************************************************************************************************/ +/***************************************************************************************************************************************************************/ +window.plugin.uniques.highlight = function(data) { + var guid = data.portal.options.ent[0]; + if((uniqueInfo = window.plugin.uniques.uniques[guid]) !== undefined) { + if (!uniqueInfo.hacked && !uniqueInfo.captured) { data.portal.setStyle({fillColor:'magenta', fillOpacity:1}); } + else if (uniqueInfo.captured && !uniqueInfo.hacked) { data.portal.setStyle({fillColor:'red', fillOpacity:.75}); } + else if (uniqueInfo.hacked && !uniqueInfo.captured) { data.portal.setStyle({fillColor:'yellow', fillOpacity:.5}); } + } else { + data.portal.setStyle({fillColor:'magenta', fillOpacity:1}); + } +} + +window.plugin.uniques.setupCSS = function() { + $("