Commit Graph

59 Commits

Author SHA1 Message Date
PartMan
588d7a9d13
Scavengers: Fix startrecycled/queuerecycled index (#8865) 2022-08-19 11:26:53 -07:00
PartMan
161b48daff
Scavengers: Add Speedrun Twist (#8852) 2022-08-06 17:48:46 -07:00
PartMan
383d8bf870
Scavengers: Fix queuerecycled [index] (#8855) 2022-08-05 20:48:40 -07:00
Charlie Kobayashi
70b7fa7baa
Scavengers: Spam Filter twist (#8691) 2022-03-21 21:09:48 -07:00
Alexander B
0475b38ae8
RoomGame: Refactor to use generic typing (#8678) 2022-03-13 18:01:54 -07:00
PartMan
29421ee145
Scavengers: Notify users on hint addition (#8400) 2021-07-16 12:50:34 -07:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Guangcong Luo
509d0abad4 Refactor out some Object.keys invocations
If you need values, you should be using `Object.values` or
`Object.entries` directly.
2021-05-13 23:02:04 -07:00
PartMan
f2a10c8e0d
Scavengers: Ladder isn't monthly (#8295) 2021-05-10 21:41:22 -07:00
PartMan
cab2ad0c08
Scavengers: Italicize host names on end (#8290)
The `<em>` being wrapped around each individual username and not the entire host string is intentional since it looks better  - and also allows parsing of hosts from the finishing message
2021-05-10 00:20:14 +02: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
PartMan
54ebe56f20
Scavengers: Escape usernames in /scav status (#8201) 2021-04-15 15:46:43 +02:00
PartMan
fb51d2d769
Scavengers: Make !scav queue broadcastable (#8131) 2021-03-26 19:23:04 -07:00
PartMan
fe1d15b34a
Scavengers: Display host's username when hunt ends (#8090) 2021-03-01 11:24:12 +01:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Guangcong Luo
61ea2dd916 Implement Utils.escapeHTMLForceWrap
Combining escapeHTML and forceWrap allows us to use <wbr /> instead
of U+200B, fixing a copy/paste bug.
2021-02-15 06:09:58 -05:00
aQrator
271bed474f
Update scavengers.ts (#7986)
Fix /scavhelp to say /scavhelp staff instead of /roomhelp staff
2021-02-03 00:02:29 +04:00
aQrator
77b2ef6c48
Scavengers: Update /scavhelp (#7985) 2021-02-02 11:11:37 -08:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -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
c44af3286d Implement Utils.forceWrap
I wrote a `forceWrap` method to support break-word wrapping in table
cells for scavengers, but apparently code blocks need it too, so I'm
moving it to Utils.

Fixes #7854
2020-12-30 17:41:41 -08:00
aQrator
62d96c2210
Scavengers: Expand the functionality of /scav timer (#7740) 2020-11-29 09:10:52 +01:00
Annika
34cab27a74
Properly type Promises (#7712) 2020-11-19 23:19:42 -08:00
PartMan
62371e97de
Remove ^ from staff list in /scav top (#7683) 2020-11-11 14:59:11 -08:00
Guangcong Luo
b9a0d3f494 Fix return signature of context.parse 2020-11-11 03:25:06 +00:00
Guangcong Luo
8ce98254c8 Fix vuln in responder 2020-11-09 22:55:20 -05:00
Mia
67ee30f2fd
Introduce Config.noipchecks (#7626) 2020-11-04 15:14:30 -08: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
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
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
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
f1b4e3d43a
Modlog: Refactor to use ModlogEntry objects (#7403) 2020-09-28 11:06:30 -07:00
Guangcong Luo
46c470671a
Unify /guess (#7387) 2020-09-19 01:24:52 -07:00
Mia
44fc0123ad
Chat: Refactor CommandContext and PageContext to use ErrorMessage more (#7234) 2020-09-06 00:15:16 -07:00
Annika
c9fa3fc389
Refactor User#prevNames and User#ips to arrays (#7267) 2020-08-29 10:27:03 -07:00
Charlie Kobayashi
0828d91deb
Scavengers: fix display bugs (#7232) 2020-08-26 07:51:12 -07:00
Annika
4318d7c9bc
Fix modlog formatting (#7173) 2020-08-07 11:17:34 -07:00
Guangcong Luo
873efe91ce Refactor extractRoom to requireRoom
New in PageContext as of 9b3a986ef4ef7:

`extractRoom` no longer shows an error message if the room isn't found.
Instead, `requireRoom` does that.
2020-08-06 00:54:02 -07:00
Charlie Kobayashi
448c9cbcee
Scavengers: general improvements (#7105)
- Add new command to directly stuff a hunt back into the queue
- Better queue response
- Fix extra spaces in teamscav team names
- Get rid of some old code tidbits that were neccessary when roomlogs were still bork
2020-07-31 18:34:47 -07:00
Guangcong Luo
328ba42a12 Change onChatMessage API to use void return
onChatMessage previously took `string | false`, where `false` means
"let the message through". This is a reversal of what `false` usually
means, so this is now updated to `string | void`, which should be
much clearer.
2020-07-29 15:01:04 -07:00
Lusamine
3a2ca90040
Minor cleanup of global demotion messages (#7011) 2020-07-17 01:17:36 -07:00
Mia
4997a47314
Commands: Allow the room parameter to be null (#6948)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-07-05 14:25:09 -07:00
Guangcong Luo
d7ba455e2b Update permissions
Permissions have gotten out-of-date, so this commit syncs them.
Default permissions are now matched with Main, in particular including
the new & rank as admin (removing the old Leader rank and ~ symbol).

Relevant changes:
- Admin (~) and Leader (&) have been merged into Admin (&)
- The 'ban' permission was split into 'globalban' and 'ban'
- The 'broadcast' permission was renamed 'show' (going forward,
  "broadcast" should only refer to the big red/blue/green
  announcement bars.)
- Bots no longer have global moderation abilities, making it
  easier to give untrustworthy bots the "bot" rank.
2020-07-03 17:32:49 -04: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
PartMan
0127813e8c
Show given hints on /scav hint (#6842) 2020-06-16 11:22:44 +02:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00