Commit Graph

9 Commits

Author SHA1 Message Date
Ben Davies
213b697d7c Rooms: move matchmaking logic to ladders-matchmaker.js (#3364)
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
2017-03-17 02:42:30 -05:00
Ben Davies
5031794f97 Sockets: fix unit tests (#3281)
* 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.
2017-02-24 05:38:37 -06:00
Taylor Everding
1a1f64fe95 Remove .js extension from requires (#2725) 2016-08-30 00:04:40 -05:00
Guangcong Luo
c7bb5b5315 Add RoomGame support for /joingame, /leavegame
The old commands /joinbattle, /leavebattle are now /joingame and
/leavegame, and can be implemented by any RoomGame.
2016-01-19 01:47:26 -08:00
Ivo Julca
1673f1fd9b Test: make player name sync regression test more robust
If Custom Game was configured as never rated (in order to e.g. give it an unrated ladder), it would yield bogus failures.
2015-12-20 00:18:23 -05:00
Ivo Julca
50c3f8f8aa Fix test for battle player identifier consistency after rename 2015-12-03 20:45:13 -05:00
Guangcong Luo
341ab3b684 Refactor simulator.js to new RoomGame API
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.
2015-12-03 18:30:47 -06:00
Juanma Serrano
c4ac8d6e2f Use strict mode and let and const instead of var
This commit also fixes some duplicated variable declarations.
2015-11-06 21:56:52 -05:00
Ivo Julca
47263c8749 Fix players of rated battles getting out of sync on rename
- 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).
2015-07-29 15:18:17 -05:00