BattleRoom is now GameRoom, a slightly more abstract room type capable
of holding any of a number of possible roomgames. Currently, battles
are the only such roomgame, but any future roomgame could possibly use
it.
Differences between ChatRoom and GameRoom:
- GameRooms start at the left, ChatRooms start at the right
- GameRooms have chat on the right, and a game area on the left, with a
view area at the top left and a controls area at the bottom left
- GameRooms retain all their logs, ChatRooms only retain the latest 100
lines
- GameRooms expire after 40 minutes of inactivity or 10 minutes of zero
online users (configurable in the future)
- GameRooms are guaranteed to have an associated game, while ChatRooms
may or may not
This abstracts matchmaking logic from the global room away to its own
module, allowing the two to be decoupled from each other entirely with
some refactoring.
Related to #3361
* Sockets: fix Sockets.killWorker not disconnecting connections
* Sockets: fix unit tests
- Fix crash when constructing mock sockets in certain cases
- Properly prevent workers from writing to stdout
- Fix race conditions in workers-related tests that were causing false
positives
* Tests: mock workers now more closely imitate sockets' workers
This helps catch cases where messages are being sent in the wrong order
to the workers, e.g. messages sent to sockets that no longer exist.
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.
- This removes one of the reasons of `sendFor` calls' sometimes failing.
- This also fixes battle logs so that they register the proper end type (forfeit).