- don't store alt port preference in `localStorage` anymore
- don't show information about what port the client is connecting to,
because this information isn't useful to users
If connecting to the server's main port fails, the client will
automatically attempt to connect on the alternative port. If connecting
on the alternative port is successful, this is recorded in localStorage
so that next time, the alternative port is used first.
This is mainly intended to be used by the main server, which has a
primary port of 8000 and a relatively little known alternative port
of 80.
Instead of constructing the user list from scratch at regular intervals,
we now construct it only when joining the lobby. Each subsequent join,
part, or rename then adds or removes elements from the user list, rather
than constructing it from scratch.
This change should significantly reduce client lag.
Unfortunately, this does introduce 1.4 seconds of new lag when clicking
to view a user's profile, but it's an improvement overall, pending the
development of a more robust solution.
If teams fail to load due to some bug, the user may lose their teams
permanently if they save their teams. In avoid to avoid a catastrophe,
we now decline to load the client if teams fail to load.
This should never happen unless a bug is introduced that breaks team
loading.
Because highlight matching was done with a global regular expression,
subsequent calls to `test` started searching after the end of the
previous match, meaning that highlight matches were often misses.
There is no reason for highlight matching to be done with a global
regular expression, so this commit fixes the issue by deleting
option 'g' from the regular expression.
In addition, I have renamed `lobby.regex` to `lobby.highlightRegExp`.