Commit Graph

34 Commits

Author SHA1 Message Date
Mia
67ee30f2fd
Introduce Config.noipchecks (#7626) 2020-11-04 15:14:30 -08:00
Mia
ef6cad7c9d
CommandContext: Make requireRoom support specifying a room (#7549) 2020-10-21 04:21:42 -07:00
Guangcong Luo
1c0c77ff6b
Update to TypeScript 4.0 (#7504) 2020-10-10 14:43:32 -07:00
Mia
4279d1f3bc
Update attributions in various locations (#7354) 2020-10-06 15:55:26 -07:00
Annika
f1b4e3d43a
Modlog: Refactor to use ModlogEntry objects (#7403) 2020-09-28 11:06:30 -07:00
Mia
62bcce1d55 Plugins: Don't try-catch ENOENT errors when using FS.readIfExists() 2020-09-26 23:02:45 -05: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
Stephen Middleton
33e6783d04
Wifi: Change Lottery winner logic (#6970)
After a Policy decision within Wi-Fi Staff, it's been decided to update the
Lottery Giveaway to still pick winners when there are less than maxWinners,
but people entered. This will allow low entry GA's to overestimate and still
have winners.
2020-08-12 10:03:39 -07:00
Annika
4318d7c9bc
Fix modlog formatting (#7173) 2020-08-07 11:17:34 -07:00
Lusamine
3a2ca90040
Minor cleanup of global demotion messages (#7011) 2020-07-17 01:17:36 -07:00
Nol
b5ada89a74
Wi-Fi: Update Giveaway Message (#7004)
* Wi-Fi: Update Giveaway Message

* Remove Enter
2020-07-14 22:17:07 +02: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
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -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
Annika
f4863a9444
Update references to Global Administrators post-flattening (#6815)
Co-authored-by: Charlie Kobayashi <sparkychildcharlie@gmail.com>
2020-06-08 09:41:03 -07:00
Nol
41300c183c
Wi-Fi: Update giveaway message (#6725) 2020-05-21 18:14:39 +02:00
asgdf
9af7d0c948
Wifi plugin: Fix display issues (#6720) 2020-05-20 15:54:18 +04:00
Konrad Borowski
c687b3b0ed
Replace attributed uhtml on change (#6693)
Not doing so wastes a lot of bandwidth.

This fixes https://www.smogon.com/forums/threads/dont-send-all-uhtml-messages.3664370/

`|uhtmlchange|` is no longer automatically parsed; please use
`room.uhtmlchange(` instead.
2020-05-16 07:16:42 -07:00
Lusamine
49ab39dc8b
Fix sprite formes for Wi-Fi lotto giveaways (#6645) 2020-05-02 20:27:08 -07:00
Lusamine
12a52bc0d0
Add a linebreak to WiFi GA result (#6575) 2020-04-13 20:12:35 -07:00
Nol
61375a24cd
Update Wi-Fi giveaway message (#6560) 2020-04-11 23:38:42 +02:00
Kris Johnson
994fc60aed
Rename Template to Species (#6478) 2020-03-25 23:29:27 -07:00
Waleed Hassan
e86ec0b7fe
Fix Wifi GAs (#6431) 2020-03-08 20:23:37 -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
Astrid Halberkamp
de1a29c507
Wifi: Remove friendcodes from giveaways 2020-03-06 00:05:52 +01:00
Guangcong Luo
b21c9047e2
Migrate to typescript-eslint (#6342) 2020-03-05 08:33:06 -08:00
Kris Johnson
e64e083e6c
Typescript The Cafe (#6379) 2020-02-20 23:01:20 -08:00
HoeenHero
3dcc7d21cc Handle empty/non-existant files when loading 2020-02-19 21:18:10 -05:00
HoeenHero
65bb9635c2 Fix importing of various chat-plugin's data 2020-02-19 21:03:30 -05:00
Kris Johnson
2ea84725e2
Typescript Daily Spotlight, RoomFAQs, and Wi-Fi (#6373) 2020-02-18 13:26:44 -08:00