iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
991 stars 552 forks source link

Automatic "Your X on Y was destroyed by Z" messages appearing in faction chat #121

Closed jonatkins closed 11 years ago

jonatkins commented 11 years ago

Something seems to have changed server-side - the automatic "Your X on Y was destroyed by Z" messages are now being routed to the faction chat tab, as well as the "Full"/"Compact" chat tabs.

Note that this is, however, a change that has also been made to the stock intel site - these messages appear in both tabs there.

Any thoughts on the best solution for this? The stock site displays them in a different colour, so it's clear they're automated messages relating to your items.

vita10gy commented 11 years ago

My 2 cents would be that IITC already solved the problem they're trying to solve by giving it its own tab. (Whereas in a world where your options are only public or faction that info really doesn't "belong" to just one of them.)

I vote we just get them out of the faction chat.

jonatkins commented 11 years ago

Agreed - about to push a fix for that.

However, I was wondering if it was worth going further. These notifications are not the same class as the general "player destoryed an X on Y" - instead they're 1. directed at you, and 2. not dependant on range

I'm wondering if it'd make sense to create a new chat tab for just these SYSTEM_NARROWCAST notifications? Or just display them in a different colour in the Full chat tab, similar to the stock site?

vita10gy commented 11 years ago

I think I like them being in the full tab with a different color more than making a new tab.

yoshimo commented 11 years ago

Why not make it an orange line like the default intel map, which shows this text and show it both at the full tab and the compact tab (reduce it there maybe to the last destroyed from a certain player)

jonatkins commented 11 years ago

I might need to revert the change I've made to chat, and include these messages in the 'faction' panel until a better solution is found.

As it stands, the server is sending lots of these messages to IITC. IITC ignores them, then requests chat further back until the window is filled. If there's been a lot of activity against your stuff, and not much other faction chat in the viewed area, this can cause a LOT of requests to fetch chat text, causing IITC to hit the server rate limits.

As long as you're zoomed out, or there's not been much activity against your stuff, it's fine.

jonatkins commented 11 years ago

OK, after an extensive look into the chat code, I've rewritten how it handles oldest/newest timestamps internally

before, it'd scan the hash for oldest/newest timestamps each time it needed them. however, when some messages are not stored, their timestamps weren't taken into account and they'd be repeatedly re-requested

before now, if there were over 200 skipped messages in the public chat (the "[secure]" faction duplicates), it could trigger this bug. rare enough it hadn't been spotted

however, adding code to skip SYSTEM_NARROWCAST messages from faction chat, combined with the 50 count per request, made triggering it much more likely

now, the oldest/newest timestamp of every received message is tracked, even if it's not stored. this prevents the issue. this should prevent any issues in future.

jonatkins commented 11 years ago

highlighting for these messages added in a2a9d3458d19e81a06eb67a21d49e72d16b8d7ea