717 Commits

Author SHA1 Message Date
Jon Atkins
a9c9d5ff41 utility functions to
- get mods from portal details, filtered by type and sorted by strength
- get mitigation values
TODO: convert existing plugins to use these new functions
2013-09-18 07:45:30 +01:00
Jon Atkins
aad3c77ff9 add linkAdded and fieldAdded hooks, to mirror the portalAdded hook 2013-09-17 07:33:14 +01:00
Jon Atkins
40b653ae08 more tweaks, and some logging, to the enter/exit of idle mode 2013-09-17 02:25:17 +01:00
Jon Atkins
37131aaf8e move player name cache from localStorage to sessionStorage
this gives a simple method of expiring entries. also, prevents localStorage from filling up with thousands of player names over time
(ideally something controllable with configurable age should be used, but this was a quick and simple change to try first)
2013-09-16 22:22:19 +01:00
Jon Atkins
7165acd30e add a function to query if a player guid is for a system special account (e.g. __ADA__ or __JARVIS__, possibly others in future too - NIAOPS?) 2013-09-16 21:33:17 +01:00
Jon Atkins
9b3caa8eb9 add function to start 'idle' mode - for use in the mobile app (rather than it forcing the idle timer)
the existing idle resume function can be used on returning to iitc

also, fix the long-standing bug on mobile where the map disappears after repeated touch panning/zooming. seems leaflet gets confused about zoom levels and ends up with a non-ingeger. when this is found, force it back to an ingeger zoom level when this happens
2013-09-16 00:01:25 +01:00
Jon Atkins
79cd0132e7 add comment as a reminder of possible future work to clear 'faked' links earlier - if possible 2013-09-14 08:29:16 +01:00
Jon Atkins
68cf5d0aa4 fix idle resume sometimes triggering during an existing request 2013-09-14 08:28:24 +01:00
Jon Atkins
01fe9bf51c only add link entities to the layer if they're long enough to be visible
an improvement on 4838de6788ad27bbf6357e1ac9099744483a9e01 to prevent excessive links being drawn when lots of portals are loaded
2013-09-14 07:31:13 +01:00
Jon Atkins
4838de6788 create missing link data from portal link info - so short links not sent are shown in the map
note: need to add code to hide short links from the map - and update the shown/hidden links after a zoom
(similar to the portal cluster showing/hiding portals after a zoom)
2013-09-13 23:14:19 +01:00
Jon Atkins
f646f481fc use 'overlayadd/remove' instead of 'layeradd/remove' events. in theory should be more efficient as layeradd/remove gets called for every single portal/link/field/etc on the map 2013-09-13 23:12:49 +01:00
Xelio
7ce064399a Status persistence of Layer Chooser: Change to save status on 'overlayadd' and 'overlayremove' events. Instead of checking .overlay everytime a layer is added or removed. 2013-09-13 21:50:29 +08:00
Jon Atkins
af0bf6e6df also use munged RPC name in URL - as that's what the stock javescript does (as far as I can tell - it's stopped returning this munged version for now)
for #552
2013-09-13 03:34:52 +01:00
Jon Atkins
e9d173402b update munge sets for new one seen in the wild
also attempt to munge method names. this has not been tested though, as only my cron job has seen the new munge sets, not the browser
for #552
2013-09-13 00:12:54 +01:00
Philipp Schaefer
cc78717786 let farm_level_select work on mobile (fix for #548) 2013-09-12 14:36:24 +02:00
Jon Atkins
63467df342 add selected portal marker colour *after* running the portal highlighter
for #547
2013-09-12 06:57:50 +01:00
Jon Atkins
74cc365e9a faction layers - add/remove fields and links before portals - this way portals tend to remain above links/fields when things are toggled 2013-09-12 04:56:31 +01:00
Jon Atkins
f68153e1f5 add faction layer choosers
fix #536
2013-09-12 04:04:49 +01:00
Jon Atkins
ac6a235564 first stage of having faction-specific layers - portals, links and fields are now a layer group consisting of three faction-specific leaflet LayerGroups
also, move load.js from directly embedded in boot.js into an external file
2013-09-12 03:07:25 +01:00
Jon Atkins
9579ca8377 remove broken debug code - this didn't do anything useful after the render rewrite 2013-09-12 03:06:16 +01:00
Jon Atkins
9ee9380a2c Merge pull request #480 from fkloft/signout
Always show "sign out" link in IITCm.
2013-09-09 23:43:44 -07:00
Jon Atkins
543e586723 make (portals/lihnks/fields)Layers private to IITC core again - they're not for plugins
now only some portals are drawn to the map it's OK to bring them all to front at the end of the render
use larger squares for portal clustering on mobile - as the portal markers are larger
2013-09-08 20:43:23 +01:00
Jon Atkins
b83cf459c8 more tweaks to the request code
- delay briefly before retrying a timeout, and a bit longer before other errors
- also delay briefly before running the queue after a request, to give a chance of more than one request's requeued entries being handled atr once
- add a min tiles per request, to avoid sending multiple requests when only a few queued items remain
these are attempts to be nicer to the niantic servers, particularly in error cases, with some based on my best guess of the stock site behaviour, and others based on what seems reasonable to me
2013-09-06 22:32:57 +01:00
Jon Atkins
cb8547a0b9 refresh tweaks, reduced logging 2013-09-06 00:20:45 +01:00
Jon Atkins
7659cf4b84 slight improvement around the antimeridian - wrap the map centre so it's always between +-180 degrees
also limit north/south to 85 degrees, to avoid leaving the active map area
2013-09-05 23:12:18 +01:00
Jon Atkins
2f96b9d07c update lat/lng clamping, to take account of the map projection not going beyond 85 degrees north/south 2013-09-05 22:40:23 +01:00
Jon Atkins
7d3ca0972b better selected portal handling
- ensure the selected portal isn't deleted when it isn't in the map data (e.g. due to zoom level)
- always show the selected portal on the map, even if the high density clustering code would have removed it
- deselect the selected portal, and clear the details bar, in the rare instance of the portal being deleted server-side (i.e. in the deletedEntities list)
2013-09-05 22:14:52 +01:00
Jon Atkins
ac9d9cfaf0 trap exceptions when running hooks, log the error, and continue
should reduce issues caused when plugins are broken
2013-09-05 03:42:36 +01:00
Xelio
045db7fe90 Fix comment. 2013-09-05 02:32:59 +08:00
Xelio
8f1442e1dd Refactor code of select/unselect portal. Add hook 'portalSelected' with guid of selected and unselected portal. 2013-09-05 01:59:30 +08:00
Jon Atkins
a77cf50e42 more improvements to the data requesting
- fix idle resume, so it only occurs if the existing timer has been cancelled
- re-instate the cache, and updates for interface changes
- add a short delay between the initialisation of map data retreival, and actually starting network requests
2013-09-04 04:34:11 +01:00
Jon Atkins
4ccfbdfa45 re-tune the cache code so it's much more short-term storage
the original reason for longer term storage were the frequent error==TIMEOUT from map tiles. since these are now retried, as the stock site does, the remaining use for the cache is more short term, while panning around an area
2013-09-04 04:32:04 +01:00
Jon Atkins
76509f6b1f allow the in-ram cache to be optional, and disable it for now
the new tile retry code makes this cache much less useful now, so it ends up sucking up ram more than being useful
2013-09-04 00:56:29 +01:00
Jon Atkins
d14832d5c7 after map move, check to see if a refresh is actually required, or if the previous timeout can be restored 2013-09-03 21:38:19 +01:00
Jon Atkins
2f40571ee1 make chat code remember and restore the last chat tab used on reload 2013-09-03 19:40:49 +01:00
Jon Atkins
6e808e12a9 remove dead code
- guid to type - unused, and not a good way of doing the test
- resonator settings - it's now a separate plugin
2013-09-03 16:56:30 +01:00
Jon Atkins
98265766ec limit portals drawn to the map in dense areas, to avoid slowing down leaflet too much
unfortunately, this wasn't as much of a speed boost as i'd hoped. just downloading/processing the data for 20,000+ portals from the server, even if only 2000 are displayed, still takes a LONG time
for #526
2013-09-03 16:24:21 +01:00
Jon Atkins
c0015b16cc add a missing munge for ascendingTimestampOrder
(we don't currently use it so it was missed)
2013-09-03 16:23:22 +01:00
Jon Atkins
d976a8c033 on the portalAdded event, include a previousDetails parameter when we're changing an existing portals data
for #504
2013-09-03 04:52:10 +01:00
Jon Atkins
687162337c rename the 'default ingress map' to include 'Google' prefix, to make it clear it's a google map. should help troubleshooting relating to map layers, making it clear which are/aren't google ones 2013-09-03 01:56:03 +01:00
Jon Atkins
30ecb93b19 tile data cache - reduce size on mobile (due to limited RAM), and increase on desktop 2013-09-02 21:20:44 +01:00
Jon Atkins
a8516d92ff increase timers for loading map data - should be less aggresasive now.
still not 100% happy, but it's better...
2013-09-02 03:50:22 +01:00
Jon Atkins
2565478c1f add linkedFields data to portal.options.details.portalV2 - it's expected in a few places
(it shouldn't really be stored there - as other than this the data here mirrors precisely that returned from the server)
fix #519
2013-09-02 02:08:39 +01:00
Jon Atkins
7792c80274 increae the initial map data request delay - gives more chance for munge issues to be fixed in the game score update code 2013-08-31 17:44:51 +01:00
Jon Atkins
8448b71fae hacky workaround for request munging issues - check for issues in the updateGameStatus function 2013-08-31 17:44:16 +01:00
Jon Atkins
043690f99b attempt to detect the request munge set that's active by searching through the stock site functions 2013-08-31 16:40:28 +01:00
Jon Atkins
5b6ed4ce50 niantic have 'encrypted/obsfucated/munged' the parameters passed TO requests to the server - and changed the request URL from /rpc/dashboard.method to /r/dashboard.method
for #518
2013-08-31 04:34:37 +01:00
Jon Atkins
e1891f84df reduce the retry count on a non-"error:TIMEOUT" failed request 2013-08-31 01:43:14 +01:00
Jon Atkins
4a9fa8baea attempt to re-create missing links from the portal data
may not work, as this code was work-in-progress when niantic broke the json protocol
2013-08-31 01:42:31 +01:00
Jon Atkins
b8514ef3d0 tweak debug layer colours 2013-08-31 01:41:54 +01:00