onUpdateConnection is called when a user in a room merges with
another user. There are various corner cases when one might want
to handle this situation differently from onConnect
Also document the events in room-game.js in more detail, and fix
up simulator.js's RoomGame implementation a bit.
This is a huge refactor that's a half-scratch rewrite of simulator.js.
Everything seems to be working so far, but with such a huge change,
I wouldn't be surprised if something went wrong.
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.
JSHint is now a fair bit stricter, and is now correctly checking
files in `mods/`.
The code has been fixed to match the new stricter standards.
JSHint has now caught its second actual bug: Gen 5 Pinap Berry
was Ice instead of Grass.
I used a hack to make the multiple declaration errors go away,
so all that remained in jsHint were actual errors, which I've
now mostly fixed.
All this linting ended up uncovering one actual bug: Uproar's
message not showing. It's a very minor bug in a move no one uses,
so I'm going to fold it into this commit.
The main process no longer does any JSON parsing/stringifying of
teams. The communication protocol with validator processes has
been changed from JSON to a string protocol delimited by pipes.
A variety of more minor optimizations have also been done.
This doesn't yet handle modded formats that don't validate ability
selection in the ordinary manner. Those formats will continue to work
essentially in the same manner as before, rather than with the correct
mechanics.
Previously, Simulator.prototype.resendRequest() called user.sendTo()
with an invalid room specified, causing the server to send the
message to all rooms, leading to problems on the live server.