* Delete Gen 7 Random Doubles Battle
* also the tests
* Update server/chat-plugins/randombattles/index.ts
* Update multi-random-runner.ts
---------
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
This reinstates the recently-reverted RoomGame refactor/cleanup, but
with the bugs (forfeiting BestOfGame, and autojoin) fixed.
This reinstates:
- 6bccd4f622 Fix crash in bestof when expiring battles
- 2a48cbd064 Cleanup more RoomGame implementations
The latter fixes these, in addition to refactoring:
- Fix a race condition when destroying bestof games
- Fix `/tour settings scouting off` error message
This is mostly just refactoring, but the refactor caught a few bugs:
- Fix a race condition when destroying bestof games
- Fix `/tour settings scouting off` error message
* Fix itemsearch when specifying both gen and show all
* Update server/chat-plugins/datasearch.ts
---------
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
This refactor removes `player.unlinkUser()` which was used for several
unrelated use cases.
These have been split apart into:
- at the end of a game, `game.setEnded()` now clears `user.games`,
while leaving `player.id` untouched
- when trying to change the user associated with the player, we now
consistently use the higher-level `game.updatePlayer()`
There's a good chance this fixes the lagspikes currently affecting PS.
This replaces some pretty jank code with much cleaner code.
Anything that would be more cleanly implemented by iterating the
players array is now done by iterating the players array.
Some instances of p1/p2 are lying around but we should slowly deprecate
them.
After seeing fifty different ways we use `getLearnset`, most of which
are just "haphazardly assemble a movepool", I decided to write
`getFullLearnset` and `getMovePool`, which centralizes the
implementations and prevents weird bugs like 9713dc6db5 which
we spent two years trying to figure out.