Commit Graph

7 Commits

Author SHA1 Message Date
Konrad Borowski
46f97222d2 Make matchmaking range smaller for Gen7 formats (#3684)
Previously matchmaking range was smaller for Gen6 formats, however
the most popular formats are Gen7 formats.
2017-06-23 04:35:08 -07:00
Guangcong Luo
6dd58b40d3 Refactor simulator into new sim/ directory
This is a surprisingly minor refactor considering how many files it
touches, but most of this is only renames.

In terms of file renames:
- `tools.js` is now `sim/dex.js`
- `battle-engine.js` is now `sim/index.js` and its three classes are
  in `sim/battle.js`, `sim/side.js`, and `sim/pokemon.js`
- `prng.js` is now `sim/prng.js`

In terms of variable renames:
- `Tools` is now `Dex`
- `BattleEngine` is now `Sim`
- `BattleEngine.Battle` is now `Sim.Battle`
- `BattleEngine.BattleSide` is now `Sim.Side`
- `BattleEngine.BattlePokemon` is now `Sim.Pokemon`
2017-05-05 16:48:38 -05:00
Ben Davies
7d27efb817 Matchmaking: move battle logging back to Rooms.global (#3454)
* Matchmaking: move battle logging back to Rooms.global

For now, logging should be dealt by the global room until logging can be
abstracted away from it. This makes it simpler to refactor the logic in
Matchmaker#startBattle to be handled by Rooms.createBattle where it belongs.

* Matchmaking: use Matchmaker#cancelSearch format parametre

Optimizes cancelling searches if the format is known
2017-04-15 17:51:34 -04:00
Quinton Lee
519b270b24 Fix /prelockdown 2017-03-20 18:30:36 -05:00
Ben Davies
9cf06e503b Matchmaker: don't allow battles to start on lockdown again 2017-03-20 03:01:39 -05:00
Ben Davies
fa3136f6f4 Prevent JSON writers from being able to block I/O (#3368)
These are the last place process.nextTick should be used. Also fixes
BattleRoom's unit tests.
2017-03-17 17:42:10 -05:00
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