The automatic server detection just loops through all registered
servers and tries each of them to find the correct one. This process
will hang if any registered server isn't responding to DNS queries,
which at the number we currently have, makes all servers not sending
serverid fail.
We now hard-require the Config.serverid setting, to prevent this
problem.
This required a new architecture for serving replays from inside the
client repository, because that seems like a better call than
introducing yet another PS repository.
(Experience gives me the impression that separating repositories wasn't
a good idea, and we should be working to make PS more mono-repo-like,
rather than less.)
License for replay code is tentatively AGPLv3, although feel free to ask
for a more permissive license if you have plans to use it in an
open-source project that requires it.
POSTing JSON data is now supported, since apparently Axios does that by
default: #1160
In addition, error messages should be more informative, for anyone else
trying to write a third-party client.
Allows login server requests from non-matching IPs to go through when
the request is using token auth.
Affects certain request-proxying Node hosts such as c9.
See Zarel/Pokemon-Showdown@d5c622b493
New system is backwards-compatible with old one. This also slightly
refactors some other stuff, for an overall simpler system.
Right now, unregistered servers often get unclear error messages
about why laddering and replay saving doesn't work. This commit
attempts to clarify those error messages.
In addition, servers that make requests from different IPs from
their registered IP didn't have an easy way to fix. Reporting
IPs should make it clearer which IP they need to register.
This drops support for the pre-challenge-response authentication scheme
(i.e. the scheme in use before Zarel/Pokemon-Showdown@7dbd8cfec5 on
February 8, 2013), and, by doing so, simplifies quite a bit of the
authentication code.
In particular, it is no longer necessary to make any database queries in
index.php, which reduces our database use significantly and also moves us
closer to the goal of the index page being static HTML.