first pass of fixes for 2014-05-23
still need to fix name changes in response for portal details
This commit is contained in:
parent
4cc3cbbfc5
commit
589fd83b93
16
code/chat.js
16
code/chat.js
@ -72,7 +72,7 @@ window.chat.genPostData = function(isFaction, storageHash, getOlderMsgs) {
|
||||
var ne = b.getNorthEast();
|
||||
var sw = b.getSouthWest();
|
||||
var data = {
|
||||
desiredNumItems: isFaction ? CHAT_FACTION_ITEMS : CHAT_PUBLIC_ITEMS ,
|
||||
// desiredNumItems: isFaction ? CHAT_FACTION_ITEMS : CHAT_PUBLIC_ITEMS ,
|
||||
minLatE6: Math.round(sw.lat*1E6),
|
||||
minLngE6: Math.round(sw.lng*1E6),
|
||||
maxLatE6: Math.round(ne.lat*1E6),
|
||||
@ -141,12 +141,12 @@ window.chat._faction = {data:{}, oldestTimestamp:-1, newestTimestamp:-1};
|
||||
window.chat.handleFaction = function(data, olderMsgs) {
|
||||
chat._requestFactionRunning = false;
|
||||
|
||||
if(!data || !data.result) {
|
||||
if(!data || !data.success) {
|
||||
window.failedRequestCount++;
|
||||
return console.warn('faction chat error. Waiting for next auto-refresh.');
|
||||
}
|
||||
|
||||
if(data.result.length === 0) return;
|
||||
if(data.success.length === 0) return;
|
||||
|
||||
var old = chat._faction.oldestTimestamp;
|
||||
chat.writeDataToHash(data, chat._faction, false, olderMsgs);
|
||||
@ -156,7 +156,7 @@ window.chat.handleFaction = function(data, olderMsgs) {
|
||||
|
||||
window.chat.renderFaction(oldMsgsWereAdded);
|
||||
|
||||
if(data.result.length >= CHAT_FACTION_ITEMS) chat.needMoreMessages();
|
||||
if(data.success.length >= CHAT_FACTION_ITEMS) chat.needMoreMessages();
|
||||
}
|
||||
|
||||
window.chat.renderFaction = function(oldMsgsWereAdded) {
|
||||
@ -191,12 +191,12 @@ window.chat._public = {data:{}, oldestTimestamp:-1, newestTimestamp:-1};
|
||||
window.chat.handlePublic = function(data, olderMsgs) {
|
||||
chat._requestPublicRunning = false;
|
||||
|
||||
if(!data || !data.result) {
|
||||
if(!data || !data.success) {
|
||||
window.failedRequestCount++;
|
||||
return console.warn('public chat error. Waiting for next auto-refresh.');
|
||||
}
|
||||
|
||||
if(data.result.length === 0) return;
|
||||
if(data.success.length === 0) return;
|
||||
|
||||
var old = chat._public.oldestTimestamp;
|
||||
chat.writeDataToHash(data, chat._public, true, olderMsgs);
|
||||
@ -210,7 +210,7 @@ window.chat.handlePublic = function(data, olderMsgs) {
|
||||
case 'full': window.chat.renderFull(oldMsgsWereAdded); break;
|
||||
}
|
||||
|
||||
if(data.result.length >= CHAT_PUBLIC_ITEMS) chat.needMoreMessages();
|
||||
if(data.success.length >= CHAT_PUBLIC_ITEMS) chat.needMoreMessages();
|
||||
}
|
||||
|
||||
window.chat.renderPublic = function(oldMsgsWereAdded) {
|
||||
@ -258,7 +258,7 @@ window.chat.nicknameClicked = function(event, nickname) {
|
||||
}
|
||||
|
||||
window.chat.writeDataToHash = function(newData, storageHash, isPublicChannel, isOlderMsgs) {
|
||||
$.each(newData.result, function(ind, json) {
|
||||
$.each(newData.success, function(ind, json) {
|
||||
// avoid duplicates
|
||||
if(json[0] in storageHash.data) return true;
|
||||
|
||||
|
@ -91,13 +91,14 @@ function extractMungeFromStock() {
|
||||
// the rest are trickier - we need to parse the functions of the stock site. these break very often
|
||||
// on site updates
|
||||
|
||||
// regular expression - to match either x.abcdef123456wxyz or x["123456abcdefwxyz"] format for property access
|
||||
var mungeRegExpProp = '(?:\\.([a-z][a-z0-9]{15})|\\["([0-9][a-z0-9]{15})"\\])';
|
||||
// and one to match members of object literal initialisation - {abcdef123456wxyz: or {"123456abcdefwxyz":
|
||||
var mungeRegExpLit = '(?:([a-z][a-z0-9]{15})|"([0-9][a-z0-9]{15})"):';
|
||||
// // regular expression - to match either x.abcdef123456wxyz or x["123456abcdefwxyz"] format for property access
|
||||
// var mungeRegExpProp = '(?:\\.([a-z][a-z0-9]{15})|\\["([0-9][a-z0-9]{15})"\\])';
|
||||
// // and one to match members of object literal initialisation - {abcdef123456wxyz: or {"123456abcdefwxyz":
|
||||
// var mungeRegExpLit = '(?:([a-z][a-z0-9]{15})|"([0-9][a-z0-9]{15})"):';
|
||||
|
||||
// some cases don't munge now?!?! odd!
|
||||
var mungeRegExpLitOrUnmunged = '(?:((?:[a-z][a-z0-9]{15})|message|latE6|lngE6|tab|guid)|"([0-9][a-z0-9]{15})"):';
|
||||
var mungeRegExpProp = '(?:\\.([a-z][a-z0-9]{15}|[a-z][a-zA-Z0-9]*)|\\["([0-9][a-z0-9]{15})"\\])';
|
||||
var mungeRegExpLit = '(?:((?:[a-z][a-z0-9]{15})|[a-z][a-zA-Z0-9]*)|"([0-9][a-z0-9]{15})"):';
|
||||
|
||||
// common parameters - method, version, version_parameter - currently found in the
|
||||
// nemesis.dashboard.network.XhrController.prototype.doSendRequest_ function
|
||||
@ -119,8 +120,7 @@ function extractMungeFromStock() {
|
||||
foundMunges.quadKeys = result[1] || result[2];
|
||||
|
||||
// GET_PAGINATED_PLEXTS
|
||||
var reg = new RegExp('[a-z] = {'+mungeRegExpLit+'[a-z], '
|
||||
+mungeRegExpLit+'Math.round\\(1E6 \\* [a-z].bounds.sw.lat\\(\\)\\), '
|
||||
var reg = new RegExp('[a-z] = {'+mungeRegExpLit+'Math.round\\(1E6 \\* [a-z].bounds.sw.lat\\(\\)\\), '
|
||||
+mungeRegExpLit+'Math.round\\(1E6 \\* [a-z].bounds.sw.lng\\(\\)\\), '
|
||||
+mungeRegExpLit+'Math.round\\(1E6 \\* [a-z].bounds.ne.lat\\(\\)\\), '
|
||||
+mungeRegExpLit+'Math.round\\(1E6 \\* [a-z].bounds.ne.lng\\(\\)\\), '
|
||||
@ -130,23 +130,23 @@ function extractMungeFromStock() {
|
||||
|
||||
var result = reg.exec(nemesis.dashboard.network.PlextStore.prototype.getPlexts.toString());
|
||||
|
||||
foundMunges.desiredNumItems = result[1] || result[2];
|
||||
// foundMunges.desiredNumItems = result[1] || result[2];
|
||||
|
||||
foundMunges.minLatE6 = result[3] || result[4];
|
||||
foundMunges.minLngE6 = result[5] || result[6];
|
||||
foundMunges.maxLatE6 = result[7] || result[8];
|
||||
foundMunges.maxLngE6 = result[9] || result[10];
|
||||
foundMunges.minTimestampMs = result[11] || result[12];
|
||||
foundMunges.maxTimestampMs = result[13] || result[14];
|
||||
foundMunges.chatTabGet = result[15] || result[16]; //guessed parameter name - only seen munged
|
||||
foundMunges.ascendingTimestampOrder = result[17] || result[18];
|
||||
foundMunges.minLatE6 = result[1] || result[2];
|
||||
foundMunges.minLngE6 = result[3] || result[4];
|
||||
foundMunges.maxLatE6 = result[5] || result[6];
|
||||
foundMunges.maxLngE6 = result[7] || result[8];
|
||||
foundMunges.minTimestampMs = result[9] || result[10];
|
||||
foundMunges.maxTimestampMs = result[11] || result[12];
|
||||
foundMunges.chatTabGet = result[13] || result[14]; //guessed parameter name - only seen munged
|
||||
foundMunges.ascendingTimestampOrder = result[15] || result[16];
|
||||
|
||||
// SEND_PLEXT
|
||||
var reg = new RegExp('SEND_PLEXT, nemesis.dashboard.network.XhrController.Priority.[A-Z]+, {'
|
||||
+mungeRegExpLitOrUnmunged+'[a-z], '
|
||||
+mungeRegExpLitOrUnmunged+'[a-z], '
|
||||
+mungeRegExpLitOrUnmunged+'[a-z], '
|
||||
+mungeRegExpLitOrUnmunged+'[a-z]}');
|
||||
+mungeRegExpLit+'[a-z], '
|
||||
+mungeRegExpLit+'[a-z], '
|
||||
+mungeRegExpLit+'[a-z], '
|
||||
+mungeRegExpLit+'[a-z]}');
|
||||
var result = reg.exec(nemesis.dashboard.network.PlextStore.prototype.sendPlext.toString());
|
||||
|
||||
foundMunges.messageSendPlext = result[1] || result[2];
|
||||
@ -157,7 +157,7 @@ function extractMungeFromStock() {
|
||||
|
||||
// GET_PORTAL_DETAILS
|
||||
var reg = new RegExp('GET_PORTAL_DETAILS, nemesis.dashboard.network.XhrController.Priority.[A-Z]+, {'
|
||||
+mungeRegExpLitOrUnmunged+'a}');
|
||||
+mungeRegExpLit+'a}');
|
||||
var result = reg.exec(nemesis.dashboard.network.DataFetcher.prototype.getPortalDetails.toString());
|
||||
foundMunges.guid = result[1] || result[2];
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// @id iitc-plugin-guess-player-levels@breunigs
|
||||
// @name IITC plugin: guess player level
|
||||
// @category Info
|
||||
// @version 0.5.2.@@DATETIMEVERSION@@
|
||||
// @version 0.5.3.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
@ -189,7 +189,7 @@ window.plugin.guessPlayerLevels.extractChatData = function(data) {
|
||||
attackData[nick][timestamp].push(portal);
|
||||
}
|
||||
|
||||
data.raw.result.forEach(function(msg) {
|
||||
data.raw.success.forEach(function(msg) {
|
||||
var plext = msg[2].plext;
|
||||
|
||||
// search for "x deployed an Ly Resonator on z"
|
||||
|
@ -2,7 +2,7 @@
|
||||
// @id iitc-plugin-player-tracker@breunigs
|
||||
// @name IITC Plugin: Player tracker
|
||||
// @category Layer
|
||||
// @version 0.10.2.@@DATETIMEVERSION@@
|
||||
// @version 0.10.3.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
@ -144,7 +144,7 @@ window.plugin.playerTracker.eventHasLatLng = function(ev, lat, lng) {
|
||||
|
||||
window.plugin.playerTracker.processNewData = function(data) {
|
||||
var limit = plugin.playerTracker.getLimit();
|
||||
$.each(data.raw.result, function(ind, json) {
|
||||
$.each(data.raw.success, function(ind, json) {
|
||||
// skip old data
|
||||
if(json[1] < limit) return true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user