Commit Graph

23714 Commits

Author SHA1 Message Date
Guangcong Luo
094d6ed677 Improve /report
Closes #4351
2018-01-18 03:40:32 -06:00
Guangcong Luo
ab1f995daa Rewrite Process Manager
Process Manager is now lib/process-manager.js

It's been entirely rewritten to reflect what I think a process manager
API should look like.

In particular, there are now two Process Managers, QueryProcessManager
and StreamProcessManager.

Pass QueryProcessManager a pure-ish query function (sync or async) that
takes a JSON value and returns a JSON value, and PM.query() will
execute that function in a subprocess, and return a Promise for its
return value.

StreamProcessManager is the same idea: Pass it a function to create an
ObjectReadWriteStream, and PM.createStream() will create a stream in a
subprocess and return a stream connected to it.
2018-01-18 03:34:16 -06:00
Guangcong Luo
d395424fd3 TeamValidator: Return null, not false, for valid team
As usual, having `T | false` be our optional is a really old PHP
convention; we should be using `T | null` basically everywhere.
2018-01-18 03:32:32 -06:00
Guangcong Luo
8f3bed7e59 Make fsPath.read() return a string by default
This is an update to match how Streams work: .read() returns a string,
and .readBuffer() returns a Buffer.

Being able to statically predict what type .read() will return is
really useful to TypeScript, in addition to being generally useful for
readability.

As a side benefit, readTextIfExists() is renamed readIfExists().
2018-01-18 03:31:13 -06:00
Guangcong Luo
72d4f73160 Improve seed-passing experience in test API
Now, seeds are passed as arrays, rather than needing to pass an entire
PRNG object. In addition, they're now passed in the options object,
instead of as a separate argument.

This is done mostly so the Miracle Eye can be rewritten with a custom
seed, which requires fewer turns and should overall be faster. Which
was in turn done because a Miracle Eye timed out on Travis CI earlier.
Overall, the speed increase is pretty negligible, so this is mostly
just about improving the test API.
2018-01-18 03:31:13 -06:00
Kris Johnson
3d643cf521 BSS8: Ban Unreleased and Illegal Pokemon (#4350) 2018-01-17 17:35:04 -06:00
The Immortal
a6e3fac595 Fix RBY STABmons 2018-01-17 23:52:00 +08:00
Bär Halberkamp
cefddf0662 Add warnings regarding responsibility to groupchats 2018-01-17 16:45:16 +01:00
urkerab
396fda7adf Fix Z-Power interaction with called Status moves (#4291)
Latest research (http://www.smogon.com/forums/posts/7625046/) shows that although Z-Synthesis bypasses Heal Block, using Z-Copycat to copy Synthesis does not. (Z-Copycat on a damaging move does of course turn into a damaging Z-Move.)
2018-01-17 08:57:37 -05:00
The Immortal
1a3cee220f
VGC 2017: Remove ladder 2018-01-17 21:41:11 +08:00
The Immortal
97e83422bb Random Battle updates 2018-01-17 21:36:38 +08:00
cant say
48c005378d Add: Battle Spot Special 8, Remove: Dragon Cup & Special 7 (#4347) 2018-01-17 21:21:03 +08:00
Marty-D
6bce102f66
Gen VII: Update critical hit rate 2018-01-17 05:00:13 +00:00
HoeenHero
3ad55e1404 Fix crash in tournaments (#4345) 2018-01-16 12:14:53 -05:00
urkerab
297af3b111 Allow formats to override checkLearnset (#4341) 2018-01-16 04:16:48 -06:00
LegoFigure11
2133190898 BSSF: Fix Aron (#4344)
Update Aron set and fix clause to allow it to be generated
2018-01-16 16:17:15 +08:00
n10sit
7c0f101cbb Doubles UU: Camerupt-Mega rose to DUU (#4343)
http://www.smogon.com/forums/threads/usage-based-tier-update-for-january-2018.3625266/#post-7643579
2018-01-15 19:38:16 -06:00
The Immortal
5c0f618a1d
Inheritance: Ban Blacephalon 2018-01-15 17:30:15 +08:00
Jeremy Piemonte
8ebbd6bef6 Hidetext: Allow room drivers access to hidetext (#4342) 2018-01-14 19:05:47 -06:00
Marty-D
6ab216aadf Add new event Pokemon 2018-01-14 09:47:22 -05:00
Kris Johnson
8ee59a218e Remove NU Suspect Test (#4340) 2018-01-14 16:23:09 +08:00
HoeenHero
8fb4712397 Fix permission checking for promotions (#4336) 2018-01-13 21:18:28 -06:00
Guangcong Luo
df4aeebcd5 Use new Streams for FS streams 2018-01-13 03:59:09 -06:00
Guangcong Luo
4969fb0790 Add Streams library
I've finally been sufficiently frustrated by Node's Streams API to
straight-up write my own.

This is what a Streams API looks like when you don't try to pretend
Promises don't exist. So much easier to use.
2018-01-12 22:19:05 -06:00
Guangcong Luo
2e85de348f Disable package-lock.json
NPM's official documentation says that package-lock.json should be part
of the repository.

Why? `package-lock.json` is basically a snapshot of the `node_modules/`
directory. You can think of it like `node_modules.zip`, except more
human-readable, and requires an internet connection to unzip.

The main advantage of adding it to Git is that it lets you know exactly
the state of `node_modules/` at the time the programmer commits it. So
if a dependency breaks, it's easier to trace exactly when it broke.

It also makes sure `node_modules/` is exactly the same between
different development environments, so differences don't cause bugs to
appear for some developers but not others.

This comes with a number of disadvantages. The biggest one is that it
causes package-lock changes to appear in random commits, which can
outright lead to merge conflicts. Not to mention making diffs in
general significantly less readable.

And a lot of stated advantages aren't actually true (paraphrased):

> If I install express ^4.15.4, and later express 4.15.5 is released,
> a contributor would run `npm install` and gets 4.15.5, we would
> have different versions.

Like, this is intended behavior. If I didn't want that behavior, I'd
specify the express version as 4.15.4 instead of ^4.15.4. We can still
have the same version if we just re-run `npm install`, which we would
STILL have to do if we were using a package-lock file. The
package-lock file does not improve this situation.

(A Dev poll showed that most devs were in support of this.)
2018-01-12 22:19:05 -06:00
urkerab
56619ffa35 Simplify Magic/Trick/Wonder Room (#4337) 2018-01-12 19:26:10 -06:00
Marty-D
98fa2d4b1e
Update Helping Hand failure conditions 2018-01-12 19:50:14 +00:00
Marty-D
415a61d206
Update tier discussion threads 2018-01-11 16:04:52 -05:00
n10sit
bd52b6180d Doubles UU: Cresselia rose to DOU (#4331)
http://www.smogon.com/forums/threads/usage-based-tier-update-for-january-2018.3625266/#post-7643579
2018-01-11 14:40:45 -06:00
Kevin Lau
10b062955e Random Battle: Add more Knock Off (#4246) 2018-01-12 01:16:43 +08:00
urkerab
e3b8a37a0a Simplify Mud Sport and Water Sport (#4332) 2018-01-12 01:12:57 +08:00
Kris Johnson
ca56ff737b Add RU Suspect Test (#4335)
http://www.smogon.com/forums/threads/np-ru-stage-9-save-tonight.3625382/
2018-01-11 15:30:33 +08:00
Kris Johnson
3668b0a320 UU: Ban Ninetales-Alola (#4334) 2018-01-10 23:40:20 -06:00
Guangcong Luo
f9b09f540c Cut VGC timer down to 5 minutes total 2018-01-10 18:00:13 -06:00
Kris Johnson
ccff8888a0 Jirachi isn't actually banned from 1v1 (#4329)
The 1v1 council miscounted the votes
http://www.smogon.com/forums/threads/1v1.3587523/page-40#post-7644586
2018-01-10 17:02:41 -06:00
Kris Johnson
3053bce174 Haunter and Gurdurr are PU by usage (#4330) 2018-01-10 17:02:17 -06:00
Kris Johnson
519f803e37 Kingdra is BL3 (#4328)
http://www.smogon.com/forums/threads/drastic-tier-shifts.3578584/page-2#post-6957897

It was BL3 before it moved to OU
2018-01-10 15:57:01 -06:00
The Immortal
68ca4d5b0f Random Battle updates 2018-01-10 16:44:28 +08:00
The Immortal
d4a139e882
Update 1v1 2018-01-10 12:57:05 +08:00
Kris Johnson
7972dfff5e January tier updates (#4327) 2018-01-09 22:37:06 -05:00
Charlie Kobayashi
351d8de280 Modlog: remove extra roomid (#4319) 2018-01-09 13:18:49 -06:00
Charlie Kobayashi
0df8118366 Update helptickets.js (#4317) 2018-01-09 13:18:23 -06:00
Charlie Kobayashi
f8c891705b Commands: Log system commands in staff room (#4320) 2018-01-09 13:17:59 -06:00
Charlie Kobayashi
5156af6b66 Help: Recreated tickets should have ticketban button (#4318) 2018-01-09 13:17:19 -06:00
Charlie Kobayashi
8706d257f2 Scavengers: change official time colours (#4323) 2018-01-09 13:16:16 -06:00
Bär Halberkamp
ac0ea3a91b Wifi: better modlog labeling 2018-01-09 17:27:27 +01:00
cant say
aa2533dc8e BSS Factory: Fix more Liquidation mistakes (#4315)
also fixed up some move slashing on gyarados
2018-01-08 22:42:30 -05:00
Kris Johnson
aaf918bcfa BSS Factory: Swampert doesn't learn Liquidation (#4314) 2018-01-08 20:27:46 -05:00
Charlie Kobayashi
331af4e794 Refactor Modlog Formatting (#3972) 2018-01-08 15:18:24 -06:00
The Immortal
e34843c993
Inheritance: Add new bans 2018-01-07 14:15:13 +08:00