This commit changes the TypeScript global variable of `Config` from
`AnyObject` to `Config & AnyObject`.
It still falls back to `AnyObject` (hence the 'Take steps') because of
the main-specific `Config` properties that are used without being in the
`Config` object itself.
These can be added by someone with access to the PS main server.
Regardlesss, this is an improvement as IntelliSense can display and
autocomplete the known properies.
In addition, the TypeScript compiler will now report bugs
concerning the types of the properties, which I have fixed in this
commit.
* Remove the new xhr-streaming ghost connection hack
Once the client uses timeouts, this is no longer necessary.
* Update SockJS client to v1.4.0
This fixes an issue where it would attempt to parse the entire HTTP
response received as JSON, not the response's body alone.
Sometimes when the server gets killed, the TCP closing handshake on
sockets currently open never actually gets completed, screwing with
things like bots that don't implement keepalive/timeouts of any kind.
Global types are defined differently for `.ts` files than for `.js`
files, leading to some confusion for past refactors.
This commit defines them correctly.
I'm also considering making certain global types only available under
namespaces, but I don't want to do that to `User` or `Room`, so for
now, there are no changes there, besides putting streams in the
`Streams` namespace (so `WriteStream` is now `Streams.WriteStream`).
`import =` and `export =` are really only intended for backwards
compatibility with CommonJS. While I really don't like the new module
system TC39 has designed for us, it's what we should be using, and
consistency is important.
This is mostly a TypeScript refactor, but it does come with several
renames:
Dnsbl -> IPTools
Dnsbl.query -> IPTools.queryDnsbl
Dnsbl.reverse -> IPTools.getHost
Also move mods/ to data/mods/
This makes PS more monorepo-like. The intent is to further separate
the sim and the server code, but without fully committing to splitting
the repository itself.
We now support `./pokemon-showdown start` in addition to
`./pokemon-showdown`. I'm not clear which I want to be the default
yet.