// decode the on-network array entity format into an object format closer to that used before // makes much more sense as an object, means that existing code didn't need to change, and it's what the // stock intel site does internally too (the array format is only on the network) // anonymous wrapper function (function(){ window.decodeArray = function(){}; function parseMod(arr) { if(arr == null) { return null; } return { owner: arr[0], name: arr[1], rarity: arr[2], stats: arr[3], }; } function parseResonator(arr) { if(arr == null) { return null; } return { owner: arr[0], level: arr[1], energy: arr[2], }; } function parseArtifactBrief(arr) { if (arr === null) return null; // array index 0 is for fragments at the portal. index 1 is for target portals // each of those is two dimensional - not sure why. part of this is to allow for multiple types of artifacts, // with their own targets, active at once - but one level for the array is enough for that // making a guess - first level is for different artifact types, second index would allow for // extra data for that artifact type function decodeArtifactArray(arr) { var result = {}; for (var i=0; i