The links in the top right are now separated by whitespace.
The previous brackets were visually pretty noisy, and we no longer
have a need to draw attention to them.
With the advent of the *.psim.us URI scheme, one problem was that
images and other resources were not cached across different servers
because each server had a different URI for the same resource. This
commit resolves the problem by loading all resources from
play.pokemonshowdown.com.
This commit allows the new psim.us domain to use the cookies and
`localStorage` of play.pokemonshowdown.com. Teams and prefs are
initially loaded from the play.pokemonshowdown.com `localStorage` and
changes to teams and prefs are written back to the
play.pokemonshowdown.com `localStorage`.
This commit also implements a few other things for the new psim.us
domain (implemented by Zarel):
- URIs of the form serverid.psim.us load the server `serverid`
- the naked domain now loads the lobby
- 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`.
- mute/ban/kick buttons are now only shown if the user can use the
corresponding command. This determination is based on the permissions
in use on the main server (and hardcoded as such) because the server
does not currently send the client any information about permissions.
In particular, regular users will no longer see the buttons when
viewing their own profile.
- there is now a blank line between a user's IP address and the auth
buttons.
Previously, the `yourMove` (etc.) notifications on the first turn of
a battle for player 1 did not include the opponent's name, because
the opponent's side of the battle was not yet initialised. This
commit fixes the issue by delaying the notification until the
opponent's side has initialised.