Permissions have gotten out-of-date, so this commit syncs them.
Default permissions are now matched with Main, in particular including
the new & rank as admin (removing the old Leader rank and ~ symbol).
Relevant changes:
- Admin (~) and Leader (&) have been merged into Admin (&)
- The 'ban' permission was split into 'globalban' and 'ban'
- The 'broadcast' permission was renamed 'show' (going forward,
"broadcast" should only refer to the big red/blue/green
announcement bars.)
- Bots no longer have global moderation abilities, making it
easier to give untrustworthy bots the "bot" rank.
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.