Commit Graph

875 Commits

Author SHA1 Message Date
Guangcong Luo
9b5217ab70
Split up dex-data into more files (#7634)
* Split up dex-data over individual files

This commit introduces:
- `dex-abilities.ts`
- `dex-conditions.ts`
- `dex-formats.ts`
- `dex-items.ts`
- `dex-moves.ts`
- `dex-species.ts`

These files centralize definitions from `dex-data` and `global-types`.

* Inherit ItemData from Item etc

Previously, Condition inherited from ConditionData. Now, ConditionData
inherits from Condition. The advantage of the new approach is that now,
Condition and DataCondition no longer need to be separate types, and
there should be much less duplication of type definitions in general.

This has also been done for

- ItemData/Item/DataItem
- AbilityData/Ability/DataAbility
- FormatData/Format/DataFormat

Species and DataSpecies was already merged, but this also reverses
their inheritance (saving a lot of duplicated definitions in the
process!)

The only one left is MoveData, which is just super complicated and
will need its own commit.
2020-11-05 05:00:13 -08:00
Mia
938d998da0
Mafia: Allow staff to speak in games (#7642) 2020-11-05 04:57:09 -08:00
Kris Johnson
acbe53ba4a
Modernize the coding style of the OM chat plugin (#7643) 2020-11-05 04:50:05 -08:00
Mia
67ee30f2fd
Introduce Config.noipchecks (#7626) 2020-11-04 15:14:30 -08:00
Mia
8a1919fd0a Chatlog: Update arg handling 2020-11-04 14:24:53 -06:00
Mia
065be6ca78
Topusers: Fix arg handling (#7635) 2020-11-04 23:14:40 +04:00
Annika
ee79159a25 Helptickets: Don't make global modlog entries 2020-11-02 21:58:46 -08:00
Mia
89d127eafd
ProcessManager: Add a static execFile (#7566) 2020-11-02 11:35:07 -08:00
Mia
e2cb3a1f57
Chatlog: Support searching for a user (#7591) 2020-11-02 08:50:58 -08:00
Mia
22a410afea
Support basic text formatting in polls/announcements (#7623) 2020-11-02 08:42:03 -08:00
Mia
cbf4a450da
Add /vsl alias to viewspotlights (#7622) 2020-11-02 08:40:41 -08:00
Annika
7f2dec0797
Modlog: Avoid optional properties in ModlogEntry (#7613)
* Modlog: Avoid optional properties in ModlogEntry

* Use a type

* Make IP nullable

* Add NOT NULL constrains

* Fix typo
2020-11-01 14:07:01 -08:00
Kris Johnson
909419ca27 Fix /randbats interaction with Gen 2 sets 2020-11-01 14:23:40 -07:00
Annika
06cbdada99
Don't allow forcerenamed usernames to be reused (#7609) 2020-10-31 05:54:17 -07:00
Distrib
3909191904
Display the announcement whith /announcement (#7612) 2020-10-31 05:52:17 -07:00
Annika
923b69cac6 Trivia: Prevent stalemates in Infinite mode 2020-10-30 18:09:25 -07:00
Annika
1ab6091551 Helptickets: Properly quote and escape button HTML 2020-10-29 19:30:06 -07:00
Annika
b6326d7a86 Trivia: Document /trivia move 2020-10-29 15:59:31 -07:00
Annika
3ed4a34270
ANOTD: Change tagline to quote
Requested by Anime and Manga staff
2020-10-29 12:07:26 -07:00
Kris Johnson
ab6e173e24
Move natures into their own file (#7601) 2020-10-29 08:38:03 -07:00
Mia
251f801210
Studio: Only request YT video data once (#7595) 2020-10-29 08:31:54 -07:00
Mia
6f22b27e15
Ticketbans: Use the user object (#7596) 2020-10-29 08:11:47 -07:00
Mia
458b47cb39
Chatlog: Allow non-trusted secret room ROs to view logs (#7597) 2020-10-29 06:48:55 -07:00
Annika
62f1bd14fc Chat plugins: Make viewing source respect /permissions 2020-10-28 16:59:45 -07:00
Mia
c67b745d44
Chatlog: Carry opts over when switching days (#7584) 2020-10-28 16:50:57 -07:00
PartMan
a4a3e385e8
Fix G-Max moves not showing up in movesearch (#7555)
Happened because G-Max moves had move.isNonstandard as 'Gigantamax'.
2020-10-28 13:02:37 -07:00
Annika
d4cb0c71c6
Hosts: Support displaying shared IPs (#7568) 2020-10-28 12:08:29 -07:00
Annika
b226a501b3
Helptickets: Add button for the reporter's modlog (#7560)
As per (this suggestion)[https://www.smogon.com/forums/threads/staff-suggestions-bugs.3514540/page-17#post-8634198].
2020-10-28 11:41:12 -07:00
Mia
6f721e31ff
CommandContext: Add a method for getting roomgames (#7531) 2020-10-28 05:20:33 -07:00
Annika
f2a4798bb8
Chatfilters: Fix reasons displaying as undefined (#7579) 2020-10-27 19:44:53 -07:00
Guangcong Luo
c9759954b9 Remove sim/global-variables.d.ts
The sim no longer uses any global variables, so this can and should be
removed.

`server/global-variables` has also been cleaned up, since I'm working
on this.
2020-10-27 22:03:14 +00:00
Mia
34db61539e
Youtube: Cache requested video data (#7593) 2020-10-27 14:11:30 -07:00
Mia
2e864524e0
Chatlog: Use new username html tag (#7519) 2020-10-27 08:10:28 -07:00
Mia
6c825ad198
Youtube: Properly check permissions (#7590) 2020-10-27 10:52:29 -04:00
Mia
bdad542eb3
Studio: Handle Net errors better (#7586) 2020-10-26 20:32:33 -07:00
Kris Johnson
bcff2a7902
The Studio: Allow finding recs by artist/user name (#7578) 2020-10-26 06:25:21 +04:00
Kris Johnson
f95bcfc428 The Studio: Fix crash 2020-10-25 20:20:26 -06: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
Kris Johnson
57e3d7c185
Add The Studio chat plugin (#7542) 2020-10-24 14:09:43 -07:00
Mia
fb3b6e3886
Move Battlesearch to its own file (#7481) 2020-10-24 10:52:52 -07:00
Annika
97713bad33
Validate timeout durations (#7556) 2020-10-22 13:47:26 -07:00
iscke
bbb550bd81
Use new requireRoom API in trivia and scavs (#7553) 2020-10-21 07:56:00 -07:00
Mia
c6aa139f62
Youtube: Persist interval time (#7550) 2020-10-21 05:37:02 -07:00
iscke
99450eba4e
Mafia: Use new requireRoom API (#7552) 2020-10-21 05:27:15 -07:00
Mia
ef6cad7c9d
CommandContext: Make requireRoom support specifying a room (#7549) 2020-10-21 04:21:42 -07:00
Mia
5b387aed47
Chatlog: Support viewing log stats for a room (#7514) 2020-10-20 05:52:45 -07:00
Mia
e7cf8a23c9
COTW: Support saving channel data of winning channels (#7535) 2020-10-20 05:48:24 -07:00
Annika
6c60752085 Trivia: Add option for nonrandom question order 2020-10-19 21:37:36 -07:00
Annika
20752cbb54 Trivia: Fix typo 2020-10-19 21:37:36 -07:00
ZardMX
3a4e1b1f47
Make Galar formes show up in /ds (#7447) 2020-10-19 03:19:04 -07: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
Mia
918d436ac0
Youtube: Move video data fetching to a different function (#7536) 2020-10-19 02:18:44 -07:00
Annika
bca73b19cc
Room events: Add a command to view categories (#7525) 2020-10-19 01:07:05 -07:00
Annika
fe034ac087
Helptickets: Don't show battles for self-reports (#7520) 2020-10-19 00:57:38 -07:00
Annika
c9d62d944e
Chatfilters: Fix wordfilter storage (#7530) 2020-10-17 23:13:28 -07:00
Mia
d020a2f921
Youtube: Support searching for videos (#7529) 2020-10-17 02:52:04 -07:00
Annika
7e188dee1c
Battlesearch: Fix typo 2020-10-16 14:29:53 -07:00
Annika
9aa837b9df
ProcessManager: Support timing out queries (#7502) 2020-10-16 02:56:02 -07:00
Annika
018105bd10 Helptickets: Escape HTML in common battles 2020-10-14 08:52:52 -07:00
Kris Johnson
52fb644d9e
Update various datasearch commands (#7512) 2020-10-12 15:46:19 +04:00
Kris Johnson
31e2e492a1
Repeats: Don't format until repeating and give raw text in the page (#7505) 2020-10-11 14:35:52 -07:00
Mia
ca3e7237d7
Youtube: Support channel categories (#7509) 2020-10-11 13:44:42 -07:00
Kris Johnson
d9b3a510ad
TextFormatter: Support replacing \n without trusted (#7507) 2020-10-11 13:38:34 -07:00
Annika
ea9170b062
Helptickets: Display common battles in more ticket types (#7510) 2020-10-11 13:27:23 -07:00
PartMan
3c7129cb04
Remove background from /scav queue (#7508) 2020-10-11 17:44:05 +04:00
Guangcong Luo
1c0c77ff6b
Update to TypeScript 4.0 (#7504) 2020-10-10 14:43:32 -07:00
Kris Johnson
5378e39127
Repeats: Support repeating HTML (#7495) 2020-10-09 20:33:39 -07:00
Annika
7c23f786f8
Modlog viewer: Improve IP handling (#7498)
- prevents non-global roomstaff from seeing IPs in modnotes or legacy modlogs
- makes modnoted IP addresses link to whatismyipaddress.com
2020-10-09 16:04:48 -07:00
Mia
01aed88a57
RPS: Improve matchup handling (#7497) 2020-10-09 13:43:47 -07:00
Mia
77079b47b8
RPS: Improve several things (#7492) 2020-10-09 12:38:34 -07:00
Annika
b24c44c9b6 Trivia: Support category aliases 2020-10-09 12:37:16 -07:00
Annika
a3b83ba50b
Translations: Convert JSON to TypeScript (#7493) 2020-10-09 12:03:44 -07:00
Guangcong Luo
bfb5c874a4 Repeat: Limit interval to 24 hours
(Bug found by xfix)
2020-10-09 14:58:06 -04:00
Annika
79fe2ac7df
Trivia: Fix typo 2020-10-08 22:37:45 -07:00
Annika
969cde2e35 Datasearch: Limit arguments to 300 characters 2020-10-08 19:55:14 -07:00
Annika
f7eb0c9eae Datasearch: Use CommandContext#checkChat 2020-10-08 19:46:58 -07:00
PartMan
d37b9486d7
Allow Pokemon names as arguments in /stone (#7490) 2020-10-08 19:20:27 +04:00
Kris Johnson
b107236dc5
Repeats: Refactor storing and deleting repeats, let people repeat room FAQs (#7488) 2020-10-07 23:42:30 -07:00
Annika
2698153e7c
Quotes: Use readmore blocks for long quotes (#7465) 2020-10-07 11:28:39 -07:00
Mia
ffeb0413bf
Helpfilter: Fix crash in suggestions (#7409) 2020-10-06 17:07:20 -07:00
Mia
fd28553e2c
Support playing Rock Paper Scissors (#7445) 2020-10-06 16:17:34 -07:00
Mia
896793c010
Youtube: Update channel url handling (#7482) 2020-10-06 16:00:16 -07:00
Mia
4279d1f3bc
Update attributions in various locations (#7354) 2020-10-06 15:55:26 -07:00
Mia
a975f623a4
Chatlog: Add more opts (#7479) 2020-10-06 15:21:57 -07:00
Mia
13aa1d44cd
Battlesearch: Make turn limit optional (#7468) 2020-10-06 10:40:20 -07:00
Annika
df791e9f7d
Trivia: Don't allow locked/muted users to play
Requested by Trivia staff.
2020-10-06 10:17:35 -07:00
Mia
e2e8daa885
Thing of the Day: apply filters to noms (#7466) 2020-10-06 09:34:42 -07:00
Annika
216e4a7354
Add a plugin to repeat phrases in chatrooms (#7338) 2020-10-05 14:25:18 -07:00
asgdf
8eb9a40263
Add more letter substitutions to filter (#7470) 2020-10-05 14:23:39 -07:00
Mia
fe5ef07f0c
Chatlog: Notify the user that a search is running (#7474) 2020-10-05 13:55:28 -07:00
Annika
7eabc7635c
Remove trailing whitespace
I thought I had set up my editor to do this but apparently not.... my bad.
2020-10-05 09:20:22 -07:00
Annika
dc77ad160a
Helptickets: Display common battles more cleanly 2020-10-05 09:06:52 -07:00
Annika
3fcb8f4e00
Use attributes of CommandContext in Chat.filter (#7461) 2020-10-03 21:30:20 -07:00
aQrator
d0b19629dd
Scavengers: Improve /edithunt (#7456)
Two minor changes for the Scavengers plugin:

- Change the ``/`` for alts to a ``;`` to allow easier copying
- Change the edithunt method to allow commas in the answers
2020-10-03 09:55:49 -07:00
Annika
aeaa05bd5a Modlog: Minor fixes
yes another modlog commit from me!
this time, it's making sure that note searches based on user IDs actually get toID() called on them, and fixing some HTML escaping issues
2020-10-02 20:59:42 -07:00
Mia
ab16b48d48
Chatlog: Update permission checks (#7459) 2020-10-02 19:26:29 -07:00
Annika
d807e00e40
Helptickets: Display shared battles in staffintro (#7460) 2020-10-02 19:24:29 -07:00
Annika
3db02d9b7d Trivia: Restrict random mode selection
Random mode should not select First mode if it was played in the past 10 Trivia games
2020-10-02 16:04:41 -07:00
Annika
0dd6e1c0d4
Modlog viewer: Fix formatting of search explanation 2020-10-02 10:00:50 -07:00
Annika
53cebdc09d
Daily spotlights: Add alias for /viewspotlights (#7453) 2020-10-01 15:46:24 -07:00
Jeremy Tan Jie Rui
6e956aee51
Add documentation on maxgen parameter to /ds (#7451) 2020-10-01 09:40:17 -07:00
Mia
3e92bcd2cc
Quotes: Remove the broadcast cooldown for /randquote (#7450) 2020-10-01 09:39:54 -07:00
Annika
0cf43e7461
Modlog: Default to searching all fields (#7449) 2020-10-01 09:36:36 -07:00
Guangcong Luo
523c1a335d
Introduce Chat.oldPlugins (#7434)
This provides a new way to persist chat plugin data across hotpatches:
`Chat.oldPlugins`.

In a plugin, you can now do:

```
export const cache = Chat.oldPlugins.pluginname?.cache || {};
```

to create a cache that will persist across hotpatches.
2020-09-30 19:45:54 -07:00
Annika
0877f0ae1e
Modlog: Fix entries with an IP address and no user (#7446) 2020-09-30 17:55:41 -07:00
Annika
fa571d3b4b
Modlog viewer: Update regex for /ml roomid, search (#7444) 2020-09-30 12:32:15 -07:00
Annika
212b35b2fa
Modlog: Support exact user searches (#7443) 2020-09-30 11:22:49 -07:00
Annika
98b9bd69b1 Fix more modlog attributions 2020-09-29 17:39: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
Mia
b7630b70cf
Chatlog: Handle ErrorMessage properly (#7438) 2020-09-29 14:30:50 -07:00
Kris Johnson
8d080ff320
UNO: Fix timestamp and switch to Chat.ErrorMessage (#7437) 2020-09-29 08:53:21 -07:00
Mia
a9645d29f1 Modlog: fix defaulting to roomid in /modlog 2020-09-28 18:04:57 -05:00
Mia
1eb2c77208
Modlog viewer: Improve UI (#7436) 2020-09-28 16:01:05 -07:00
Annika
6e2a336975 Don't duplicate attributions in modlog entries 2020-09-28 15:26:30 -07:00
Annika
f2ef093493
Modlog: Parse entries in the child process (#7435) 2020-09-28 12:04:06 -07:00
Charlie Kobayashi
493bd033c7
Scavengers: Add October twist (#7433) 2020-09-28 11:21:36 -07:00
Annika
f1b4e3d43a
Modlog: Refactor to use ModlogEntry objects (#7403) 2020-09-28 11:06:30 -07:00
The Immortal
b67701d8a4
Add suspect tests plugin (#7427) 2020-09-27 15:41:04 -07:00
Annika
b865fe537c
Trivia: Fix Mastermind (#7419) 2020-09-27 13:03:06 -07:00
Guangcong Luo
9fe45238f5
Introduce chunk readers for ReadStream (#7215)
This adds new functions `stream.byChunk(bytes)`, `stream.byLine()` etc
which parse a `ReadStream` into an `ObjectReadStream<string>` which
can then be consumed with for-await.

Fixes #7195
2020-09-27 08:55:59 -07:00
Mia
f7288df665 Fix build 2020-09-26 23:27:51 -05:00
Mia
62bcce1d55 Plugins: Don't try-catch ENOENT errors when using FS.readIfExists() 2020-09-26 23:02:45 -05:00
Charlie Kobayashi
eee5e5fa63
Quotes: escape some HTML (#7425) 2020-09-26 20:29:32 -07:00
Mia
78933408bf
Quotes: Move to a chat plugin (#7421) 2020-09-26 08:11:42 -07:00
Annika
2e6ed8a50f
Helptickets: Fix double notification (#7415)
We should only be sending notifications through Staff room rather than the page.
2020-09-25 00:17:14 +04:00
Annika
eb2261b846
Helptickets: Close a user's ticket on global ban (#7411) 2020-09-22 21:00:38 -07:00
Kris Johnson
5a8ded0568
Room FAQs: Convert the rfaq list to a page (#7394) 2020-09-22 19:30:05 -07:00
Mia
7a89492947
Chatlog: Use ProcessManager for searches (#7393) 2020-09-22 18:23:01 -07:00
Annika
1e20f6a96f
Trivia: Add leaderboard management commands (#7402) 2020-09-20 16:33:03 -07:00
Annika
4a61ffd5ac
Trivia: Use Room#subGame for Mastermind (#7371) 2020-09-19 18:32:44 -07:00
Mia
2db1922e87
Battlesearch: Improve phrasing and UI (#7396) 2020-09-19 16:22:15 -07:00
Mia
ae7a46dd37
Chat: Move forcerename tracking to Monitor and Punishments (#7381) 2020-09-19 02:04:49 -07:00
Guangcong Luo
46c470671a
Unify /guess (#7387) 2020-09-19 01:24:52 -07:00
Annika
59ba8aa876
Chat filters: Support custom redtext (#7392) 2020-09-18 20:38:53 -07:00
Annika
6d8d0bd93a
Trivia: Use Chat.ErrorMessage more (#7384) 2020-09-18 16:19:26 -07:00
Mia
6f28e459f3
Battlesearch: Support searching for multiple users and searching months (#7382) 2020-09-18 07:44:33 -07:00
Quinton Lee
bf400c4ef1
Restore global bot permissions for /filters list (#7385) 2020-09-18 05:08:51 -07:00
Annika
357131ec68
Escape regexes in the filter display page
Lookbehind regexes cause problems....
2020-09-16 15:36:08 -07:00
Annika
ba4bb2f120
Helptickets: Display user language and remove prefix (#7373) 2020-09-16 01:21:07 -07:00
Annika
466dfcc5ce Trivia: Fix start officials 2020-09-14 18:06:57 -07:00
Mia
041d8fb0ed
Helptickets: Refactor bans to use the punishment interface (#7365) 2020-09-14 17:02:57 -07:00
Mia
96b4c4c841
Searchlogs: Don't require a room (#7367) 2020-09-14 16:27:26 -07:00
Annika
422649dca7
Trivia: Add a new game called Mastermind (#7368) 2020-09-14 16:03:50 -07:00
whales
3cae09feab Mafia: Fix forcehost 2020-09-13 12:14:49 +09:30
Kris Johnson
b7b609a205 Display BST properly in /crossevo and /showevo 2020-09-11 18:53:08 -06:00
Mia
aa9c36ca62
Thing of the Day: Fix bug in removing users (#7353) 2020-09-11 12:54:56 -07:00
whales
89d1d1a9cf Mafia: Fix broadcasting queue 2020-09-12 00:52:08 +09:30
Mia
23f0c6be74
Helpticket list: Respect ignoring tickets (#7345) 2020-09-10 17:26:31 -07:00
Mia
852858a7a0
Help: Fix issue with approvals (#7347) 2020-09-10 13:35:16 -07:00