Commit Graph

90 Commits

Author SHA1 Message Date
Karthik
fda75704d7
Don't show /offertie hint in tour battles (#8714) 2022-04-05 19:16:53 -05:00
Alexander B
0475b38ae8
RoomGame: Refactor to use generic typing (#8678) 2022-03-13 18:01:54 -07:00
Kris Johnson
a0260b98e6 Userprefixes: Fix forcing battles to be public 2022-02-24 01:23:27 -07:00
Leonard Craft III
24bfc49064
Prevent setting timer after a game has ended (#8640) 2022-01-30 14:51:42 -06:00
Mia
cfeb1303bb
Chat: Properly typecheck Chat.runHandlers arguments (#8612) 2022-01-23 17:55:19 -08:00
Mia
677ed08d16 Fix crash 2022-01-04 20:48:33 -06:00
Guangcong Luo
be0cee5a33
Refactor getIdentity not to take roomids (#8528) 2021-11-12 22:05:59 -08:00
Mia
2d49d9642e Room-battle: Don't count clauses in the tiername when logging battles 2021-10-03 12:45:46 -05:00
Mia
6e2d9644d7 Room-battle: Add some useful battle hooks 2021-09-30 08:06:00 -05:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Mia
c20cee8b1a Friends: Properly update spectator lists on battle end 2021-07-19 17:16:14 -05:00
Mia
e5fbd64427
Support adding friends (#7333) 2021-07-16 12:56:34 -07:00
Annika
0bd31705ab Improve handling of legacy forced-public prefixes 2021-05-26 12:44:44 -04:00
Guangcong Luo
c695620e58
Refactor to new challenge system (#8303)
See PR for full details:

https://github.com/smogon/pokemon-showdown/pull/8303
2021-05-17 07:15:01 -07:00
Annika
8ee9a68067 RoomBattle: Properly handle legacy config format
#8214 added code to handle Config.forcedpublicprefixes and convert it to Config.forcedprefixes, but it was buggy.
2021-04-25 22:03:08 -07:00
Mia
7154920b2c
Support forcing modchat on ladder tour battles (#8214) 2021-04-23 22:40:09 -07:00
Marty-D
4eee39cd4a Revert "Fix suspect test unbans"
This reverts commit 6c3615a6f8.
2021-04-12 17:03:40 -04:00
Marty-D
6c3615a6f8 Fix suspect test unbans 2021-04-12 16:00:53 -04: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
9849c63fef
Room-Battle: Fix timer interaction with choice-blocking moves (#8186)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-04-07 11:26:55 -07:00
Guangcong Luo
0f127597b5 Shorten unrated matchmaking timer 2021-04-02 23:10:08 -07:00
Guangcong Luo
47da1d61c8 Use the invite form for /importinputlog 2021-04-02 23:00:30 -07:00
Guangcong Luo
368202605f Add Multi Random Battles 2021-04-02 23:00:30 -07:00
Guangcong Luo
694e79eea8 Add form for inviting players
(This makes it so you don't need to use console commands)
2021-04-02 23:00:30 -07:00
Guangcong Luo
8f001cc2ae Support challenges in 4-player games 2021-04-02 23:00:30 -07:00
Mia
a9d9c5b09b Room-battle: Improve handling of forfeits in multi battles 2021-04-01 13:54:25 -05:00
Mia
960548cd65 Room-battle: Improve handling of forfeits in multi battles 2021-04-01 13:43:50 -05:00
Guangcong Luo
86df524adc Support forfeiting in free-for-all battles
I honestly don't understand HOW it works, but it definitely works.
2021-04-01 04:44:16 -07:00
Guangcong Luo
44ef998ecc Implement free-for-all
This involves a huge refactor for how battles are constructed, but
it's totally worth it.

Currently, tournaments, challenges, and laddering are unsupported; only
unrated searches work. But it does work, and it's beautiful.
2021-04-01 04:44:16 -07:00
Spandan Punwatkar
b77d6cb20f
Add simulator support for multi battle (#7929)
This doesn't include matchmaking support (which had to be removed
for reworking), but it includes everything else.

Co-authored-by: Spandamn <spandan.punwatkar@gmail.com>
Co-authored-by: MacChaeger <msaimrkon@gmail.com>
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-03-31 22:22:25 -07:00
Guangcong Luo
49b32b2afe Don't accelerate the timer in challenge games 2021-03-24 19:24:43 -07:00
Mia
9db563794b Fix crash in logging chat in inputlogs 2021-03-11 18:16:20 -06:00
Mia
d1af6d180b Fix build 2021-03-08 17:18:56 -06:00
Mia
736e38e4af
ProcessManager: Handle Monitor#slow in subprocesses (#7990) 2021-03-03 12:39:53 -08:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Guangcong Luo
782f316dd9
Merge BattleStream and RoomBattleStream commands (#7988)
RoomBattleStream originally overrode `_writeLine` in #5428 because
`>eval` had a dependency on `Chat.stringify`, and we were trying to
separate sim and server.

`Chat.stringify` is now `Utils.visualize`, so there's no more reason
for the separation. In addition, the separation is actively bad,
because it makes it impossible to import certain inputlogs outside
of the simulator.
2021-02-02 15:03:03 -08:00
Guangcong Luo
148439dc27 Refactor /editbattle
This moves the `player()` and `pokemon()` functions to be defined
inside `eval`, allowing them to be used by `>>>` and `/evalbattle`.

This should hopefully make the commands more readable as well.
2021-02-02 13:52:16 -08:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
Mia
727d6a4498
Monitor: Standardize slow logging (#7969) 2021-01-30 13:32:06 -08:00
Guangcong Luo
da30a71706 Revert "Remove User#inRooms and User#games (#7815)"
This reverts commit 5c9c84c415.

This also reverts commit 1fc92ef977.
2021-01-30 15:55:55 -05:00
Mia
5c9c84c415
Remove User#inRooms and User#games (#7815) 2021-01-28 10:41:35 -08:00
Guangcong Luo
a68656a8e7 Support destroying rooms in unit tests
Matchmaking unit tests currently rely on destroying and re-creating a
user causing them to forget about battles they're in, which is not
actually supposed to happen, and breaks #7815.
2021-01-10 03:39:01 -08:00
Mia
e601a5eb1f
Suspect tests: Move functionality out of sim/ (#7769) 2020-12-21 13:32:19 +04:00
Mia
080ecc7469
Rooms: Merge privacy setting code into setPrivate (#7695) 2020-11-17 02:00:06 -08:00
Annika
e6a61e52aa
Fix renaming battle rooms (#7399) 2020-11-06 15:14:08 -08: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
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* Lint arrow-body-style

* Lint prefer-object-spread

Object spread is faster _and_ more readable.

This also fixes a few unnecessary object clones.

* Enable no-parameter-properties

This isn't currently used, but this makes clear that it shouldn't be.

* Refactor more Promises to async/await

* Remove unnecessary code from getDataMoveHTML etc

* Lint prefer-string-starts-ends-with

* Stop using no-undef

According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
2020-10-19 02:42:28 -07:00
Guangcong Luo
3d68248efa Update to latest eslint
We're skipping two major typescript-eslint versions, so there are a
bunch of changes here, including:

- it's catching a lot of things it didn't catch in the past, for
  reasons unclear to me

- no-unused-vars has to be explicitly disabled in global-types now

- a lot of `ts-ignore`s were never necessary and have been fixed

- Crashlogger can now handle being thrown things that aren't errors.
  This has never been a problem in the past, but to satisfy TypeScript
	we might as well not die in a fire on the off chance someone tries to
	`throw null` or something.
2020-09-29 15:28:08 -07:00
Guangcong Luo
360668b00e Revert "Fix renaming battle rooms (#7326)"
(It had a bug that made private battles unplayable.)

This reverts commit 930c00410b.
2020-09-19 05:36:34 -04:00
Annika
930c00410b
Fix renaming battle rooms (#7326) 2020-09-19 02:05:27 -07:00