quick hack fix, done right

niantic removed the list of protected methods - all methods are protected
there's still a short list of group-a protected, with the rest being group-b
This commit is contained in:
Jon Atkins 2014-11-07 20:33:47 +00:00
parent 33c158b194
commit e2e2f09e94
2 changed files with 19 additions and 20 deletions

View File

@ -139,15 +139,15 @@ iitc_bg.get_method_group = function(method) {
//NOTE: stock site has separate test for 'is any group' - IITC combines it into this one function that returns //NOTE: stock site has separate test for 'is any group' - IITC combines it into this one function that returns
// undefined for no group // undefined for no group
if (window.niantic_params.botguard_protected_methods.indexOf(method) != -1) { // if (window.niantic_params.botguard_protected_methods.indexOf(method) != -1) {
if (window.niantic_params.botguard_group_a_methods.indexOf(method) != -1) { if (window.niantic_params.botguard_group_a_methods.indexOf(method) != -1) {
return "group-a-actions"; return "group-a-actions";
} else { } else {
return "group-b-actions"; return "group-b-actions";
} }
} // }
// method is not of any group // // method is not of any group
return undefined; // return undefined;
}; };

View File

@ -73,7 +73,7 @@ window.extractFromStock = function() {
// there are two. both contain a list of method names - one is the list of methods protected by either // there are two. both contain a list of method names - one is the list of methods protected by either
// botguard group-a or group-b, while the others is just a list of those in one group // botguard group-a or group-b, while the others is just a list of those in one group
window.niantic_params.botguard_protected_methods = []; // window.niantic_params.botguard_protected_methods = [];
window.niantic_params.botguard_group_a_methods = []; window.niantic_params.botguard_group_a_methods = [];
var countMethods = function(arr) { var countMethods = function(arr) {
@ -87,26 +87,25 @@ window.extractFromStock = function() {
return count; return count;
} }
var protectedMethodsCount = 0; // var protectedMethodsCount = 0;
var groupMethodsCount = 0; var groupMethodsCount = 0;
for (var i in arrays) { for (var i in arrays) {
var arr = arrays[i]; var arr = arrays[i];
var arrCount = countMethods(arr); var arrCount = countMethods(arr);
// now store the longest in niantic_params.botguard_protected_methods, and 2nd longest in .niantic_params.botguard_group_a_methods // if (arrCount > protectedMethodsCount) {
// // longest found - copy any existing longest to the 2nd longest
if (arrCount > protectedMethodsCount) { //
// longest found - copy any existing longest to the 2nd longest // window.niantic_params.botguard_group_a_methods = window.niantic_params.botguard_protected_methods;
// groupMethodsCount = protectedMethodsCount;
window.niantic_params.botguard_group_a_methods = window.niantic_params.botguard_protected_methods; //
groupMethodsCount = protectedMethodsCount; // //... and set the longest
// window.niantic_params.botguard_protected_methods = arr;
//... and set the longest // protectedMethodsCount = arrCount;
window.niantic_params.botguard_protected_methods = arr; //
protectedMethodsCount = arrCount; // } else
if (arrCount > groupMethodsCount) {
} else if (arrCount > groupMethodsCount) {
// 2nd longest - store // 2nd longest - store
window.niantic_params.botguard_group_a_methods = arr; window.niantic_params.botguard_group_a_methods = arr;
groupMethodsCount = arrCount; groupMethodsCount = arrCount;
@ -115,7 +114,7 @@ window.extractFromStock = function() {
} }
if (niantic_params.CURRENT_VERSION === undefined || window.niantic_params.botguard_protected_methods.length == 0) { if (niantic_params.CURRENT_VERSION === undefined || window.niantic_params.botguard_group_a_methods.length == 0) {
dialog({ dialog({
title: 'IITC Broken', title: 'IITC Broken',
html: '<p>IITC failed to extract the required parameters from the intel site</p>' html: '<p>IITC failed to extract the required parameters from the intel site</p>'