diff --git a/code/extract_niantic_parameters.js b/code/extract_niantic_parameters.js index 9ca99b81..9561db8a 100644 --- a/code/extract_niantic_parameters.js +++ b/code/extract_niantic_parameters.js @@ -10,9 +10,6 @@ window.extractFromStock = function() { // extract the former nemesis.dashboard.config.CURRENT_VERSION from the code var reVersion = new RegExp('[a-z]=[a-z].getData\\(\\);[a-z].v="([a-f0-9]{40})";'); - // we also extract all top-level arrays of strings, for botguard - var arrays = []; - var minified = new RegExp('^[a-zA-Z$][a-zA-Z$0-9]$'); // required for botguard @@ -57,8 +54,66 @@ window.extractFromStock = function() { } } } + } //end 'if .prototype' + if (topObject && Array.isArray && Array.isArray(topObject)) { + // find all non-zero length arrays containing just numbers + if (topObject.length>0) { + var justInts = true; + for (var i=0; i= 15 && topObject.length <= 18) { + // a reasonable array length for tile parameters + // need to find two types: + // a. portal level limits. decreasing numbers, starting at 8 + // b. tiles per edge. increasing numbers. current max is 9000 + + if (topObject[0] == 8) { + // check for tile levels + var decreasing = true; + for (var i=1; i topObject[i]) { + increasing = false; + break; + } + } + if (increasing) { + console.log ('int array '+topLevel+' looks like TILES_PER_EDGE: '+JSON.stringify(topObject)); + window.niantic_params.TILES_PER_EDGE = topObject; + } + + } //end if (topObject[topObject.length-1] == 9000) { + + } + } + } + } + + // finding the required method names for the botguard interface code if(topObject && typeof topObject == "object" && Object.getPrototypeOf(topObject) == requestPrototype) { var methodKey = Object diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js index db1a0053..da273453 100755 --- a/code/map_data_calc_tools.js +++ b/code/map_data_calc_tools.js @@ -19,6 +19,11 @@ window.getMapZoomTileParameters = function(zoom) { // var ZOOM_TO_LEVEL = [8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1]; var ZOOM_TO_LEVEL = [8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 3, 2, 2, 1, 1]; + if (niantic_params.ZOOM_TO_LEVEL && niantic_params.TILES_PER_EDGE) { + ZOOM_TO_LEVEL = niantic_params.ZOOM_TO_LEVEL; + ZOOM_TO_TILES_PER_EDGE = niantic_params.TILES_PER_EDGE; + } + // the current API allows the client to request a minimum portal level. the ZOOM_TO_LEVEL list are minimums // however, in my view, this can return excessive numbers of portals in many cases. let's try an optional reduction // of detail level at some zoom levels