Commit Graph

33 Commits

Author SHA1 Message Date
Mia
cfeb1303bb
Chat: Properly typecheck Chat.runHandlers arguments (#8612) 2022-01-23 17:55:19 -08:00
Mia
f608496938
Support JSX in HTML pages (#8523)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-11-12 22:06:26 -08:00
Annika
b712278fd0
Use global punishments instead of fake rooms (#8350) 2021-06-02 21:54:33 -07:00
Mia
7ae21cebf8
Chat: Support exporting custom handlers from plugins (#8319) 2021-05-28 23:13:01 -07: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
Mia
12b319e713 Helptickets: Add claiming and add more punishment types to text tickets 2021-05-13 08:34:52 -05:00
Mia
ea6f6a81d9
Chat: Allow plugins to add custom /crq handlers (#8225) 2021-04-25 15:26:05 -07:00
Guangcong Luo
810aff74cd Namespace more server global types 2021-04-25 14:16:27 -07:00
Mia
b7680c783d
Add infrastructure to rename chat plugin data with rooms (#8153) 2021-04-01 01:23:01 -04:00
Kris Johnson
081326b69c
Refactor minor activities (#7766) 2021-01-28 12:12:54 -08:00
Guangcong Luo
53c6b9103a Remove #chatfilter from PunishType
PunishType is currently only used for proxy detection markers, which
this should make clearer.

Chatfilters now use the regular punishment system (setting user.locked
to the user ID).
2020-12-09 23:18:17 +00:00
Mia
186677239d
Nicknamefilter: Support hiding nicks from filters (#7751) 2020-12-01 06:21:17 -08:00
Annika
0164af53e4
Support banning users from using groupchats (#7558) 2020-10-28 14:12:42 -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
Annika
eb2261b846
Helptickets: Close a user's ticket on global ban (#7411) 2020-09-22 21:00:38 -07:00
Annika
59ba8aa876
Chat filters: Support custom redtext (#7392) 2020-09-18 20:38:53 -07:00
Guangcong Luo
0ca4ed2839 Improve private command support
Private commands can now use `this.privatelyCan` instead of `this.can`
to automatically display "command not found" in the command
(and in Help) for permission failure. They can also use
`this.commandDoesNotExist` to explicitly invoke the error message.

I'm not merging #7141 because I wrote basically all of the code
in this commit, and future blames should go to me if something here
is wrong.

Closes #7141

    Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
2020-08-16 13:21:07 -07:00
Annika
8287cbc7fb
Remove User#authAtLeast and add more sysop bypasses (#7046) 2020-08-06 00:12:30 -07:00
Mia
47d00bf912
Support per-command permissions for sub-commands (#7142) 2020-08-04 03:01:17 -07:00
Guangcong Luo
52f0096c30 Refactor Auth.hasPermission
Half the permissions checks were previously in `user.can`, which is
unintuitive. It's now completely self-contained and should be pretty
readable, now, with `getEffectiveSymbol` and `hasJurisdiction` as
separate functions.
2020-07-13 00:55:23 -07:00
Guangcong Luo
8b3a3e47cf global is no longer a RoomID 2020-07-06 14:06:00 -07:00
Guangcong Luo
26615490f7 Merge BasicChatRoom and BasicRoom
They were only ever kept separate because of GlobalRoom. It might be
useful to support rooms that aren't ChatRooms, but we've been chucking
properties into either BasicChatRoom or BasicRoom essentially at
random, so I think it makes sense to wait until we actually have a
use-case for a non-Chat room before carefully deciding which properties
belong where.
2020-07-02 18:54:02 -07:00
Guangcong Luo
46c9afa2f3
"Remove" the global room (#6885)
I couldn't completely remove the global room in one commit, but this
solves basically every problem with it by making it no longer a `Room`.

In particular, this means:

- It's no longer of type `Room`
- It's no longer in the `Rooms.rooms` table
- Its class name is now `GlobalRoomState` rather than `GlobalRoom`
- It no longer tracks its own user list (online user count is now
  provided by `Users.onlineCount`)
- It's no longer a socket channel (there's new syntax for "send this
  message to every user")
2020-07-02 11:31:34 -07:00
Guangcong Luo
776ccf9796
Refactor Sockets to ProcessManager+TypeScript (#6584) 2020-04-17 04:05:45 -07:00
Mia
3fc757e958
Typescript chat-commands/moderation, refactor Punishments (#6490) 2020-04-08 11:56:19 -07:00
Guangcong Luo
125fe31d06 Improve eslintrc
Fixed some more code style, allowing these rules to be enabled:

- `comma-dangle`
- `function-paren-newline`
- `member-delimiter-style`
- `no-eval`
- `no-fallthrough`
- `no-misused-promises`
- `no-unused-vars`
- `operator-linebreak`
2020-03-06 22:35:55 -08:00
Guangcong Luo
b21c9047e2
Migrate to typescript-eslint (#6342) 2020-03-05 08:33:06 -08:00
whales
38daf467fc
Add some common rooms to the roomid type (#6393) 2020-02-24 19:52:41 -08:00
Kris Johnson
98190d28a1
Typescript Datasearch (#6376) 2020-02-20 16:37:13 -08:00
Waleed Hassan
02c862da31 Add a GroupSymbol type (#6285) 2020-01-14 14:07:11 -08:00
whales
0b9d8dd109 Support declarative roomsettings syntax (#6119) 2019-12-06 23:16:55 +09:00
Waleed Hassan
a518cf102a Take steps to statically type Config (#5920)
This commit changes the TypeScript global variable of `Config` from
`AnyObject` to `Config & AnyObject`.

It still falls back to `AnyObject` (hence the 'Take steps') because of
the main-specific `Config` properties that are used without being in the
`Config` object itself.

These can be added by someone with access to the PS main server.

Regardlesss, this is an improvement as IntelliSense can display and
autocomplete the known properies.

In addition, the TypeScript compiler will now report bugs
concerning the types of the properties, which I have fixed in this
commit.
2019-10-30 18:45:20 +10:30
Waleed Hassan
c88dfba1d1 Server: Reorganize TypeScript globals (#5903) 2019-10-21 14:39:59 +10:30