Commit Graph

104 Commits

Author SHA1 Message Date
Mia
c1cd4630b1
Users: Automatically expire inactive connections (#7957) 2021-01-28 11:43:02 -08:00
Mia
5c9c84c415
Remove User#inRooms and User#games (#7815) 2021-01-28 10:41:35 -08:00
Mia
7095ba77c0 Fix another isStaff instance 2020-12-01 12:30:19 -06:00
Mia
b5e66f3177
Users: Properly assign isStaff to staff roomauth (#7757) 2020-12-01 09:30:39 -08:00
Annika
bae69612b0
Users: Don't give bots isStaff (#7750) 2020-11-30 12:55:46 -08:00
Mia
b0c2f03f41
Users: Apply loginfilters to namelocked users (#7662) 2020-11-08 17:26:10 -08:00
Guangcong Luo
1e39e19f00 Refactor chat to use Utils.splitFirst 2020-11-08 18:31:38 +00:00
Annika
ecd90af23b
Punishments: Make locks expire on their own (#7598) 2020-11-06 15:14:46 -08:00
Guangcong Luo
fbdda144eb
Support Config.noguestsecurity (#7625)
This Config option, intended purely for development test servers,
allows users to log in without a signed token, by using
`/trn [USERNAME]`. This allows logins without a login server.

The rest of the server has been changed to make sure unregistered
users never have any powers they shouldn't have.
2020-11-05 04:55:05 -08:00
Mia
71dbb2f466
Support Config.nothrottle (#7637) 2020-11-05 04:52:04 -08:00
Mia
56501355d7
Support ignoring room invites (#7180) 2020-11-03 10:15:17 -08:00
Annika
1d9c24c382
Users: Don't merge unregistered names across IPs
Fixes #7594
2020-10-30 08:46:52 -07:00
Annika
62f1bd14fc Chat plugins: Make viewing source respect /permissions 2020-10-28 16:59:45 -07:00
Annika
0164af53e4
Support banning users from using groupchats (#7558) 2020-10-28 14:12:42 -07:00
Mia
f1f6f21fc1
Connections: Track current chat page (#7522) 2020-10-26 14:43:16 -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
Annika
a3b83ba50b
Translations: Convert JSON to TypeScript (#7493) 2020-10-09 12:03:44 -07:00
Annika
480079e790
Punishmentfilter: Don't activate for permalocks (#7389) 2020-09-19 01:23:21 -07:00
Annika
66ba5a25b2
Remove Idle status on logging in (#7383) 2020-09-18 03:58:23 -07:00
Annika
83e8262d12
Users: Fix bug with IP handling (#7305) 2020-09-05 08:18:42 -07:00
Annika
c9fa3fc389
Refactor User#prevNames and User#ips to arrays (#7267) 2020-08-29 10:27:03 -07:00
Annika
bece58ee93
Fixes for /unrangelock (#7266) 2020-08-26 22:48:00 -07:00
Annika
33e8da3c13
Properly inform client of statusType changes (#7262)
This should fix the bug where usernames remain grey on the client after reloading.
2020-08-26 07:49:05 -07:00
Annika
d65335f415
Improve handling of locks when users are merged (#7264) 2020-08-26 04:34:44 -07:00
Guangcong Luo
91a86df155 Fix /hiderank 2020-08-22 07:47:36 -07:00
Guangcong Luo
e14485656f Implement a basic /hiderank
This doesn't really have any nice-to-have automatic restoration
features but it should be all the important parts.

`user.group` no longer exists, and has been replaced with
`user.tempGroup`, which now applies both to temporary promotions of
unregistered users, as well as temporary hidden ranks of auth.
2020-08-22 07:20:26 -07:00
Guangcong Luo
2878793964 Revert accidental merge of /hiderank code
`/hiderank` code was accidentally merged into #7078

This fully backs out its code.
2020-08-22 06:57:24 -07:00
Annika
3ef50d8feb
Move forced public prefix logic to RoomBattle (#7244) 2020-08-22 05:29:51 -07:00
Annika
27d4212771
Display whitelist correctly in demotion messages (#7238) 2020-08-20 21:18:09 -07:00
Annika
44d369ca8a
Allow users to set their own language and translate helptickets (#7220) 2020-08-19 00:21:51 -07:00
Annika
fe2f77c5fe
Improvements to the /dnd command (#7196) 2020-08-18 16:56:51 -07:00
Guangcong Luo
a315c93836 Switch to using import type
We were previously using `type Foo = import('bar').Foo` which works
actually equally well, because sucrase didn't support `import type`,
but now it does!
2020-08-09 08:07:00 -05:00
Annika
8287cbc7fb
Remove User#authAtLeast and add more sysop bypasses (#7046) 2020-08-06 00:12:30 -07:00
Annika
cd85cd7a9d
Hosts & IPTools: Refactor to remove hardcoded ranges (#7078) 2020-07-29 23:04:50 -07:00
Mia
94fff9d496
Support customizing permissions per-room (#6883) 2020-07-29 00:22:03 -07:00
Guangcong Luo
3931f680c3 Improve assertion error message
There's no longer a need to assume that corrupt assertions are
assertions from 2013, rather than some other code mistake.

Inspired by #7064
2020-07-28 17:10:05 -07:00
Peach
f2bfe2538c
Make sendhtmlpage perms more strict, refactor perm checks (#7044) 2020-07-25 23:31:28 -07:00
Annika
528045a03f
Support hiding battles from /cmd userdetails (#7040) 2020-07-23 21:30:30 -07:00
Annika
7375ab4d90
Add cooldown for unregistered namechanges (#7032) 2020-07-23 00:00:29 -07:00
Peach
e9611b7ce2
Remove unnecessary references to the global room (#7033) 2020-07-22 08:52:46 -07:00
Annika
570df13186
Support renaming battles (#7015) 2020-07-18 21:27:24 -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
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
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
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
Guangcong Luo
ee6e43b552 Strongly type RoomPermission and GlobalPermission
`user-groups.ts` now tracks the list of possible values for
`RoomPermission` and `GlobalPermission` in a const.
2020-06-21 01:43:27 -07:00
Guangcong Luo
8c4d55b184 Fix bugs in Settings refactor 2020-06-09 15:40:54 -04:00
Guangcong Luo
c444036f85 Support whitelisting users
(Whitelist is being implemented as a hardcoded custom group.)
2020-06-09 08:22:44 -07: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