The new FS module is an abstraction layer over the built-in fs module.
The main reason it exists is because I need an abstraction layer I can
disable writing from. But that'll be in another commit.
Currently, mine is better because:
- paths are always relative to PS's base directory
- Promises (seriously wtf Node Core what are you thinking)
- PS-style API: FS("foo.txt").write("bar") for easier argument order
- mkdirp
This also increases the minimum supported Node version from v6.0 to
v7.7, because we now use async/await. Sorry for the inconvenience!
We had a lot of discussion in Dev and a somewhat-close poll, but in
the end "Chat" was a better name than "Messages", and also has the
advantage of being shorter (which is nice for Chat.html and
Chat.plural which should be short).
The following functions have been renamed:
- Tools.html to CommandParser.html
- Tools.plural to CommandParser.plural
- Tools.escapeHTML to CommandParser.escapeHTML
- Tools.toDurationString to CommandParser.toDurationString
- Tools.toTimeStamp to CommandParser.toTimestamp
(notice the lowercase 's')
This is in preparation for a rename of Tools to Dex (by removing the
non-dex-related functions) and a rename of CommandParser to either
Messages or Chat.
This is a major refactor.
countConnection, countBattle, countPrepBattle, and countGroupChat have
been rewritten to use a new TimedCounter class that extends Map. Newer
versions of V8 seem to deal poorly with hash-mode Objects, so I hope
this approach is better.
countBattle now reports to Monitor.adminlog (console log and Upper
Staff room if it exists) instead of Monitor.log. This makes it match
countConnection, since non-programmers can't really do anything about
it anyway.
The teamValidatorChanged/Unchanged counters have been removed. They
were added to measure the proportion of times a validator has resulted
in no changes (the answer is approximately 50%).
countNetworkUse is now only active in emergency mode. It does nothing
but take up RAM normally.
countCmd has been removed entirely. The original code was buggy (only
blocking 1 out of every 15 client queries even when spammed) and
was only active in emergency mode. It should probably be rewritten
from scratch the next time we have a need for it.
JSHint's ES6 support is shaky, and its development has stalled as of late.
Since ESLint can do by itself both JSHint and JSCS' jobs, this commit replaces them.
Gulp and its related dependencies are also hereby removed.
ResourceMonitor has been moved from app.js into monitor.js and
renamed to simply Monitor. It also gains the ability to fine-
grained control the log level, although in a pretty crude way.
Monitor.debug - bugs in PS's engine that we need to fix
someday - by default, these aren't reported
Monitor.warn - issues that suggest an attacker or poorly
coded custom client - these should probably be looked at
Monitor.notice - issues that staff probably want to know.
These are usually also written to the Staff room.