Commit Graph

18 Commits

Author SHA1 Message Date
Mia
b11177d530
Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00
Mia
a709a15ca9 Fix checks, prettify /alternatebattlesearch 2022-08-16 17:43:35 -05:00
Annika
c18a607c7c Fix /alternatebattlesearch 2022-08-14 23:11:44 -04:00
Annika
431a6c3ad8 Add psbattletools-based /battlesearch alternative 2022-08-14 19:03:43 -07:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Guangcong Luo
810aff74cd Namespace more server global types 2021-04-25 14:16:27 -07:00
Guangcong Luo
486f292904
Refactor everything to use Utils.sortBy (#8220)
A few uses of `array.sort()` have been left alone:

- sorting in `data/` because they aren't supposed to import anything

- `set-importer` because I still have no clue what that's for and what
  dependencies it is/isn't allowed to have

- `sort()` with no arguments used as a lexical sort (at which point
  `sortBy` offers no benefits)

All other cases have been replaced with `Utils.sortBy`, which should
be a massive increase in readability.

Sort orders should be much more readable now, without needing to puzzle
through sign issues. The order is always low-to-high, A-to-Z,
true-to-false.
2021-04-23 22:41:00 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
Mia
4f31d369f5 Add an easy way to disable battlesearching commands 2021-03-25 12:24:12 -05:00
Mia
736e38e4af
ProcessManager: Handle Monitor#slow in subprocesses (#7990) 2021-03-03 12:39:53 -08:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
AeonicX7
2edfe301fd
Fix typo in /help battlesearch (#7852) 2020-12-29 14:16:32 -08:00
Mia
94fe9d838b
Fix userid search regexes for battlesearch/chatlog (#7801) 2020-12-13 23:12:14 -08:00
Annika
ab9cb3a825 Battlesearch: Increase PM timeout to 3 hours 2020-12-09 09:14:21 -08:00
Mia
89d127eafd
ProcessManager: Add a static execFile (#7566) 2020-11-02 11:35:07 -08:00
Quinton Lee
6c6ba3ce45
Battlesearch: fix crash in child processes 2020-10-24 17:50:21 -05:00
Guangcong Luo
e8451f8104 Clean up imports
A lot of our code for child processes doesn't really follow our
original standards. This refactors them back to work the way they
were intended to.
2020-10-24 22:12:35 +01:00
Mia
fb3b6e3886
Move Battlesearch to its own file (#7481) 2020-10-24 10:52:52 -07:00