Fixes the long-standing issue of bad interaction between `this.parse('!command')` and `this.canBroadcast()`: each time the latter was called, it would announce the command usage.
The old `.message` is dropped, and the new `.message` is the old
`.originalMessage`.
Having a fake `.message` pretending a namespace command is a
top-level command seems entirely unnecessary, so I still don't
really understand what it's for in the first place.
this.errorReply sends a red error message inline. The main special
thing is that it takes advantage of our new /error support in PMs to
send inline errors in PMs as well.
This was done by applying chat plugins to the cloned commands
object rather than the original, which should probably have been
done in the first place.
The modlog API is now accessible from outside of CommandParser
through CommandParser.writeModlog.
We now also have a concept of a global modlog, and some new
command APIs for writing to it.
These are commands from commands.js, before they're possibly
overwritten by other chat commands. It's a shallow copy so memory
impact will probably be minimal.
- Return proper error message for forbidden commands.
- Fix a recursive crash in lobby-less servers.
- Fix a stack overflow in some (very stupidly) modded servers.
Apparently modlog is in CommandParser, which doesn't make it very
straightforward to access outside of the this. functions in
commands. This change at least makes it possible to write to
other rooms' modlogs in commands, but in the long term we might
want to move modlog from CommandParser to Rooms, or at least
expose an API accessible outside of commands.
This gives commands like !htmlbox and /roomintro a basic validator,
to warn about typoes related to mismatched HTML tags. This is NOT
intended to be secure (we have a separate sanitizer client-side for
that), but is intended to guard against user error only.
this.parse in chat commands was changed to default to parsing
in-namespace, when namespaces were introduced. This commit changes
it back to parsing globally, with in-namespace parsing being
optional and defaulting to off.
Seperated /privateroom command into /privateroom and /hiddenroom. In
hidden rooms, mostly set by battle players, global staff maintain their
ranks within the room, but the rank is not kept in secret/private rooms
(only set by users who can create chat rooms).
Created command /whoare to allow global staff to see the hidden rooms a
user is in.
If a crash happens during a command (which is around 99% of all
crashes), a bug in either Node or SockJS causes the user who issued
the command to be unable to do say or do anything (although they'll
still receive messages).
We used to have a crashguard to prevent this from happening, but
it was removed due to suspicions of being a significant lag source.
Later lag investigation has shown that it's not the biggest source
of lag, so we're reintroducing that crashguard for now.
Adds support for adding the word 'global' in front of global
promotion/demotion commands, for instance /globalmod username
to promote a user to global mod.
Also adds /roomdeauth.