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.
- Modchat permission code should be simpler now
- Mods now have 'modchatall' (can set modchat up to their own rank)
- 'modchatall' (ROs) can no longer remove modchat higher than their own
rank
- 'makeroom' (Leaders) still can remove higher modchat
Permessage-deflate is an extensIon that compresses websocket messages with zlib.
SockJS already supports it (indirectly) and the client's load balancer already
inserts the header in the opening handshake when making a WebSocket connection.
Config.wsdeflate makes this optional and allows tweaking the extension's resource
usage.
`Config.workers` especially deserves to be documented. The other config
settings don't entirely need to be documented, but for the sake of
transparency `Config.ssl` and `Config.bindaddress` have been added as
well.
This should use the unicode instead of the actual character itself for the same reason the player rank does - some text editors don't like unicode and will override this with an actual question mark.
Also, the actual notifications when an admin hotpatches is now smarter - it will tell the rooms if a hotpatch failed, and it will only tell the rooms after a hotpatch has happened, not before.
Config.ofe toggles whether or not to write heapdumps if sockets workers
run out of memory, since ofe is an optional dependency but is not
installed by default. nodemailer is now a nonDefaultDependency, and
will complain if it's not installed when Config.crashguardemail is
enabled.
This allows for when the server is in lockdown, and the final battle finishes, for the server to automatically kill itself.
- Setting Config.autolockdown to false will turn this off.
- This also adds a new command to toggle Config.autolockdown
- This also introduces Rooms.global.notifyRooms
- `Config.repl` enables/disables using REPL sockets since it doesn't
make as much sense to configure whether or not it's enabled with the
REPL_ENABLED const
- exports.start takes a filename parametre rather than a prefix and a
suffix one to avoid having to mutate parametres
- dead REPL sockets are removed from the sockets list when the server
emits an error, and the server closes on error now before respawning
the server
- made the file ready for Typescript
These are used within the tournament code, but they aren't documented...
This also changes:
Config#tournamentDefaultPlayerCap -> Config#tourdefaultplayercap
Config#istournamentsrated -> Config#ratedtours
The redirect command actually uses the 'warn' permission, and it seems as though this permission actually isn't a permission of any of the ranks currently.
This is basically a system that allows for room moderators or higher to set a minimum time between a user's messages sent to the room.
This is especially helpful for times the server might be lagging or the chat is just moving much too fast.
Alternatively, this could also help to stop spammers in their tracks and give staff more time to handle them as well.
This was inspired by https://github.com/Zarel/Pokemon-Showdown/pull/2471
We are also removing the github-specific code from /htmlbox as well, removing the modchat alias of * for player, and we are giving room owners and leaders the roombot permission so they can promote to it.