Closed jonatkins closed 11 years ago
this is pretty much done now, and merged into the master branch
some cleanups are still required, but isn't that always the case with code...
Is it possible to expose the timers/thresholds used for automatic refreshes? During an attack I'd like to be able to set (or activate a plugin) which triggers reloads every, say, 30s instead of 120s (REFRESH_CLOSE). Unfortunately, I could not find any way to overwrite the 120s by means of a plugin (i.e. without editing the iitc master file).
@prok42 the values can be found in window.mapDataRequest.REFRESH_CLOSE, etc at run-time
I'd like to improve things further in this area though - would be nice to adjust refresh automatically as needed. One thought is to monitor the COMM data and when activity for portals within the map is seen the refresh period drops. When COMM activity stops, it increases again.
This doesn't cover all cases of activity (e.g. upgrades), but perhaps would be good enough for most cases.
@jonatkins ah thanks a lot - and kudos for the request rewrite! It is already very smooth now with less timeouts
At the moment IITC uses a single timer for handling both map data refreshes and chat refreshes. This is not ideal. Chat data is generally quick to retrieve, and a relatively quick refresh cycle is preferred. However, map data can take much longer to retrieve - and on slower machines, quite a while to process. Additionally, the timer for the next refresh cycle is started when the requests are first sent - if things are particularly slow, a new refresh can start before the current cycle is complete.
Additionally, map data can often return an error==TIMEOUT for individual map tiles. The stock site, as far as I can tell, will immediately retry these tiles - IITC does no retries at all.
So - time for a rewrite of code in this area. First, move chat refresh onto it's own cycle (30 seconds?) completely independent of the map data refreshes
Complete rewrite of the map data fetching, cache handling, etc.
This is a relatively large job. Given the number of protocol changes recently I've created a new branch for this work.
Chat refresh status will be separate from map data status - so will probably be best moved away from the general 'failed request' counter. Perhaps replace the time in the chat input area with a chat refresh status?