Commit Graph

533 Commits

Author SHA1 Message Date
Mia
6690cfb037
Fix pollqueue page crash (#6986) 2020-07-09 22:19:43 -07:00
Annika
db4bb7b46f
Roomevents: Delete events fully (#6984) 2020-07-09 05:00:43 -07:00
Annika
2c24650cf7
Daily spotlight: Fix regex to allow whitespace (#6985) 2020-07-09 05:00:22 -07:00
Annika
573eb439f8
Datasearch: Don't use Object.keys() in /ds monotype (#6982) 2020-07-08 15:39:46 -07:00
Annika
c2f4e524b8
Datasearch: Support /ds monotype without a type (#6981) 2020-07-08 15:12:40 -07:00
Kris Johnson
127a04b19e
Make improvements to the UNO game (#6980) 2020-07-08 15:12:14 -07:00
Annika
d2a61a2b9d
Daily spotlights: Add queue management commands (#6974) 2020-07-07 16:14:50 -07:00
ZestOfLife
a594f0b816
Mafia: Make CS indication more obvious for hosts (#6684) 2020-07-07 14:01:33 +09:30
Kirk Scheibelhut
eea2196280
Server side changes to support persistent user settings and privacy changes (#6947)
NOTE: This is changes the semantics of `hidenext`/`ionext` from
applying to the next created *battle* to applying to the next
created *search*/*challenge*.
2020-07-06 21:18:38 -07:00
Annika
d42e17b7ff
Trivia: Changes to the random category selector (#6971) 2020-07-06 21:16:57 -07:00
Guangcong Luo
c124720885
Support throwing error messages (#6946)
The idea is that throwing `ErrorMessage` will replace needing to pass
`context` variables around (which make it hard to unit test a lot of
chat functions).

I recognize the drawback is that it makes it harder to tell where
chat commands might return from. This might be somewhat alleviated by
a convention such as prefixing everything with `check`

    this.checkBroadcastable();

    this.checkCan('lock');

I honestly didn't like the old approach of `if (!this.can(...)) return`,
though. It didn't seem very obvious which commands would show error
messages and which needed you to write your own error messages. I think
the new system would at least be clearer about that.

We can also consider things such as some sort of sigil, such as:

    !this.checkCan('lock');

There's no other reason to use `!` at the beginning of a line, so I
think this is reasonably unambiguous, although it might take some
time to learn. Also we'd have to screw with eslint.

Another alternative is something all-caps?

    this.CHECK_can('lock');

In the end, I still think `this.checkCan('lock')` would be enough, and
I still think it's already an improvement in many ways.
2020-07-06 14:07:02 -07:00
Guangcong Luo
8b3a3e47cf global is no longer a RoomID 2020-07-06 14:06:00 -07:00
whales
6d3cf8a972 Remove unnecessary room requirements from some commands 2020-07-07 00:54:50 +09:30
Spandan Punwatkar
fa5b90cba3
Add /showevo (#6957)
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2020-07-06 10:53:10 +04: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
Kirk Scheibelhut
bbfcd7ae25 Remove 'inappropriate status' from reports
Staff suggest this is never used for the correct reasons and is more
trouble than its worth
2020-07-04 18:14:10 -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
Annika
61e0a2e9e4
Chatlog: Fix grammar in error message (#6951) 2020-07-03 10:47:08 -07:00
Guangcong Luo
bdb0b0ff72 Refactor Net use in YouTube plugin 2020-07-02 17:14:24 -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
Kris Johnson
7010e0286f
Add OMotM and RoA Spotlight for July 2020 (#6936) 2020-07-01 12:59:10 +04:00
Mia
857d5c648e
Youtube: Allow drivers to use /youtube update (#6933) 2020-06-30 12:11:09 -07:00
Annika
f017398ffc
Trivia: Automatically join a game when answering (#6923) 2020-06-28 12:03:05 -07:00
Annika
4b02342806
Datasearch: Support 'monotype' parameter in /ds (#6922)
also piggybacked a fix for /as in here
2020-06-28 05:17:00 -07:00
fart
8503a6de1f
Correct commands in poll queue help (#6916) 2020-06-25 12:43:04 +04:00
TheMezStrikes
b1247e7892
Fix multiple bugs in events (#6913) 2020-06-24 14:52:31 -07:00
Annika
a578ec99c6
Trivia: Fix bug in /trivia history (#6906) 2020-06-22 22:35:02 -07:00
Annika
bc2aec5c82
Roomevents: Support event categories (#6820) 2020-06-21 21:46:11 -07:00
Guangcong Luo
6af875af8b Improve RoomPermission/GlobalPermission checks
Global permissions can no longer be used as room permissions. Instead,
the two are entirely separate lists, with only a few permissions in
both lists.
2020-06-21 03:53:06 -07:00
Mia
f9e79220dd
Polls: Support queuing (#6595) 2020-06-20 23:56:04 -07:00
Mia
f306ed069f
Youtube: Fix crash (#6891)
Ensure video data exists in the response
2020-06-20 20:47:55 -07:00
Mia
a888c10bb6
Youtube: Don't crash if key isn't configured (#6848) 2020-06-20 20:16:07 -07:00
Annika
128d36aa0b
Trivia: Add /trivia history command (#6880) 2020-06-19 22:43:10 -07:00
Ben Davies
b867fce831 Don't use String#split with an empty string as an argument
String#split with an empty string as an argument butchers Unicode
codepoints that are more than one character long.
String#[Symbol.iterator] doesn't, and is also faster.
2020-06-18 10:50:44 -03:00
Mia
1f6029e156
Youtube: Fix ID crash (#6858) 2020-06-17 20:42:02 -07:00
Guangcong Luo
ba53a2831c Fix bugs in /show
- Chat.getImageDimensions and Chat.fitImage now throw if passed things
  that aren't image URLs.
- Fix help message if you use /show by itself
- Link to full aize image if image is shrunk
2020-06-17 21:11:52 -04:00
Mia
9521580ecf
Modlog: Prevent non-gstaff from searching for IPs (#6844) 2020-06-16 15:51:59 -07:00
Mia
6c97866f83
Add commands to show media in chat (#6745) 2020-06-16 14:40:10 -07:00
Annika
f177ae31dc
Trivia: Fix bug with computing user ranking (#6843) 2020-06-16 14:03:39 -07:00
PartMan
0127813e8c
Show given hints on /scav hint (#6842) 2020-06-16 11:22:44 +02:00
Annika
838d53bf93
Modlog: Escape search terms (#6835) 2020-06-14 19:39:57 -07:00
Guangcong Luo
902dfaba4f Better document debug options in config-example.js 2020-06-13 15:58:35 -07:00
Kris Johnson
394a4c5c9d
Fix UNO DQ message to use correct name (#6831) 2020-06-13 11:21:58 -07:00
Annika
7af048c85b
Datasearch: Fix maxgen and learnset interaction (#6825) 2020-06-10 21:53:21 -07:00
Mia
31263c79a0
Youtube: Fix crashes with checking ID (#6826) 2020-06-10 21:52:54 -07:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00
Charlie Kobayashi
f4c680ac68
Scavengers: Fix /scavtop error due to auth/settings refactor (#6823) 2020-06-09 17:33:03 -07:00
Guangcong Luo
8c4d55b184 Fix bugs in Settings refactor 2020-06-09 15:40:54 -04:00
Mia
15fed24b40
Refactor auth and room.settings (#6777)
This implements two big changes:

- All settings shared between `room.chatRoomData` and `room` have been
  merged into `room.settings` (so, for instance, `room.slowchat` is now
  only `room.settings.slowchat`).

  This makes it so we never have to worry about them getting "out of
  sync".

  - Checking to see if a room is persistent is now `if (room.persist)`
    instead of `if (room.chatRoomData)`

  - `Rooms.global.writeChatRoomData()` is now rarely called directly;
    there's a new `room.saveSettings()` which will handle it for you.

  - All properties of `room.settings` are now optional (except
    `title`).

- There's a new file `user-groups.ts` which handles authority.

  - `room.auth` and `Users.globalAuth` are now
    `Auth extends Map<ID, GroupSymbol>` objects.

  - `room.auth` is now always defined, removing the need for
    `room.auth?.[userid]` workarounds.

  - A lot of code relating to usergroups and permission checks have
    been refactored.

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-06-09 08:22:25 -07:00
PartMan
6848861887
Support Crit in Movesearch (#6808)
A lot of people had been asking about whether it was possible to search for moves with a high critical-hit ratio (relevant for building with things like Sniper or Focus Energy).

(Also includes a refactor to cut down on the number of type assertions
necessary in movesearch code, by Zarel)

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-06-08 09:52:21 -07:00