Previously, it was only doing 5, which was hardcoded. I made this a top-level variable for future changes because this one took a while (finding all the references took a bit, numbers are not easily searched in this file.)
The FCCDCF cookie frequently goes oversize, and has recently
been causing people to be unable to access PS because their total
cookie size is going over 8KB, above Apache's default maximum.
https://business.safety.google/adscookies/
It looks like this cookie is set by Google and, according to the
internet, sometimes gets filled with junk? I don't know of an
easy way to fix this, but I'm hoping this does it.
Fixes#1991
(Removing a move by clicking on it in search didn't actually
remove it from the set.)
Fixes#2134
(Sorting and clicking on a filter would clear the currently
selected pokemon/move textbox, but this was only supposed to
happen when searching for a filter.)
This also includes some refactors. Polyfills are now gone from
utils.ts (I'm not sure why they were ever there; they're redundant
with ps-polyfill.js) and there's a new Net.decodeQuery.
* Overhaul the format selector to be more easily used
* Update js/client-mainmenu.js
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Lower search pop open limit
---------
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
This should help differentiate local teams and remote-loaded teams. When they're initially requested, the client now compares each new team against all the existing teams - if they appear to be similar, it doesn't add it to the builder (so that dupe teams don't show up). It considers them similar if they have the same mons, title, and format. Otherwise, if it finds one that's close, it'll add it but marked as (server version) so people can tell which is which.
1000-turn battles often took over a minute to load, but they should now
be loaded in a few seconds. In addition, loading no longer freezes tabs,
and skipping several turns back should be a lot more performant.
There are two tricks here:
1. Every 300ms, we rest for 1ms to let the event loop run, which doesn't
provide _that_ much UI responsiveness, but enough for the tab not to
freeze entirely, and allows things like leaving the battle or clicking
"Prev turn" multiple times in a row.
2. Instead of writing every single turn to the battle log when skipping
to the end of a replay (such as when joining a battle), we only write
the most recent 100 turns. This drastically speeds up loading.