Commit Graph

2896 Commits

Author SHA1 Message Date
Guangcong Luo
fc0e50e8f9 Fix bug in previous commit 2020-11-08 22:26:55 +00:00
Guangcong Luo
1e39e19f00 Refactor chat to use Utils.splitFirst 2020-11-08 18:31:38 +00:00
Guangcong Luo
e55cead3e4 Document context.parseCommand 2020-11-08 18:31:38 +00:00
Mia
fc80f47b0b
Helptickets: Fix ticketban list html (#7636) 2020-11-07 19:14:08 -08:00
Konrad Borowski
7bcdf130bd
Chatlog: Escape regex when searching for an user (#7656) 2020-11-07 18:19:38 -08:00
Annika
fde82ca866 Punishments: Improve timer duration validation
must. lock. proxies.
2020-11-07 17:14:22 -08:00
Mia
950c74360b
Chatlog: Handle next result buttons properly (#7658) 2020-11-07 14:58:53 -08:00
Konrad Borowski
119b98b593
Chatlog: Automatically determine regex engine (#7657)
This makes ripgrep use PCRE2 for searching logs only when necessary.
2020-11-07 14:32:44 -08:00
Annika
ce6a20aea1 Punishments: Validate timeout durations 2020-11-06 18:17:44 -08:00
Annika
edc53a6fc6 Fix password generation for private battles 2020-11-06 17:43:46 -08:00
Annika
ecd90af23b
Punishments: Make locks expire on their own (#7598) 2020-11-06 15:14:46 -08:00
Annika
e6a61e52aa
Fix renaming battle rooms (#7399) 2020-11-06 15:14:08 -08:00
Annika
059452dc0d
Modlog: Move type signatures into Map constructors 2020-11-06 11:54:16 -08:00
Annika
ec0a92469a Modlog: Make tests work without SQLite 2020-11-05 22:40:53 -08:00
Annika
0a27f398df
Helptickets: Display message in unclaimed tickets (#7647) 2020-11-05 11:09:47 -08:00
Konrad Borowski
32f299584f
Remove hotpatch notifications from Upper Staff (#7646) 2020-11-05 22:56:39 +04:00
Guangcong Luo
9b5217ab70
Split up dex-data into more files (#7634)
* Split up dex-data over individual files

This commit introduces:
- `dex-abilities.ts`
- `dex-conditions.ts`
- `dex-formats.ts`
- `dex-items.ts`
- `dex-moves.ts`
- `dex-species.ts`

These files centralize definitions from `dex-data` and `global-types`.

* Inherit ItemData from Item etc

Previously, Condition inherited from ConditionData. Now, ConditionData
inherits from Condition. The advantage of the new approach is that now,
Condition and DataCondition no longer need to be separate types, and
there should be much less duplication of type definitions in general.

This has also been done for

- ItemData/Item/DataItem
- AbilityData/Ability/DataAbility
- FormatData/Format/DataFormat

Species and DataSpecies was already merged, but this also reverses
their inheritance (saving a lot of duplicated definitions in the
process!)

The only one left is MoveData, which is just super complicated and
will need its own commit.
2020-11-05 05:00:13 -08:00
Mia
938d998da0
Mafia: Allow staff to speak in games (#7642) 2020-11-05 04:57:09 -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
Kris Johnson
acbe53ba4a
Modernize the coding style of the OM chat plugin (#7643) 2020-11-05 04:50:05 -08:00
Konrad Borowski
1a9bfa044a
Require a digit to follow port number in links (#7644) 2020-11-05 04:44:28 -08:00
Annika
56506c1801 Fix blocking room invites
When settings.blockInvites is false or undefined, we should allow room invites to be sent.
However, this code denies it because it thinks that the user sending the message is not of the rank "undefined" (or "false"), which isn't a real rank.
2020-11-04 21:37:57 -08:00
Mia
67ee30f2fd
Introduce Config.noipchecks (#7626) 2020-11-04 15:14:30 -08:00
Mia
8a1919fd0a Chatlog: Update arg handling 2020-11-04 14:24:53 -06:00
Mia
065be6ca78
Topusers: Fix arg handling (#7635) 2020-11-04 23:14:40 +04:00
Konrad Borowski
da24ba9c6e
Consider bots to be staff (#7633) 2020-11-04 05:21:46 -08:00
Annika
202bb7affe Modlog: Properly clean up streams
We don't need a reason to differentiate between whether or not a modlog stream was never initialized or was previously destroyed, and we don't need a Map with 8.2 million keys.
2020-11-03 15:44:57 -08:00
Mia
56501355d7
Support ignoring room invites (#7180) 2020-11-03 10:15:17 -08:00
Leonard Craft III
920af21aac
Abilities: Add isPermanent flag (#7614) 2020-11-03 10:31:11 -05:00
Annika
ee79159a25 Helptickets: Don't make global modlog entries 2020-11-02 21:58:46 -08:00
Annika
aa069ce8fd
Support disabling modlogs (#7619)
Co-authored-by: Christopher Monsanto <chris@monsan.to>
2020-11-02 22:59:31 -05:00
Mia
89d127eafd
ProcessManager: Add a static execFile (#7566) 2020-11-02 11:35:07 -08:00
Mia
e2cb3a1f57
Chatlog: Support searching for a user (#7591) 2020-11-02 08:50:58 -08:00
Mia
c0baf2135d
Make /addline broadcastable and rename to /pline (#7621) 2020-11-02 08:47:55 -08:00
Mia
c5907735ef
Tournaments: Start timer in all battles when forcetimer is activated (#7624) 2020-11-02 08:42:33 -08:00
Mia
22a410afea
Support basic text formatting in polls/announcements (#7623) 2020-11-02 08:42:03 -08:00
Mia
cbf4a450da
Add /vsl alias to viewspotlights (#7622) 2020-11-02 08:40:41 -08:00
Annika
3b709ac34f
Fix permission check for /addline 2020-11-01 18:43:02 -08:00
Annika
dab9f570f1 Modlog: Don't write alts if there are no alts 2020-11-01 16:25:36 -08:00
Annika
7f2dec0797
Modlog: Avoid optional properties in ModlogEntry (#7613)
* Modlog: Avoid optional properties in ModlogEntry

* Use a type

* Make IP nullable

* Add NOT NULL constrains

* Fix typo
2020-11-01 14:07:01 -08:00
Kris Johnson
909419ca27 Fix /randbats interaction with Gen 2 sets 2020-11-01 14:23:40 -07:00
Guangcong Luo
db4963e49f Improve "click here" error message 2020-11-01 02:06:24 +00:00
Annika
06535b4235 Modlog: Disallow duplicates in ModlogEntry#alts 2020-10-31 14:13:23 -07:00
Annika
06cbdada99
Don't allow forcerenamed usernames to be reused (#7609) 2020-10-31 05:54:17 -07:00
Distrib
3909191904
Display the announcement whith /announcement (#7612) 2020-10-31 05:52:17 -07:00
Annika
923b69cac6 Trivia: Prevent stalemates in Infinite mode 2020-10-30 18:09:25 -07:00
Annika
58d8a2af70 Fix API for writing to the global modlog 2020-10-30 16:57:29 -07:00
Annika
b9d993495d Modlog: Fix crash in writing global modlog 2020-10-30 16:36:55 -07:00
Annika
2f130e8762
Modlog: Support logging to a SQLite database (#7513)
* Modlog: Support logging to a SQLite database

Co-authored-by: Christopher Monsanto <chris@monsan.to>
2020-10-30 19:27:25 -04:00
Annika
84ff0cd90c
Fix permission checks for global promotions 2020-10-30 15:59:40 -07:00
HoeenHero
f158940783
Don't report multiple punishments for a single room (#7606) 2020-10-30 09:51:10 -07:00
Annika
1d9c24c382
Users: Don't merge unregistered names across IPs
Fixes #7594
2020-10-30 08:46:52 -07:00
Annika
1ab6091551 Helptickets: Properly quote and escape button HTML 2020-10-29 19:30:06 -07:00
Annika
7db0505e7b
Moderation: Remove whitespace 2020-10-29 18:11:27 -07:00
Annika
2469dd7c08
Moderation: Actually make groupchatbans hotpatchable 2020-10-29 18:04:18 -07:00
Annika
b6326d7a86 Trivia: Document /trivia move 2020-10-29 15:59:31 -07:00
Marty-D
89050aaefb
Add missing Trainer avatars 2020-10-29 15:22:42 -04:00
Annika
3ed4a34270
ANOTD: Change tagline to quote
Requested by Anime and Manga staff
2020-10-29 12:07:26 -07:00
Kris Johnson
ab6e173e24
Move natures into their own file (#7601) 2020-10-29 08:38:03 -07:00
Mia
251f801210
Studio: Only request YT video data once (#7595) 2020-10-29 08:31:54 -07:00
Mia
6f22b27e15
Ticketbans: Use the user object (#7596) 2020-10-29 08:11:47 -07:00
Mia
458b47cb39
Chatlog: Allow non-trusted secret room ROs to view logs (#7597) 2020-10-29 06:48:55 -07:00
Guangcong Luo
2fd138f82c Reorganize README
The README has been split up so guides for PS's different use-cases are
easier to find.
2020-10-29 13:17:26 +00:00
Annika
efcbc6ce3d
Include groupchat bans in /punishments 2020-10-28 18:59:28 -07:00
Annika
62f1bd14fc Chat plugins: Make viewing source respect /permissions 2020-10-28 16:59:45 -07:00
Mia
c67b745d44
Chatlog: Carry opts over when switching days (#7584) 2020-10-28 16:50:57 -07:00
Annika
0164af53e4
Support banning users from using groupchats (#7558) 2020-10-28 14:12:42 -07:00
PartMan
a4a3e385e8
Fix G-Max moves not showing up in movesearch (#7555)
Happened because G-Max moves had move.isNonstandard as 'Gigantamax'.
2020-10-28 13:02:37 -07:00
Annika
73078447a5
Punishments: Make rangelocks persistent (#7545)
This solves the issue with yearlocks disappearing.
2020-10-28 12:08:52 -07:00
Annika
d4cb0c71c6
Hosts: Support displaying shared IPs (#7568) 2020-10-28 12:08:29 -07:00
Annika
b226a501b3
Helptickets: Add button for the reporter's modlog (#7560)
As per (this suggestion)[https://www.smogon.com/forums/threads/staff-suggestions-bugs.3514540/page-17#post-8634198].
2020-10-28 11:41:12 -07:00
Mia
6f721e31ff
CommandContext: Add a method for getting roomgames (#7531) 2020-10-28 05:20:33 -07:00
Annika
f2a4798bb8
Chatfilters: Fix reasons displaying as undefined (#7579) 2020-10-27 19:44:53 -07:00
Charlie Kobayashi
4272005e42
sendReplyBox: fix interaction with hidelines (#7577) 2020-10-27 19:32:03 -07:00
Annika
a273e53e08
Make /clearstatus log to Staff room (#7557)
`/forcerename` and other global punishments do this
2020-10-27 19:24:09 -07:00
Guangcong Luo
3b4a3ba7e0 Improve custom rule validation
Stray spaces are now consistently allowed in `/tour rules` and
`/challenge`, but are not allowed in `formats.ts`.

Improves #6811
2020-10-28 02:18:52 +00:00
Guangcong Luo
a38f0597f8 Remove last vestiges of tslint 2020-10-27 22:49:00 +00:00
Guangcong Luo
c9759954b9 Remove sim/global-variables.d.ts
The sim no longer uses any global variables, so this can and should be
removed.

`server/global-variables` has also been cleaned up, since I'm working
on this.
2020-10-27 22:03:14 +00:00
Konrad Borowski
6fe378b246
Indicate pending promises in /eval (#7592) 2020-10-27 14:33:04 -07:00
Mia
34db61539e
Youtube: Cache requested video data (#7593) 2020-10-27 14:11:30 -07:00
Mia
d045890884
/show: Throttle requests (#7589) 2020-10-27 23:02:02 +04:00
Mia
2e864524e0
Chatlog: Use new username html tag (#7519) 2020-10-27 08:10:28 -07:00
Mia
6c825ad198
Youtube: Properly check permissions (#7590) 2020-10-27 10:52:29 -04:00
Mia
bdad542eb3
Studio: Handle Net errors better (#7586) 2020-10-26 20:32:33 -07:00
Annika
99dce89cc6
Fix behavior of /faq with no arguments 2020-10-26 14:52:02 -07:00
Mia
f1f6f21fc1
Connections: Track current chat page (#7522) 2020-10-26 14:43:16 -07:00
Annika
c55c741c81
Move server/'s global variables out of index.ts (#7585) 2020-10-26 13:55:51 -07:00
Kris Johnson
bcff2a7902
The Studio: Allow finding recs by artist/user name (#7578) 2020-10-26 06:25:21 +04:00
Kris Johnson
f95bcfc428 The Studio: Fix crash 2020-10-25 20:20:26 -06:00
Quinton Lee
6c6ba3ce45
Battlesearch: fix crash in child processes 2020-10-24 17:50:21 -05:00
Guangcong Luo
e8451f8104 Clean up imports
A lot of our code for child processes doesn't really follow our
original standards. This refactors them back to work the way they
were intended to.
2020-10-24 22:12:35 +01:00
Kris Johnson
57e3d7c185
Add The Studio chat plugin (#7542) 2020-10-24 14:09:43 -07:00
Mia
fb3b6e3886
Move Battlesearch to its own file (#7481) 2020-10-24 10:52:52 -07:00
Annika
bd5d026c43 Fix crash in Punishments#autolock
We should be destroying a user's personal rooms _after_ making a modlog entry.
2020-10-23 15:25:57 -07:00
Annika
97713bad33
Validate timeout durations (#7556) 2020-10-22 13:47:26 -07:00
Annika
61f072f793 Moderation: Improve modlog entry for /rangeban 2020-10-22 21:01:36 +01:00
Annika
dcc9c63433
Support replay URLs in /join (#7526) 2020-10-22 01:57:26 -07:00
Guangcong Luo
e98024f88f Fix bug in toDurationString precision
Fixes #7554
2020-10-21 19:04:06 -04:00
iscke
bbb550bd81
Use new requireRoom API in trivia and scavs (#7553) 2020-10-21 07:56:00 -07:00
Mia
c6aa139f62
Youtube: Persist interval time (#7550) 2020-10-21 05:37:02 -07:00
iscke
99450eba4e
Mafia: Use new requireRoom API (#7552) 2020-10-21 05:27:15 -07:00
Guangcong Luo
d6eeb197c1 Improve Chat.toDurationString
- Default precision is now 3.

  (Instead of "3 months 25 days 17 hours 46 minutes 40 seconds", it'll
	say "3 months 25 days 17 hours". You can still set the precision to
	`Infinity` if you actually prefer that.)

- Now displays "forever" for Infinity or overflow durations

- No longer skips blank precision levels

  (Shows "3 hours 0 minutes 10 seconds" instead of
	"3 hours  10 seconds")
2020-10-21 13:05:08 +01:00
Mia
ef6cad7c9d
CommandContext: Make requireRoom support specifying a room (#7549) 2020-10-21 04:21:42 -07:00
Mia
7da1bdeab9
Remove /roomwhitelist from /roomhelp (#7547) 2020-10-21 03:15:18 -07:00
Mia
5b387aed47
Chatlog: Support viewing log stats for a room (#7514) 2020-10-20 05:52:45 -07:00
Mia
e7cf8a23c9
COTW: Support saving channel data of winning channels (#7535) 2020-10-20 05:48:24 -07:00
Annika
6c60752085 Trivia: Add option for nonrandom question order 2020-10-19 21:37:36 -07:00
Annika
20752cbb54 Trivia: Fix typo 2020-10-19 21:37:36 -07:00
ZardMX
3a4e1b1f47
Make Galar formes show up in /ds (#7447) 2020-10-19 03:19:04 -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
Mia
918d436ac0
Youtube: Move video data fetching to a different function (#7536) 2020-10-19 02:18:44 -07:00
Annika
5118c9edfa
Moderation: Make weekbans override 2-day roombans (#7534)
For consistency with /weeklock
2020-10-19 01:07:40 -07:00
Annika
bca73b19cc
Room events: Add a command to view categories (#7525) 2020-10-19 01:07:05 -07:00
Distrib
36ce1dc872
Add alias for /makegroupchat and /deletegroupchat (#7532)
For https://www.smogon.com/forums/threads/make-mgc-shorthand-for-makegroupchat.3671952/
2020-10-19 01:06:20 -07:00
Annika
fe034ac087
Helptickets: Don't show battles for self-reports (#7520) 2020-10-19 00:57:38 -07:00
Annika
111f1383a9
Modlog: Add weekroomban as a punishment 2020-10-18 12:04:11 -07:00
Annika
c9d62d944e
Chatfilters: Fix wordfilter storage (#7530) 2020-10-17 23:13:28 -07:00
Mia
d020a2f921
Youtube: Support searching for videos (#7529) 2020-10-17 02:52:04 -07:00
Annika
7e188dee1c
Battlesearch: Fix typo 2020-10-16 14:29:53 -07:00
Annika
9aa837b9df
ProcessManager: Support timing out queries (#7502) 2020-10-16 02:56:02 -07:00
Annika
ab93c7a550 Punishments: Fix bug in getRoomPunishments
This fixes the issue with users who got roombanned on multiple IP addresses being autolocked erroneously.
2020-10-15 15:22:50 -07:00
Annika
018105bd10 Helptickets: Escape HTML in common battles 2020-10-14 08:52:52 -07:00
Guangcong Luo
0b0cf3733d Fix toTimestamp type signature 2020-10-13 04:40:38 -07:00
Kris Johnson
52fb644d9e
Update various datasearch commands (#7512) 2020-10-12 15:46:19 +04:00
Annika
2f816d68fb Fix permission checking for room deletion 2020-10-11 17:33:31 -07:00
Kris Johnson
31e2e492a1
Repeats: Don't format until repeating and give raw text in the page (#7505) 2020-10-11 14:35:52 -07:00
Mia
ca3e7237d7
Youtube: Support channel categories (#7509) 2020-10-11 13:44:42 -07:00
Kris Johnson
d9b3a510ad
TextFormatter: Support replacing \n without trusted (#7507) 2020-10-11 13:38:34 -07:00
Annika
ea9170b062
Helptickets: Display common battles in more ticket types (#7510) 2020-10-11 13:27:23 -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
Kris Johnson
5378e39127
Repeats: Support repeating HTML (#7495) 2020-10-09 20:33:39 -07:00
Annika
fc0a16d3cb
Modlog: Fix regex in Modlog#getGlobalPunishments 2020-10-09 18:18:58 -07:00
Annika
7c23f786f8
Modlog viewer: Improve IP handling (#7498)
- prevents non-global roomstaff from seeing IPs in modnotes or legacy modlogs
- makes modnoted IP addresses link to whatismyipaddress.com
2020-10-09 16:04:48 -07:00
Mia
92b77cc459
User groups: Autojoin staff rooms on global promo (#7500) 2020-10-09 16:04:06 -07:00
Mia
e324ba260b
Moderation: Notify Staff for RO promos (#7499) 2020-10-09 15:59:18 -07:00
Mia
01aed88a57
RPS: Improve matchup handling (#7497) 2020-10-09 13:43:47 -07:00
Distrib
b433197e6a
Remove the broadcast cooldown for !showteam (#7486) 2020-10-09 13:25:21 -07:00
Annika
a285c2cf2c
Chat: Propagate promises for loading translations (#7496) 2020-10-09 13:15:50 -07:00
Mia
77079b47b8
RPS: Improve several things (#7492) 2020-10-09 12:38:34 -07:00
Annika
b24c44c9b6 Trivia: Support category aliases 2020-10-09 12:37:16 -07:00
Annika
a3b83ba50b
Translations: Convert JSON to TypeScript (#7493) 2020-10-09 12:03:44 -07:00
Guangcong Luo
bfb5c874a4 Repeat: Limit interval to 24 hours
(Bug found by xfix)
2020-10-09 14:58:06 -04:00
Annika
79fe2ac7df
Trivia: Fix typo 2020-10-08 22:37:45 -07:00
Annika
969cde2e35 Datasearch: Limit arguments to 300 characters 2020-10-08 19:55:14 -07:00
Annika
f7eb0c9eae Datasearch: Use CommandContext#checkChat 2020-10-08 19:46:58 -07:00
Mia
fb23fc8733
/showteam: Properly handle nick/form names (#7489) 2020-10-08 13:31:29 -07:00
PartMan
d37b9486d7
Allow Pokemon names as arguments in /stone (#7490) 2020-10-08 19:20:27 +04:00
Kris Johnson
b107236dc5
Repeats: Refactor storing and deleting repeats, let people repeat room FAQs (#7488) 2020-10-07 23:42:30 -07:00
Annika
2698153e7c
Quotes: Use readmore blocks for long quotes (#7465) 2020-10-07 11:28:39 -07:00
Mia
ffeb0413bf
Helpfilter: Fix crash in suggestions (#7409) 2020-10-06 17:07:20 -07:00
Mia
fd28553e2c
Support playing Rock Paper Scissors (#7445) 2020-10-06 16:17:34 -07:00
Mia
896793c010
Youtube: Update channel url handling (#7482) 2020-10-06 16:00:16 -07:00
Mia
4279d1f3bc
Update attributions in various locations (#7354) 2020-10-06 15:55:26 -07:00
Mia
4620068159
Chat commands: make /addrankuhtml multiline (#7480) 2020-10-06 15:23:14 -07:00
Mia
a975f623a4
Chatlog: Add more opts (#7479) 2020-10-06 15:21:57 -07:00
Annika
2660741e9a
Fix /help for room promotion commands (#7478) 2020-10-06 15:18:55 -07:00
Mia
01c3e0e3ef
Add a command to view the registration time of a user (#7366) 2020-10-06 11:47:12 -07:00
Leonard Craft III
789d892098
Chat#checkHTML: Ban <iframe> tags (#7476) 2020-10-06 11:16:04 -07:00
Mia
13aa1d44cd
Battlesearch: Make turn limit optional (#7468) 2020-10-06 10:40:20 -07:00
Annika
df791e9f7d
Trivia: Don't allow locked/muted users to play
Requested by Trivia staff.
2020-10-06 10:17:35 -07:00
Mia
e2e8daa885
Thing of the Day: apply filters to noms (#7466) 2020-10-06 09:34:42 -07:00
Annika
216e4a7354
Add a plugin to repeat phrases in chatrooms (#7338) 2020-10-05 14:25:18 -07:00
asgdf
8eb9a40263
Add more letter substitutions to filter (#7470) 2020-10-05 14:23:39 -07:00
PartMan
fa5456deca
Make !groups case-insensitive (#7475) 2020-10-05 14:22:20 -07:00
Mia
fe5ef07f0c
Chatlog: Notify the user that a search is running (#7474) 2020-10-05 13:55:28 -07:00
Annika
7eabc7635c
Remove trailing whitespace
I thought I had set up my editor to do this but apparently not.... my bad.
2020-10-05 09:20:22 -07:00
Annika
dc77ad160a
Helptickets: Display common battles more cleanly 2020-10-05 09:06:52 -07:00
Quinton Lee
0094f34e38
Chat: fix CommandContext#filter in PMs
The ChatFilter type already specifies room as `Room | null` so this check should not be needed.
2020-10-04 13:22:57 -05:00
Guangcong Luo
177b2c4af2 Fix tour autostart
Fixes #7469
2020-10-03 21:49:38 -07:00
Annika
3fcb8f4e00
Use attributes of CommandContext in Chat.filter (#7461) 2020-10-03 21:30:20 -07:00
Annika
f4dee3c7f9
Modlog: Fix bug with punishments with no reasons
Fixes https://www.smogon.com/forums/threads/bug-reports-v4-read-original-post-before-posting.3663703/page-32#post-8613159.
2020-10-03 15:25:33 -07:00
Mia
4d8580df97
Rooms: Refactor Modlog import (#7463) 2020-10-03 09:56:40 -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
Mia
aba5dd1119
/showteam: Support nicknames (#7464) 2020-10-03 08:25:14 -07:00
Annika
aeaa05bd5a Modlog: Minor fixes
yes another modlog commit from me!
this time, it's making sure that note searches based on user IDs actually get toID() called on them, and fixing some HTML escaping issues
2020-10-02 20:59:42 -07:00
Mia
ab16b48d48
Chatlog: Update permission checks (#7459) 2020-10-02 19:26:29 -07:00
Annika
d807e00e40
Helptickets: Display shared battles in staffintro (#7460) 2020-10-02 19:24:29 -07:00
Annika
3db02d9b7d Trivia: Restrict random mode selection
Random mode should not select First mode if it was played in the past 10 Trivia games
2020-10-02 16:04:41 -07:00
Annika
0dd6e1c0d4
Modlog viewer: Fix formatting of search explanation 2020-10-02 10:00:50 -07:00
Annika
53cebdc09d
Daily spotlights: Add alias for /viewspotlights (#7453) 2020-10-01 15:46:24 -07:00
Guangcong Luo
65db20711c Fix bug in /updateserver 2020-10-01 11:58:14 -07:00
Jeremy Tan Jie Rui
6e956aee51
Add documentation on maxgen parameter to /ds (#7451) 2020-10-01 09:40:17 -07:00
Mia
3e92bcd2cc
Quotes: Remove the broadcast cooldown for /randquote (#7450) 2020-10-01 09:39:54 -07:00
Annika
0cf43e7461
Modlog: Default to searching all fields (#7449) 2020-10-01 09:36:36 -07:00
Guangcong Luo
523c1a335d
Introduce Chat.oldPlugins (#7434)
This provides a new way to persist chat plugin data across hotpatches:
`Chat.oldPlugins`.

In a plugin, you can now do:

```
export const cache = Chat.oldPlugins.pluginname?.cache || {};
```

to create a cache that will persist across hotpatches.
2020-09-30 19:45:54 -07:00
Annika
0877f0ae1e
Modlog: Fix entries with an IP address and no user (#7446) 2020-09-30 17:55:41 -07:00
Annika
1c4b57b56c
Use translated German website pages (#7440) 2020-09-30 12:32:56 -07:00
Annika
fa571d3b4b
Modlog viewer: Update regex for /ml roomid, search (#7444) 2020-09-30 12:32:15 -07:00
Annika
212b35b2fa
Modlog: Support exact user searches (#7443) 2020-09-30 11:22:49 -07:00
Annika
e24ec79b92
Fix room promotion messages 2020-09-30 11:13:25 -07:00
Annika
5bad212da8
Apply chatfilters to !code (#7442) 2020-09-30 10:32:27 -07:00
Annika
98b9bd69b1 Fix more modlog attributions 2020-09-29 17:39:28 -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
Guangcong Luo
2bcea34447 Support ./pokemon-showdown simulate-battle -S
simulate-battle now has a new option: --spectate.

As a recap:

-D --debug: simulate in debug mode

-R --replay: output only the omniscient (debug) replay, rather than the
  full stream

-S --spectate: output only the spectator replay, rather than the full
  stream
2020-09-29 15:28:07 -07:00
Mia
b7630b70cf
Chatlog: Handle ErrorMessage properly (#7438) 2020-09-29 14:30:50 -07:00
Kris Johnson
8d080ff320
UNO: Fix timestamp and switch to Chat.ErrorMessage (#7437) 2020-09-29 08:53:21 -07:00
Annika
cdd6a4ce31 Moderation: Save replays for offline warns 2020-09-28 22:10:17 -07:00
Mia
a9645d29f1 Modlog: fix defaulting to roomid in /modlog 2020-09-28 18:04:57 -05:00
Mia
1eb2c77208
Modlog viewer: Improve UI (#7436) 2020-09-28 16:01:05 -07:00
Annika
b3a5f9e59f
Moderation: Refactor room promotions to a function (#7426) 2020-09-28 15:49:26 -07:00
Annika
6e2a336975 Don't duplicate attributions in modlog entries 2020-09-28 15:26:30 -07:00
Annika
c2861c2411 Chat: Fix CommandContext#globalModlog 2020-09-28 15:22:25 -07:00
Annika
f2ef093493
Modlog: Parse entries in the child process (#7435) 2020-09-28 12:04:06 -07:00
Charlie Kobayashi
493bd033c7
Scavengers: Add October twist (#7433) 2020-09-28 11:21:36 -07:00
Annika
f1b4e3d43a
Modlog: Refactor to use ModlogEntry objects (#7403) 2020-09-28 11:06:30 -07:00
Annika
1a9293e2cf
Make /yearlock write to the global modlog (#7431) 2020-09-28 10:23:40 -07:00
Guangcong Luo
a7c902328f
Refactor staffAutojoin (#7429)
`room.settings.autojoin` and `room.settings.staffAutojoin` are now
merged.

Staff autojoin rooms are now simply regular autojoin rooms with a
modjoin setting. You simply autojoin all autojoin modjoin rooms that
you're allowed to join.

Fixes #7413
2020-09-27 17:47:15 -07:00
Annika
3b3bbd583d Add 'roomprizewinner' to the room permissions list
This will allow `/permissions` to set the required rank to promote to Prize Winner, just as with other room groups.
2020-09-27 16:35:09 -07:00
The Immortal
b67701d8a4
Add suspect tests plugin (#7427) 2020-09-27 15:41:04 -07:00
Annika
b865fe537c
Trivia: Fix Mastermind (#7419) 2020-09-27 13:03:06 -07:00
Guangcong Luo
9fe45238f5
Introduce chunk readers for ReadStream (#7215)
This adds new functions `stream.byChunk(bytes)`, `stream.byLine()` etc
which parse a `ReadStream` into an `ObjectReadStream<string>` which
can then be consumed with for-await.

Fixes #7195
2020-09-27 08:55:59 -07:00
PartMan
6cb31fe2a6
Fix Flooring in /statcalc (#7420) 2020-09-27 06:56:58 -07:00
Mia
f7288df665 Fix build 2020-09-26 23:27:51 -05:00
Mia
62bcce1d55 Plugins: Don't try-catch ENOENT errors when using FS.readIfExists() 2020-09-26 23:02:45 -05:00
Charlie Kobayashi
4be093ec56
Fix injection issue in /makegroupchat (#7424) 2020-09-26 20:30:57 -07:00
Charlie Kobayashi
eee5e5fa63
Quotes: escape some HTML (#7425) 2020-09-26 20:29:32 -07:00
Annika
1c5a8086b5
Check username length in /forceroompromote 2020-09-26 12:58:33 -07:00
Mia
78933408bf
Quotes: Move to a chat plugin (#7421) 2020-09-26 08:11:42 -07:00
Mia
3352e11b86
Add the alias /profile to /whois (#7422) 2020-09-26 02:28:11 -07:00
Mia
b9df40c5af
Auth: Fix whitelist/prizewinner giving trusted status (#7418) 2020-09-25 08:58:31 -07:00
Marcell
d2bb6a8089
Make Prize Winner bold (#7416)
I removed the "/" from the first tag, so it will be displayed as bold.
2020-09-25 00:28:08 +04:00
Annika
2e6ed8a50f
Helptickets: Fix double notification (#7415)
We should only be sending notifications through Staff room rather than the page.
2020-09-25 00:17:14 +04:00
Annika
1f239664c7
IPTools: Check proxy IPs before other host types (#7414) 2020-09-24 09:30:47 -07:00
Annika
eb2261b846
Helptickets: Close a user's ticket on global ban (#7411) 2020-09-22 21:00:38 -07:00
Kris Johnson
5a8ded0568
Room FAQs: Convert the rfaq list to a page (#7394) 2020-09-22 19:30:05 -07:00
Mia
7a89492947
Chatlog: Use ProcessManager for searches (#7393) 2020-09-22 18:23:01 -07:00
Mia
8bbec3db3a
Add prize winner to /groups (#7407) 2020-09-22 18:18:52 -07:00
Annika
db5d04c2c9
Make modnotes global in rooms with shared modlogs (#7401)
This mainly applies to modnotes in help tickets and battles, as well as global staff modnoting in groupchats (in case of misbehavior in a groupchat).
2020-09-20 20:15:42 -07:00
Annika
1e20f6a96f
Trivia: Add leaderboard management commands (#7402) 2020-09-20 16:33:03 -07:00
Annika
4a61ffd5ac
Trivia: Use Room#subGame for Mastermind (#7371) 2020-09-19 18:32:44 -07:00
urkerab
fbef450802
Fix missing variable renames after PR #6670 (#7400) 2020-09-19 17:59:40 -07:00
Mia
2db1922e87
Battlesearch: Improve phrasing and UI (#7396) 2020-09-19 16:22:15 -07:00
Mia
fdd264d075
Quotes: Properly check if a user can view the room (#7397) 2020-09-19 16:03:00 -07:00
Guangcong Luo
360668b00e Revert "Fix renaming battle rooms (#7326)"
(It had a bug that made private battles unplayable.)

This reverts commit 930c00410b.
2020-09-19 05:36:34 -04:00
Annika
930c00410b
Fix renaming battle rooms (#7326) 2020-09-19 02:05:27 -07:00
Mia
ae7a46dd37
Chat: Move forcerename tracking to Monitor and Punishments (#7381) 2020-09-19 02:04:49 -07:00
Guangcong Luo
46c470671a
Unify /guess (#7387) 2020-09-19 01:24:52 -07:00
Annika
480079e790
Punishmentfilter: Don't activate for permalocks (#7389) 2020-09-19 01:23:21 -07:00
Annika
62a2eda1a1
RoomGame: Support room.subGame (#7380) 2020-09-19 00:40:24 -07:00
Annika
59ba8aa876
Chat filters: Support custom redtext (#7392) 2020-09-18 20:38:53 -07:00
Annika
ab7daeecf8
Mention PHP in /opensource (#7391) 2020-09-18 20:37:57 -07:00
Mia
9a555a6ee9
Add weekban to /punishments (#7388) 2020-09-18 16:19:43 -07:00
Annika
6d8d0bd93a
Trivia: Use Chat.ErrorMessage more (#7384) 2020-09-18 16:19:26 -07:00
Mia
6f28e459f3
Battlesearch: Support searching for multiple users and searching months (#7382) 2020-09-18 07:44:33 -07:00
Mia
6255927779
Add a command to highlight users in bot html pages (#7304) 2020-09-18 07:38:44 -07:00
Quinton Lee
bf400c4ef1
Restore global bot permissions for /filters list (#7385) 2020-09-18 05:08:51 -07:00
Annika
66ba5a25b2
Remove Idle status on logging in (#7383) 2020-09-18 03:58:23 -07:00
Kris Johnson
d7adf0e17c
Quotes: Make deleting quotes log properly 2020-09-17 20:36:51 -06:00
Annika
c143c879e1 Fix bugs when promoting a user with authed alts 2020-09-17 17:20:47 -07:00
Annika
33e59f16af Punishments: Fix modlog entries for autolocks 2020-09-17 10:40:44 -07:00
Mia
e80f71f648
Chat: Fix Context.checkChat (#7327) 2020-09-16 18:41:30 -07:00
Annika
c7934184cf
Fix hardcode in /modjoin sync (#7377) 2020-09-16 18:40:14 -07:00
Annika
357131ec68
Escape regexes in the filter display page
Lookbehind regexes cause problems....
2020-09-16 15:36:08 -07:00
Kris Johnson
dd494bb973
Tournaments: Modernize permission checking (#7375) 2020-09-16 03:40:15 -07:00
Mia
abad806760
Improve the /faq command (#7369) 2020-09-16 01:25:34 -07:00
Annika
ba4bb2f120
Helptickets: Display user language and remove prefix (#7373) 2020-09-16 01:21:07 -07:00
Annika
12c7a08424 Improve group symbol validation in /permissions
This fixes the issues where you can set permissions to a rank that doesn't exist
2020-09-16 00:20:28 -07:00
Annika
38d62612f4
Move checkChat() in /invite (#7374) 2020-09-15 23:31:03 -07:00
Annika
88558b6ac6
Chat: Always make help commands broadcastable 2020-09-15 16:37:33 -07:00
Kris Johnson
df9a4488fa
Quotes: Quality-of-life changes and bug fixes (#7361) 2020-09-15 03:32:08 -07:00
Kris Johnson
bbccd2e2f4
Tournaments: Fix permissions (#7370) 2020-09-15 03:27:26 -07:00
Annika
466dfcc5ce Trivia: Fix start officials 2020-09-14 18:06:57 -07:00
Mia
041d8fb0ed
Helptickets: Refactor bans to use the punishment interface (#7365) 2020-09-14 17:02:57 -07:00
Annika
f248b838b6
Allow groupchat hosts to rename their groupchats (#7359) 2020-09-14 16:34:41 -07:00
Leonard Craft III
302d6ff6fb
Add hidestats arg to showteam and improve output (#7357) 2020-09-14 16:33:34 -07:00
Annika
52c5df12d5
Fix crash in /invite (#7364) 2020-09-14 16:28:22 -07:00
Mia
96b4c4c841
Searchlogs: Don't require a room (#7367) 2020-09-14 16:27:26 -07:00
Annika
422649dca7
Trivia: Add a new game called Mastermind (#7368) 2020-09-14 16:03:50 -07:00
Mia
6aa55bd6b1
Tournaments: Refactor commands (#7229) 2020-09-14 02:09:30 -07:00
Guangcong Luo
db449796c9 Document collapseLineBreaksHTML 2020-09-14 01:43:37 -07:00
Annika
87ea9bb431
Add a filter to run code after global punishments (#7362) 2020-09-12 22:33:56 -07:00
Mia
8be5ccb235
Quotes: Fix bug in attribution (#7360) 2020-09-12 19:45:56 -07:00
whales
3cae09feab Mafia: Fix forcehost 2020-09-13 12:14:49 +09:30
Annika
e47abc6d57
Modlog: Fix crash in renaming temporary rooms 2020-09-12 17:11:50 -07:00
Kris Johnson
b7b609a205 Display BST properly in /crossevo and /showevo 2020-09-11 18:53:08 -06:00
Annika
71bdfe6c0b
Fix bug in room promotions without a user object
We don't use `splitTarget` anymore here, so this prevented the command from working when no user object was found
2020-09-11 14:49:11 -07:00
Mia
e1b91066c3
Support adding quotes in rooms (#7352) 2020-09-11 13:44:14 -07:00
Mia
aa9c36ca62
Thing of the Day: Fix bug in removing users (#7353) 2020-09-11 12:54:56 -07:00
Annika
8542aa91a1
Re-add /cs as an alias for /clearstatus
I accidentally removed this in https://github.com/smogon/pokemon-showdown/commit/0a26579af.
2020-09-11 10:51:09 -07:00
whales
89d1d1a9cf Mafia: Fix broadcasting queue 2020-09-12 00:52:08 +09:30
Annika
52aa7ece1e Fix Room Prize Winner rank 2020-09-10 19:22:51 -07:00
Annika
2c6bd4aa5d
Chat plugins: Export plugin state (#7351) 2020-09-10 19:17:00 -07:00
Mia
23f0c6be74
Helpticket list: Respect ignoring tickets (#7345) 2020-09-10 17:26:31 -07:00
Annika
28b8532940
Support promoting multiple users at once in rooms (#7344) 2020-09-10 15:13:41 -07:00
TheMezStrikes
497d746f26
Don't ban autoclose tags without spaces from html (#7341) 2020-09-10 13:36:13 -07:00
Mia
4e4aa2764a
Update AnnotateCommands regexes to account for refactors (#7349) 2020-09-10 13:35:54 -07:00
Mia
852858a7a0
Help: Fix issue with approvals (#7347) 2020-09-10 13:35:16 -07:00
Annika
34ec6ebb56
Help chatfilter: Add closing </code> tag in help (#7346) 2020-09-09 17:58:21 -07:00
Annika
1b9e334cd9
Fix visual bug with /hiderank in PMs (#7334) 2020-09-08 00:17:49 -07:00
whalemer
1511fcb821
Mafia: Update permissions (#7324) 2020-09-08 12:25:25 +09:30
Annika
471fe7365a
Add "η" to the evasion filter (#7330)
See https://replay.pokemonshowdown.com/gen8nationaldex-1182878993 for an example of how this can be used to evade.
2020-09-07 12:49:11 -07:00
Guangcong Luo
9b705936b0 Very ugly workaround for /me checkChat bug
There are too many conflicts to revert, so this will have to do for now.
2020-09-06 22:35:28 -04:00
Guangcong Luo
e543cb843f Revert "Improve privacy for hidden battles (#7281)"
It wasn't implemented in `user.games` and a few other places, leading to bugs.

This reverts commit 222d2e1ac9.
2020-09-06 22:15:55 -04:00
Annika
222d2e1ac9
Improve privacy for hidden battles (#7281)
Co-authored-by: Kirk Scheibelhut <kjs@google.com>
2020-09-06 18:46:35 -07:00
Annika
64165b556b
PunishmentMonitor: Include punishments on alts (#7322) 2020-09-06 17:53:49 -07:00
Annika
8789d619f6
Chatfilters: Spoiler autolocking banwords (#7295) 2020-09-06 17:53:33 -07:00
Annika
0a26579afa
Make core commands translatable (#7279) 2020-09-06 17:49:53 -07:00
Annika
52cfaa999b
Trivia: Add short alias for casesensitivesearch (#7325) 2020-09-06 15:05:32 -07:00
whalemer
f5bdef7b4b
Auth: Fix changing a group's permission for commands (#7323) 2020-09-06 12:29:22 -07:00
Mia
44fc0123ad
Chat: Refactor CommandContext and PageContext to use ErrorMessage more (#7234) 2020-09-06 00:15:16 -07:00
Annika
df04c24a91
Weekban: Fix error message and add /wb alias (#7319) 2020-09-05 20:59:27 -07:00
Annika
f4081991d3
Modlog viewer: Fix more button for shared modlogs (#7320) 2020-09-05 20:44:40 -07:00
Mia
8f8e197d9c
Helptickets: Stop modlogging to Help room (#7070) 2020-09-05 18:25:20 -07:00
Mia
4f3c5c8581
Permissions: Support setting permissions for all sub-commands at once (#7164) 2020-09-05 17:40:11 -07:00
Annika
1a987c00bf
Trivia: Support specifying case sensitivity in searches (#7316)
Co-authored-by: Konrad Borowski <konrad@borowski.pw>
2020-09-05 17:32:40 -07:00
Annika
13d1a4fa6d
Allow users to see their own hidden games in /whois (#7315) 2020-09-05 13:57:54 -07:00
Annika
83e8262d12
Users: Fix bug with IP handling (#7305) 2020-09-05 08:18:42 -07:00
Annika
08818294a8
Log viewer: Escape usernames (#7309) 2020-09-05 08:16:29 -07:00
Mia
7222b7280b
Support week roombans (#7311) 2020-09-05 08:13:21 -07:00
Guangcong Luo
acb851f857 Add a new command: /yearlockip
/yearlockip works like /lockip, but lasts for a year. It's intended to
be used to punish users who troll over a long term, but from a static
IP.

I've also separated strings out in a way that should make them slightly
easier to translate in the future.
2020-09-04 21:16:25 -07:00
Mia
6b671e9526
Searchlogs: Improve handling of date not found errors (#7308) 2020-09-03 17:52:20 -07:00
Mia
73e5284db3
Searchlogs: Fix crash in date parsing (#7307) 2020-09-03 17:24:47 -07:00
Lusamine
19355641f0
Remove Anubis from Credits (#7306) 2020-09-03 17:06:54 -07:00
Kirk Scheibelhut
afdbcd355e Update credits 2020-09-03 13:29:41 -07:00
HoeenHero
6dab83d6c4 Remove unneeded canTalk check
mia asked me to push this since keeping this check will result
in a ghost message if a match is found.
2020-09-02 23:29:57 -04:00
Guangcong Luo
1217457b06 Fix /updateserver
This adds a bunch of minor fixes to /updateserver. The big one is that
we no longer stash untracked files, which should fix the problem where
it sometimes takes forever to update.

However, it seems like conflicting untracked files sometimes corrupts
the Git system?

    zarel@cytosine ~/W/psserver (master)> git rebase FETCH_HEAD
    Created autostash: abc06bdca
    First, rewinding head to replay your work on top of it...
    error: The following untracked working tree files would be overwritten by checkout:
        server/chat-plugins/help.ts
    Please move or remove them before you switch branches.
    Aborting
    fatal: Could not detach HEAD

    zarel@cytosine ~/W/psserver (master|AM/REBASE)> git rebase --abort
    error: could not read '.git/rebase-apply/head-name': No such file or directory

I couldn't reliably reproduce this, unfortunately, but I've switched to
`git rebase --no-autostash FETCH_HEAD` to be safe. File conflicts
are really rare in general, so I don't think that needs to be a
blocker.
2020-09-02 20:14:07 -07:00
Annika
c5833d637a
Thing of the Day: Fix crash (#7301) 2020-09-02 21:35:31 -04:00
Mia
3a8bd28a6f
Help: Fix vulnerabilities (#7300) 2020-09-02 21:31:37 -04:00
Annika
8bc416730e
Trivia: Reformat help and don't use module.exports (#7292) 2020-09-02 12:07:24 -07:00
Annika
94a6f14e48
Remove trusted user check in /hidetext (#7282) 2020-09-02 09:51:05 -07:00
TheMezStrikes
94b3e6f96f
Update CAP samples link to gen 8 (#7288) 2020-09-01 02:26:30 +04:00
Mia
2e5bd14bbe
Help: Disable if a room is not configured (#7287) 2020-08-31 16:21:28 -04:00
Mia
42ba4b87d2
Youtube: Fix crash (#7280) 2020-08-31 06:45:35 -07:00
Annika
1cbab7162c
Filter Pokémon nicknames after team validation (#7283)
This will prevent the staff room from getting spammed when people do things like nickname their Pokémon 10,000 n-slurs in a row.
2020-08-31 06:21:58 -07:00
Mia
9a0f1ed11e
Fix regex replacing (#7265) 2020-08-31 06:19:04 -07:00
Mia
1d450461e2
Chat: Show the full command in nonexistent errors (#7286) 2020-08-31 04:13:47 -07:00
Annika
c9fa3fc389
Refactor User#prevNames and User#ips to arrays (#7267) 2020-08-29 10:27:03 -07:00
Mia
a8e8604967
Help: Fix crash with approvals (#7275) 2020-08-29 00:02:31 -07:00
Annika
dec6599f77
Fix /unlockip (#7276) 2020-08-28 19:43:58 -07:00
Mia
a68b1fc31d
Help: Fix HTML error in regex page (#7268) 2020-08-27 00:00:24 -07:00
Annika
bece58ee93
Fixes for /unrangelock (#7266) 2020-08-26 22:48:00 -07:00
Annika
9d57cc096b
Use the room language to translate mod actions (#7261) 2020-08-26 09:05:34 -07:00
Annika
00a12e0355
Fix /unlockip's interaction with namelocks (#7252) 2020-08-26 08:19:24 -07:00
Annika
3f000fced2
Do it this way (#7251) 2020-08-26 08:15:55 -07:00
Charlie Kobayashi
0828d91deb
Scavengers: fix display bugs (#7232) 2020-08-26 07:51:12 -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
46d389c3b4
Chat: Make translations not crash on hotpatch (#7263) 2020-08-26 07:48:30 -07:00
Annika
d65335f415
Improve handling of locks when users are merged (#7264) 2020-08-26 04:34:44 -07:00
Annika
30214cfedd
Chat: Make pages translatable (#7258) 2020-08-26 03:34:56 -07:00
Mia
f2a8e4c28b
Help: Allow regular users to suggest regexes (#7260) 2020-08-26 02:20:57 -07:00
ayiadvance
dc0a52db13
Add reveal option and fix forceresetroles for mafia (#6695) 2020-08-26 18:13:56 +09:30
Annika
6931e59df7
Improve Pokémon nickname filter and autolocks (#7253) 2020-08-23 20:41:51 -07:00
Annika
5df47bb388
Allow staff to partially bypass the status filter (#7213) 2020-08-23 04:28:10 -07:00
Kirk Scheibelhut
b20155878b
/hiderank should default to hiding as reg (#7249) 2020-08-23 04:25:40 -07:00
Guangcong Luo
ba4998350a Fix more bugs in /hiderank 2020-08-22 16:03:10 -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
ff1cb70a95
Handle evasion filters in Pokémon nicknames (#7246) 2020-08-22 01:26:07 -07:00
Annika
2b8268aabe
Make /updateserver private exit if no updates (#7242) 2020-08-21 15:38:50 -07:00
Annika
dc005c5255
Daily spotlights: Prevent crash (#7245)
The crashes in the daily spotlight plugin were caused by `/queuedailyat` leaving an empty daily that can't be parsed before failing. This should solve it, but some rooms' spotlight data may still cause crashes. (These rooms should use `/removedaily`.)
2020-08-21 15:16:03 -07:00
Guangcong Luo
8d79bf9725 Rename Dex.deepClone to Utils.deepClone
`this.dex.deepClone` still exists as an alias to `Utils.deepClone` for
use in `data/`. I'll need to spend more time figuring out the correct
solution there.
2020-08-21 04:24:34 -07:00
Mia
2561764bdc
Make /requestshow approvals staffintro look nicer (#7233) 2020-08-20 21:35:05 -07:00
Annika
a3c579c3c4
Fix crash in /updateserver private (#7236) 2020-08-20 21:29:57 -07:00
Annika
27d4212771
Display whitelist correctly in demotion messages (#7238) 2020-08-20 21:18:09 -07:00
fart
b9ced489cd
Show staff intro + pending requests on autojoin (#7228)
At the moment, the staff intro and pending requests only appear on manual joins, not on autojoin. This is because `user.can('mute', null, this)` results false when it is run since the user is not yet logged in. This change creates a new method for generating the staff intro that is run after the user is fully logged in. It also modifies the original `getIntroMessage` so that the staff intro and pending requests still appear on manual joins.

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-08-20 21:17:02 -07:00
Spandan Punwatkar
7f0450673d
Add support for inverse in /weak (#7198) 2020-08-19 13:04:28 -07:00
Annika
8de5027703
Fix HTML tag in /faq (#7230) 2020-08-19 00:46:03 -07:00
fart
d03c6dc435
Fix HTML error with pending media requests (#7227)
This was an extraneous </div> tag which resulted in only the first pending media request to show inside of the <details> tag.
2020-08-19 00:33:45 -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
PartMan
86e8a9159e
Slight HTML Button Improvements (#7217)
Changes this makes:
a) Lets people use `/pm` or `/w` instead of `/msg` in buttons.
b) Permits the author of the HTML to direct messages towards themselves via buttons (useful for when Bots creates subroomgroupchats and become *, or if they suddenly want hugs from random people).

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
2020-08-18 13:56:03 -07:00
Annika
05065dbdb8
IPTools: Support wildcards in string ranges (#7223) 2020-08-18 13:37:58 -07:00
Mia
d8ecdb5f83
Help: Only write state when relevant to the room (#7207) 2020-08-18 13:06:52 -07:00
Annika
58c5a43e8d
Only allow the player who set modjoin to change it (#7216) 2020-08-18 12:54:22 -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
Mia
0f12d8232c
Show error when using ! on a non-broadcastable command (#7209) 2020-08-16 11:27:06 -07:00
Annika
3197a53b53
Make the !faq command translatable (#7149) 2020-08-16 11:26:29 -07:00
Annika
49e9d8adda
Display G-Max moves properly in /details (#7117) 2020-08-15 17:57:27 -07:00
Annika
c00e66b76d
Datasearch: Support excluding monotype Pokemon (#7214) 2020-08-15 15:44:46 -07:00
Guangcong Luo
18948c8c2c Refactor ObjectReadStreams to use for-await
Regular ReadStreams still can't; I now believe they shouldn't have a
"default" read method, and you should explicitly choose whether you
want to read "by chunks as they become available", "by chunks of a
specific line" or "by a delimiter".

So you would specifically use `stream.byLine()` or
`stream.byChunk([size])`, which would return an
`ObjectReadStream<string>`.

Inspired by #7195
2020-08-15 15:11:53 -07:00
Annika
4cbf905ec8
Modlog: Fix exact searches and improve hotpatching (#7211) 2020-08-15 14:10:46 -07:00
Annika
0ce6613219
Fix modlog crash (#7200) 2020-08-13 17:07:57 -07:00
Kirk Scheibelhut
0bf366c181
Fix getBattles skip behavior wrt private rooms (#7204) 2020-08-12 16:41:52 -07:00
Kris Johnson
7fc3cd516e
Add /nomarkshared (#7201) 2020-08-12 16:21:00 -07:00
Mia
fa7a0025e5
/showteam: Fix bugs (#7206) 2020-08-12 16:12:45 -07:00
Annika
fc99159589
Punishments: Make autolocks last a week on users with bad records (#7074) 2020-08-12 12:06:45 -07:00
Kris Johnson
5e255012bc
Add a 'bst' property to Species (#7138) 2020-08-12 12:06:09 -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
7df8ad12a9
Hosts: Fix bug with /ipranges widen (#7202) 2020-08-12 10:03:08 -07:00
Kris Johnson
8ba03fa10b
Fix crash with /dt (#7199) 2020-08-12 08:34:04 -07:00
DieterReinert
47e780ef2c
Poll: missing < in opening tag (#7194) 2020-08-10 16:30:59 +04:00
Annika
2b809f99e4
Support updating private code in /updateserver (#7183) 2020-08-09 20:24:32 -07:00
Annika
814567c6e6
Roomsettings: Fix bug with single-command permissions (#7181)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-08-09 12:08:18 -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
1c5f989837
Datasearch: Allow all-only searches if sorted (#7182) 2020-08-08 01:11:46 -07:00
Mia
7faf35f2a4
Support opting in/out of blocking pms/chals with /busy (#7179) 2020-08-08 00:28:30 -07:00
Annika
ce8a1dd975
IPTools: Remove '-nohost' suffix and make minor improvements (#7108) 2020-08-07 14:47:18 -07:00
Annika
e47461da6d
Trivia: Fix translation formatting (#7175) 2020-08-07 11:39:18 -07:00
Annika
4318d7c9bc
Fix modlog formatting (#7173) 2020-08-07 11:17:34 -07:00
Annika
1fa74d9868
Fix Auth#isAuthLevel (#7174)
Also prevents setting mod(chat|join) below regular user.
2020-08-07 11:05:18 -07:00
Mia
deeed6c789
Remove sim/ and data/'s globals (#7091) 2020-08-07 06:44:15 -07:00
Annika
e00f122b5c
Fix BasicRoom#tr (#7166) 2020-08-06 19:31:38 -07:00
Guangcong Luo
ec93b354bc Fix PM support
(Broken by parseCommand refactor)
2020-08-06 22:21:48 -04:00
Annika
d25fa3c16d
Fix bug in /permissions (#7168) 2020-08-06 19:13:11 -07:00
Annika
f563252418
Modlog: Fix bugs and support hotpatching (#7163) 2020-08-06 22:05:13 -04:00
Mia
83e094bd37
Redesign /permissions help (#7146) 2020-08-06 10:06:02 -07:00
Mia
00526bb604
Help messagefilter: fix crash (#7158) 2020-08-06 10:05:03 -07:00
Lusamine
0f56db1853
Remove extra parentheses from 2 other privateModAction (#7162) 2020-08-06 10:04:36 -07:00
Peach
bfb993e3b2
Fix crash message formatting (#7160) 2020-08-06 09:55:45 -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
Kris Johnson
f96ec4fb05
Add strict types to tiers (#7135) 2020-08-06 00:41:42 -07:00
Annika
f34ffa9e74
Refactor Modlog into one file (#7127) 2020-08-06 00:39:37 -07:00
Mia
fd0f83ff8d
Add a command to show the user's team in battles (#7068) 2020-08-06 00:36:43 -07:00
Mia
fbe5d90dd0
Youtube: Add tests (#7081) 2020-08-06 00:34:18 -07:00
Guangcong Luo
54027d62bd
Support custom ladders (#6541)
This allows formats to specify a different ladder than their own, for
their rated battles to go on.
2020-08-06 00:28:53 -07:00
Guangcong Luo
9b3a986ef4 Refactor PageContext
Now shows a better error for not-found pages.
2020-08-06 00:25:21 -07:00
Annika
8287cbc7fb
Remove User#authAtLeast and add more sysop bypasses (#7046) 2020-08-06 00:12:30 -07:00
Annika
7f3e55deb9
Improve help message formatting for /searchlogs (#7136) 2020-08-05 23:47:08 -07:00
Mia
647d5af76f
Add a filter for auto-answering questions in the Help room (#7100) 2020-08-05 23:44:46 -07:00
Annika
42451ff430
Trivia: Make strings translatable (#7156) 2020-08-05 23:23:35 -07:00
Annika
3572df1a0c
Fix demoting locked users (#7151) 2020-08-05 20:21:57 -07:00
Annika
ae11a699a6
Add a BasicRoom#tr method (#7143) 2020-08-05 19:14:41 -07:00
Annika
04961fcbb8
Add short alias for /sharedbattles (#7150)
This was requested in Staff room a few days back but I forgot about it until now.
2020-08-05 04:32:55 -07:00
Kris Johnson
8c22d4ce97
Add /flipped command (#7139) 2020-08-05 05:40:31 +04:00
Mia
47d00bf912
Support per-command permissions for sub-commands (#7142) 2020-08-04 03:01:17 -07:00
Guangcong Luo
80c669641a Refactor context.splitCommand
It no longer has side effects, which should make it easier to use for
other use cases.
2020-08-04 02:54:21 -07:00
Mia
fbfd31e1cf
Support configuring when crashes are private (#7122) 2020-08-04 02:18:57 -07:00
Annika
92552da849
Helptickets: Always respect ignoreTickets (#7144) 2020-08-04 01:32:39 -07:00
Mia
50127f6a7a
Make !commands hidetextable (#7137) 2020-08-03 19:34:35 -07:00
Annika
2171032134
Room Settings: Don't display ' ' as a modchat option (#7129) 2020-08-02 17:02:51 -07:00
Mia
b9c9addfdb
Searchlog: Fix crash (#7121) 2020-08-02 16:35:07 -07:00
Volco
26e2a1c4d4
Fix renaming groupchats and groupchat creation (#7123) 2020-08-02 16:21:49 -07:00
Annika
ee67a41184
Fix crash in Announcements (#7126) 2020-08-02 16:10:50 -07:00
Leonard Craft III
d93501949e
Fix /lottery participants from escaping container (#7116) 2020-08-01 22:54:15 -07:00
Mia
71099df544
Fix /renamegroupchat's permission checking (#7101) 2020-08-01 18:15:34 -07:00
Annika
6b1a53ae95
Trivia: Add Infinite length (#7114) 2020-08-01 17:06:50 -07:00
Annika
1b52e51ae0
Polls: Make strings translatable (#7110) 2020-08-01 16:51:41 -07:00
Peach
27513b7ff1
Fix chat commands typing (#7106) 2020-08-01 16:05:27 -07:00
Mia
eef5686ae0
Room-Battle: Improve API (#7083) 2020-08-01 16:04:39 -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
Spandan Punwatkar
fdea3aca28
Add /battlerules (#7029) 2020-07-31 18:06:19 -07:00
Mia
2a9015457d
Chatlog: Improve search (#6955) 2020-07-31 18:00:54 -07:00
Charlie Kobayashi
69cf80ed2a
Make broadcastBuffer an array (#7103)
This removes any extra unnecessary newlines at the end of each message sent to each client, and will always handle all messages assigned to the buffer properly.
2020-07-31 17:57:19 -07:00
Annika
f472b6c123
Announcements: Make strings translateable (#7102) 2020-07-31 17:00:37 -07:00
Guangcong Luo
7d95f68d26 Fix message corruption
Fixes #7099
2020-07-31 16:39:35 -07:00
Quinton Lee
a8b3da922a
Allow bots to use !checkchallenges again (#7098) 2020-07-31 14:44:57 -07:00
Annika
f25fc4c344
Trivia: Display question numbers (#7097) 2020-07-31 14:39:23 -07:00
Guangcong Luo
c39be07d23 Fix crash messages not appearing in Upper Staff 2020-07-30 17:17:04 -07:00
Guangcong Luo
b4de66c8b9 Remove mistakenly-added /hiderank command
It was accidentally included in #7078 but is actually part of #7058
and crashes without the other changes.
2020-07-30 17:35:32 -04:00
Annika
05a9f9a1e5
Minor code quality improvements based on LGTM (#7092) 2020-07-30 14:24:37 -07:00
Mia
29afa9f454
Fix RO rank displaying (#7090) 2020-07-30 13:17:46 -07:00
Annika
a1ce0cdce1
Moderation: Add /clearaltstext (#7086) 2020-07-30 00:35:30 -07:00
Peach
9cdee242f1
Fix Config error reporting (#7080) 2020-07-30 00:35:13 -07:00
Annika
24c4f2ca55
Moderation: Support private reasons in /warn (#7050) 2020-07-30 00:00:47 -07:00
Annika
d8e7fb4692
Add short alias for /hidebattlesfromtrainercard (#7085)
This was requested and makes sense to me, since it's quite a long command to type out each time.
2020-07-29 23:59:31 -07:00
Annika
cd85cd7a9d
Hosts & IPTools: Refactor to remove hardcoded ranges (#7078) 2020-07-29 23:04:50 -07:00
Kris Johnson
70edfaa64c
Add support for more OMs (#7084) 2020-07-30 05:22:21 +04: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
Annika
74a22d0402
Correctly display reveal button for /cleartext (#7082) 2020-07-29 14:21:42 -07:00
Peach
b4a6cd325b
Don't hardcrash when loading config (#7079) 2020-07-29 01:23:58 -07:00
Guangcong Luo
fe2eb27860
Refactor ip and modchat permissions (#7076)
- `ip` and `ipself` are now separate permissions. This means that `ip`
  is now a generalized permission for viewing IPs (no more need to use
  `globalban`, since `ipself` now controls the ability to see your own
  IP address)

- `alts` and `altsself` are now also separate (all users used to be
  able to `altsself`).

- `modchat`, `modchatall`, and `manageroom` are now just one `modchat`
  permission whose jurisdiction controls how high you can set modchat.
2020-07-29 00:38:52 -07:00
Guangcong Luo
add3a5d9f0 Fix bug when hidetexting own text 2020-07-29 00:37:18 -07:00
Mia
94fff9d496
Support customizing permissions per-room (#6883) 2020-07-29 00:22:03 -07:00
Mia
7216c493bb
Support renaming groupchats (#6965) 2020-07-29 00:21:24 -07:00
Peach
d87eeb4e2c
Don't modnote twice on joining a helpticket (#7049) 2020-07-29 00:17:24 -07:00
Annika
2da0317a71
Implement a /cleartext command (#7065) 2020-07-29 00:16:30 -07:00
Annika
fc764aa8e2
Support requiring high-rated users to register (#7073) 2020-07-29 00:16:02 -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
Guangcong Luo
98b5956d93 Linkify TextMonitor roomids 2020-07-28 20:08:27 -04:00
Mia
b0103c029d
/hidetext: Don't highlight the user (#7071) 2020-07-27 16:19:48 -07:00
Annika
c16750741a
Fix hotpatching IPTools and multiline patterns for Hosts (#7069) 2020-07-27 01:51:28 -07:00
Annika
3a3af89054
Display join/leave messages for locked players (#7066) 2020-07-26 16:03:28 -07:00
Annika
1bb3ed1531
Trivia: Show creator in /trivia history (#7067) 2020-07-26 15:34:12 -07:00
Annika
e0c18e8e0b
Refactor IPTools and add a host management chat plugin (#7061) 2020-07-26 12:41:27 -07:00
Peach
f2bfe2538c
Make sendhtmlpage perms more strict, refactor perm checks (#7044) 2020-07-25 23:31:28 -07:00
Annika
c5ebc2683c
Add a help message for /chatlog (#7063) 2020-07-25 21:32:26 -07:00
Annika
74e13815af
Modlog: Mark room tournaments in modlog (#7062) 2020-07-25 21:32:01 -07:00
Guangcong Luo
b5591fdccf Fix crash in /sendhtmlpage 2020-07-25 19:09:41 -04:00
Kirk Scheibelhut
25eca28c30 Extract singleIPOpenProxies into a Set 2020-07-24 21:03:53 -07:00
Guangcong Luo
c08a1a3199 Fix drivers not having mod powers in battles
Battles are now considered personal rooms, and so
`globalGroupInPersonalRoom` now applies to them properly.
2020-07-24 18:51:38 -07:00
HoeenHero
86043a504a
Add a command to enable hotpatching (#7056) 2020-07-24 17:42:06 -07:00
Annika
7248e6f87c
Helptickets: Fix grammar and add text about appealing locks (#7055) 2020-07-24 15:59:58 -07:00
Guangcong Luo
2f805c93a2
Remove "Battle" prefix from data exports (#7039)
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.

I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.

`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.
2020-07-24 12:42:26 -07:00
Mia
5ca45205db
Add a throttle for pending challenges (#7045) 2020-07-24 12:04:29 -07:00
Guangcong Luo
fdd90c4225 Properly fix roomwhitelist promotion/demotion 2020-07-24 14:21:13 -04:00
Guangcong Luo
64b12ae58e Fix permission inheritance
Previously, group config inheritance inherited everything, including
obviously wrong things like `name`. This commit fixes it so only
permissions are inherited.

In particular, this means that `globalGroupInPersonalRoom` is not
inherited, finally solving that particular bug although I'm still
not sure what made it originally work correctly and what changed.

Fixes #7043
2020-07-24 11:19:45 -07:00
Mia
63819e8d1c
Make /sendhtmlpage send to the last active connection (#7051) 2020-07-24 10:59:53 -07:00
Peach
be2deb2372
Link IPs in modlog (#7048) 2020-07-24 10:47:43 -07:00
Mia
126a740b2a
Fix chat-commands.js mention in /hotpatch's help (#7047) 2020-07-24 10:46:54 -07:00
Annika
7e7620d301
Send information about locked users in /cmd userdetails (#7041) 2020-07-24 10:12:39 -07:00
Annika
528045a03f
Support hiding battles from /cmd userdetails (#7040) 2020-07-23 21:30:30 -07:00
Guangcong Luo
a42cdf25ff Fix unwhitelisting users 2020-07-23 18:53:39 -04:00
Guangcong Luo
a1e748c121 Fix bug in /renameroom notifications
They would not have actually worked.
2020-07-23 14:20:58 -07:00
Kris Johnson
00b88b521d
Handle Gigantamaxing properly (#7001) 2020-07-23 13:27:42 -07:00
Annika
a11753de7a
Trivia: Support pausing and resuming games (#7038) 2020-07-23 12:59:14 -07:00
Guangcong Luo
b53faf1768 Fix /sendhtmlpage 2020-07-23 12:54:01 -07:00
Mia
964f4f8d06
Add a command for bots to send HTML pages (#6934) 2020-07-23 12:05:45 -07:00
Annika
7375ab4d90
Add cooldown for unregistered namechanges (#7032) 2020-07-23 00:00:29 -07:00
Kris Johnson
31d62a77d8
UNO: Fix typo (#7035) 2020-07-22 23:58:07 -07:00
Peach
e9611b7ce2
Remove unnecessary references to the global room (#7033) 2020-07-22 08:52:46 -07:00
Annika
960d7a927f
Fix bug in destroyPersonalRooms() (#7031)
This will actually destroy groupchats when a user is locked/globally banned, which to my understanding is the intended behavior.
`continue`ing when a room isn't persistent makes no sense, since groupchats are by definition not persistent.
2020-07-21 21:24:50 -07:00
Annika
570df13186
Support renaming battles (#7015) 2020-07-18 21:27:24 -07:00
Kris Johnson
77e4a8ad6f
Add type and category support for <psicon> (#6983) 2020-07-18 18:05:19 -07:00
Guangcong Luo
7d7db34c1d Support Chat.ErrorMessage in async commands
Fixes #7018
2020-07-18 16:33:22 -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
Guangcong Luo
2e9328eada Support annotating chat commands
The nullable room refactor made it so there was no longer an easy way
to tell if a command could be used in PMs. This adds it back, as a
property on the handler function itself.

Now that we have properties on handler functions, I also added
`broadcastable` for whether or not the command is broadcastable.

It uses `Function#toString`, which is generally frowned-upon, but it's
well-specified and only happens during startup, so it shouldn't affect
performance after startup.

This also allows us not to need to repeat ourselves or give up
flexibility to have metadata about commands, which I think is worth the
tradeoff of reflection generally.
2020-07-13 00:55:23 -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
Annika
b590d3c907
Add /noreply command (#6953)
This command should never be used by users.

This is for scripting, like buttons, like:

    <button name="send" value="/nofeedback /ionext">

so they don't spam your PMs.
2020-07-10 22:01:15 -07:00
Guangcong Luo
9fe5a0e063 Improve "Message can't be blank" error
It was previously a popup, but there's no need for that anymore. An
`errorReply` is much friendlier.
2020-07-10 05:06:02 -07:00
asgdf
2136c34e8e
Fix trustuser commands (#6988) 2020-07-09 23:30:47 -07:00
Mia
6690cfb037
Fix pollqueue page crash (#6986) 2020-07-09 22:19:43 -07:00
TheMezStrikes
a719c5f7e3
Trim !show image comment (#6987) 2020-07-09 16:08:51 -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
Guangcong Luo
faab60a618 Unify command logging code
Global punishments like /lock will notify Staff, and admin commands
like /updateserver will log to Staff, but this has been done ad-hoc
in the past.

To handle these cases, this commit introduces new chat-context
functions:

- `this.addGlobalModAction`,
- `this.privateGlobalModAction`
- `this.stafflog`

Other updates:

- the issue where Staff notifications didn't show up until someone talks
  has been fixed
- `privateModAction`s in Staff will now be visible in the scrollback
  log
- a bunch of commands that should notify Staff but didn't now do
- some typos in modlogs have been fixed
2020-07-07 18:51:29 -07:00
Guangcong Luo
d6de3ce6eb Fix typo in HTML scripted button validator 2020-07-07 21:27:04 -04:00
Annika
d2a61a2b9d
Daily spotlights: Add queue management commands (#6974) 2020-07-07 16:14:50 -07:00
Kirk Scheibelhut
2691b91062
Fix tour challenges (#6972) 2020-07-06 22:58:12 -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
9879d29cb8 /makechatroom no longer defaults to public 2020-07-06 17:12:01 -07:00
Kris Johnson
1a9d0611a6
Add quality-of-life fixes for Pet Mods (#6968) 2020-07-06 16:44:09 -07:00
Kris Johnson
4043f6e118
Fix bugs from recent restrictions update (#6967) 2020-07-06 15:54:14 -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
26150aab1b
Fix bug in /renameroom (#6952) 2020-07-03 11:48:25 -07:00
Annika
61e0a2e9e4
Chatlog: Fix grammar in error message (#6951) 2020-07-03 10:47:08 -07:00
Guangcong Luo
f16849eda3 Support addModAction/privateModAction in PMs 2020-07-03 01:18:17 -04: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
bdb0b0ff72 Refactor Net use in YouTube plugin 2020-07-02 17:14:24 -07:00
urkerab
ea30e9d48d
Don't sort player array in-place when scoring round robin tournaments (#6945) 2020-07-02 15:46:55 -07:00
Guangcong Luo
ba1730900f Support comments in /roomintro etc 2020-07-02 14:34:53 -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
Guangcong Luo
d20a4a9918 Remove unnecessary update in /requestshow 2020-07-01 16:37:36 -07:00
Kris Johnson
7010e0286f
Add OMotM and RoA Spotlight for July 2020 (#6936) 2020-07-01 12:59:10 +04:00
Mia
5d72fe2f74
Fix /viewapprovals (#6935) 2020-06-30 23:17:24 -07:00
Mia
75f9937aad
Info: Support viewing current media requests and hiding media (#6907) 2020-06-30 15:59:52 -07:00
Mia
857d5c648e
Youtube: Allow drivers to use /youtube update (#6933) 2020-06-30 12:11:09 -07:00
Austin Couturier
25c185c010
Fix /tour forcepublic to prevent /hiddenroom (#6932) 2020-06-30 12:09:30 -07:00
Austin Couturier
f08bc21f26
Add an option to force public replays for room tournaments (#6927) 2020-06-29 19:21:21 -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
TheMezStrikes
815d5c5a0a
/changeuhtml should send /uhtmlchange not /uhtml (#6912) 2020-06-24 05:32:25 -07:00
TheMezStrikes
a3c0d69b3c
Add /st as /servertime alias (#6911) 2020-06-24 05:31:07 -07:00
Annika
a578ec99c6
Trivia: Fix bug in /trivia history (#6906) 2020-06-22 22:35:02 -07:00
Lusamine
41ece9d418
Update datacenters & ip-tools (#6903) 2020-06-22 07:18:40 -07:00
Annika
bc2aec5c82
Roomevents: Support event categories (#6820) 2020-06-21 21:46:11 -07:00
asgdf
2a570291e1
Remove incorrect host classification (#6893)
A large portion of the IPs with that hostname are static broadband connections.
2020-06-21 19:22:22 -04: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
Mia
f9e79220dd
Polls: Support queuing (#6595) 2020-06-20 23:56:04 -07:00
Guangcong Luo
214aef6df6 Strongly type Rooms.global.settingsList 2020-06-20 21:45:02 -07:00
Nixola
00d0647dec
Prevent empty string from being added to banwords (#6887)
Filter out empty strings from the `banword add` and `banword delete`
arguments. Added a check in `banword add` for an empty array of
arguments.
2020-06-20 20:50:53 -07:00
urkerab
273eb928cf
Show status immunities in /weak output (#6889) 2020-06-20 20:49:50 -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
Peach
6c517b5562
Roomsettings: Fix language, modjoin, button formatting (#6879) 2020-06-19 17:36:37 -07:00
Guangcong Luo
20336fdfa0 Refactor /requestshow 2020-06-18 23:47:39 -07:00
Mia
501f773204
Improve /requestshow (#6868) 2020-06-18 23:43:41 -07:00
Mia
d2b255b934
/eval: Log in dev room and broadcast (#6871)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-06-18 23:28:15 -07:00
Mia
f8b95ce9a0
Rooms: Save creation time for all rooms (#6845) 2020-06-18 19:45:30 -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
Guangcong Luo
af7ca0e73c Clarify "Whitelist" in /roomauth as staff-only
I definitely heard some staff members be concerned that it shouldn't
be shown to regular users.
2020-06-18 00:01:57 -04:00
Mia
233f2aef9a
Fix setting modchat in battles (#6860) 2020-06-17 20:46:59 -07:00
Mia
1f6029e156
Youtube: Fix ID crash (#6858) 2020-06-17 20:42:02 -07:00
Guangcong Luo
cc22bae74f Fix crash in /editbattle 2020-06-17 18:12:34 -07:00
Guangcong Luo
839d86a2ab Refactor /makegroupchat a little
None of these are likely to fix the lag spike, but I couldn't find
anything that stuck out.
2020-06-17 21:11:52 -04: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
Charlie Kobayashi
e51c4ce290
Fix minor issues with /show commands (#6849) 2020-06-16 20:12:34 -07:00
Charlie Kobayashi
95b29974fd
Fix server crash from overlength posts (#6847)
(Server would crash and be unable to handle any further inputs from users)

Byproduct of #6745
2020-06-16 19:42:55 -07:00
Guangcong Luo
32b5b43244 Fix unexcaped URI in /requestshow 2020-06-16 18:44:23 -07: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
3228f91fbc
Fix uncommon evolution methods (#6830) 2020-06-13 12:46:21 -07:00
Kris Johnson
394a4c5c9d
Fix UNO DQ message to use correct name (#6831) 2020-06-13 11:21:58 -07:00
Guangcong Luo
8748427dce Fix TS error in PM
It's surprising to me that this happened after e0f97dcf6b, which
doesn't touch this line.
2020-06-13 10:54:22 -07:00
Guangcong Luo
e0f97dcf6b Replace Chat.uncache* with Utils.clearRequireCache
This replaces the old approach with a new "clear everything except a
whitelist" approach, which should overall involve much less code and
lead to fewer bugs of the "the path changed for a module and I forgot
to update the uncache paths" variety.

I considered a lot of other approaches, but they seem to have more
flaws without any advantages in exchange for them. (We moved away
from `uncacheTree` because it only tracks the first require: there's
no way to get a full list of dependents for a module, only its first
dependent.)
2020-06-12 22:02:32 -07:00
Guangcong Luo
d592c838c2 Separate Config.ofemain and Config.ofesockets 2020-06-12 22:02:32 -07:00
Guangcong Luo
97b856596e Fix lobby autojoin on side servers 2020-06-11 17:06:16 -07:00
Annika
428205fe93
Don't default to showing 'trusted' in /userauth (#6828) 2020-06-11 16:01:55 -07:00
Austin Couturier
c9b2b9dbf2
Change |pm|~ to |pm|& (#6827) 2020-06-10 21:53:36 -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
Guangcong Luo
1e5b5ab465 Update Streams API with pushEnd/writeEnd
Previously, ending a read stream was `stream.push(null)`, and ending a
write stream was `stream.end()`. This was often confusing, and so now,
these are consistently `stream.pushEnd()` and `stream.writeEnd()`.

This refactor already found a bug in which `stream.end()` was used
where `stream.push(null)` should have been.

Also in this refactor: By default, `pushError` ends the stream. You can
pass `true` as the second parameter if the error is recoverable (the
stream shouldn't end).
2020-06-10 16:07:24 -07:00
Guangcong Luo
0629a915a0 Support multiline /eval and /evalbattle 2020-06-10 11:23:20 -04:00
Guangcong Luo
140f4ad936 Support /forceroompromote
Previously, forcepromotes were done with a !!! sigil, which was
kind of silly. They now use a command starting with "force", as
is standard.
2020-06-10 11:23:20 -04:00
Guangcong Luo
0da724cba7 Correct /auth sorting direction
This also refactors /auth and /roomauth to both be in
moderation.ts (as good a place as any), and to use Utils.sortBy.
2020-06-10 11:23:20 -04:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00
Guangcong Luo
b53480b364 Fix memory leak in ladders-remote 2020-06-09 18:31:29 -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
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
DeltaCoderr
70ab234f1d
Add Room Owner rank in Help Commands (#6821) 2020-06-09 07:48:46 -07:00
Annika
406eaed520
Add /dt(gen) as an alias to use /details for a gen (#6806) 2020-06-08 12:39:20 -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
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
Marty-D
f0753192a4 Update datacenters 2020-06-08 11:59:42 -04:00
urkerab
eb84554a12
Remove last vestige of Pokebank (#6812) 2020-06-07 06:46:40 -07:00
Guangcong Luo
08420c7feb Reassign hotpatch permissions
Currently, 'hotpatch' and 'lockdown' are admin permissions, and
'console' is a console admin permission. In preparation for the
admin/leader unification, I'm removing the hotpatch permission:

- /memoryusage, /loadbanlist, /adddatacenters, /refreshpage,
  /loadbanlist have been moved from 'hotpatch' to 'lockdown'. This
	doesn't change anything, I'm just unifying the permission name.

- /updateserver has been moved from 'hotpatch' to 'console'.
  /updateserver in combination with either hotpatch or lockdown can be
	used for arbitrary code execution, and is approximately as dangerous
	as any other console command.

- /hotpatch, /savelearnsets have been moved from 'hotpatch' to
  'console'. They're reasonably harmless, but they don't do anything
	without console access, so a non-console admin using them is nearly
	definitely some sort of mistake.

`user.hasConsoleAccess` now also has a CommandContext function
`this.canUseConsole` to handle its error message.
2020-06-06 07:44:31 -07:00
Annika
14140d1543
Roomevents: Fix bug in getAllAliases() (#6805) 2020-06-05 18:28:28 -07:00
Annika
cc6334c8ce
Support specifying a reason for /hidetext (#6804) 2020-06-05 15:42:32 -07:00
Mia
da1da746b3
Youtube: Use Net library (#6803) 2020-06-05 15:20:29 -07:00
Charlie Kobayashi
3394053fb6
Scavengers - minor fixes (#6802) 2020-06-05 08:03:42 +02:00
Mia
cf42c6269a
Add a library for making HTTP/S requests (#6744) 2020-06-04 11:53:58 -07:00
Guangcong Luo
7b33aef0e3 Fix room events crashing with no alias
PR #6781 only fixed one of the crashes; the real problem was that the
code expects aliases to be an empty array if rooms have no aliases,
which have multiple flaws including unnecessarily taking up JSON
space.
2020-06-04 14:49:38 -04:00
Annika
14e75c7be6
Support minimizing roomintro/staffintro source code (#6754) 2020-06-04 11:04:54 -07:00
Guangcong Luo
58b958c6fe Improve TS 3.9 property checks
These were previously fixed in 6e2b475dac, but I prefer an approach
that makes sure e.g. `pipeTo = undefined` doesn't break this check.
2020-06-04 10:23:04 -07:00
Mia
c9c7f6a747
Youtube: Accredit videos and improve interval (#6762) 2020-06-04 06:54:05 -07:00
Annika
acaa378e89
Roomevents: Fix bug with not displaying aliases (#6798) 2020-06-03 10:56:43 -07:00
Charlie Kobayashi
9fc16889bd
Scavengers: Add Team Scavs mode (#6794) 2020-06-03 09:47:19 -07:00
DeltaCoderr
0c88586a7d
Make /pi command broadcastable (#6796) 2020-06-03 08:51:03 -07:00
SSlayer9
919ce1ef5d
Hide event alias column in event table if empty (#6791) 2020-06-03 03:29:57 -07:00
Annika
7a1a989927
Datasearch: Support gen and maxgen flags in /is and /as (#6793) 2020-06-02 22:31:08 -07:00
Mia
f52b456b9a
Chat: Make HTML pages display an error on crash (#6782) 2020-06-02 09:02:48 -07:00
fart
3add88abdf
Room Events: Fix crash when room event "aliases" is undefined (#6781) 2020-05-31 13:45:31 -04:00
asgdf
386b5863f4
Support binary/hex/octal output in /math (#6686) 2020-05-31 10:27:06 -07:00
Annika
61905ab8e0
Datasearch: Use species.nfe in /dexsearch (#6778) 2020-05-30 22:38:21 -07:00
Annika
0bb3c99f93
Datasearch: Support searching for fully evolved Pokemon (#6775)
also redesigned dexsearchhelp
2020-05-30 21:45:01 -07:00
Annika
b454343aee
Room events: Support aliases and renaming (#6748) 2020-05-30 17:54:13 -07:00
Mia
793a704d93
Trivia: Fix bug in getting the game (#6770)
room.getGame always returned null, since trivia games have different constructor names, so no one could join and no games could be ended.
2020-05-30 03:33:30 -07:00
Kris Johnson
18fbcbc914
Typescript Trivia (#6768) 2020-05-29 23:53:52 -07:00
Annika
c67ada355b
Datasearch: Support searching for moves by target (#6755)
(Also redesign movesearchhelp)
2020-05-29 20:22:29 -07:00
Kris Johnson
a7948c7c9c
Typescript config/ (#6760) 2020-05-29 19:34:43 -07:00
Annika
1386a9c930
Tournaments: Escape usernames in /tour getusers (#6764) 2020-05-29 18:57:24 -07:00
Annika
54ee5e4444
Add more move target types to /details (#6756) 2020-05-29 16:59:06 -07:00
DeltaCoderr
1c33855a3d
YouTube: Fix Grammar (#6761)
Co-authored-by: Konrad Borowski <konrad@borowski.pw>
2020-05-29 18:32:52 +02:00
Alexander B
b546337b18
Fix and enhance /editbattle (#6758) 2020-05-29 05:59:13 -07:00
Guangcong Luo
6a8e166af1 Improve broadcast (!command) errors 2020-05-29 04:22:40 -04:00
Guangcong Luo
26aebe0aaa Improve Scavengers design
- Long answers now wrap (I tried so many different ways to do this
  in CSS, involving nested divs with max-width, and ended up giving
  up and just inserting `<wbr />`s into the code.

- Hints are now in boxes, making them easier to see

- There's a "to answer, use /scavenge ANSWER" prompt next to the
  hunt start message, to help new players.

- Fixed a bug with help permissions
2020-05-29 04:22:40 -04:00
Mia
73b7b451d0
Fix crash in YouTube plugin (#6757) 2020-05-29 01:16:26 -07:00
Annika
814bf797e8
Datasearch: Add /abilitysearch command (#6759) 2020-05-28 22:06:35 -07:00
Annika
9c13f73bad
Trivia: improve help and allow changing answers in Triumvirate (#6753)
* Trivia: improve help for /trivia new

* Trivia: allow changing answers in Triumvirate mode

* tars -> targets

* Escape player usernames
2020-05-28 10:13:51 +02:00
Mia
c09ecdb12b
Chatlog: Fix memory crashes, improve UI (#6750) 2020-05-27 21:47:50 -04:00
HoeenHero
02164f2ba0 Youtube: Don't crash when adding an invalid channel 2020-05-27 08:16:22 -04:00
Mia
40f5fcf0e2
Youtube: Error out if there are no channels in the database (#6749) 2020-05-26 23:44:02 -07:00
Guangcong Luo
ba6008e488 Fix player substitutions in battles
Fixes #6747
2020-05-26 21:53:32 -04:00
Guangcong Luo
ddb9a5d11e Improve code documentation 2020-05-26 21:29:34 -04:00
Guangcong Luo
69f866ea94 Rephrase "has crashed" to "crashed"
This is a really minor thing, but fewer words tend to make
sentences more readable, and crash messages should focus more
on why something crashed than the crash itself.
2020-05-26 19:35:46 -04:00
Mia
de24f97f03
Youtube: Add plugin for viewing videos/channels (#6740) 2020-05-25 18:35:38 -07:00
Mia
c246ae51b4
Support searching roomlog entries (#6494) 2020-05-25 18:22:51 -07:00
Annika
7fd6d4f7f4
Trivia: Remove Weakest Link (#6743) 2020-05-25 17:16:44 -07:00
Annika
a4f56d27d2
Trivia: Add Triumvirate mode (#6742) 2020-05-25 14:13:21 -07:00
fart
73f58e0855
Increase autojoin limit to 15 (#6728)
Per https://www.smogon.com/forums/threads/increase-chatroom-autojoin-limit.3657450
2020-05-24 18:43:53 -07:00
cheese-testing
8dbef59cd7
Scavenger games: Allow finishers to continue and announce correctly 2020-05-24 21:42:35 +02:00
Charlie Kobayashi
0229d9bb01
Initialize scavSettings properly (#6735) 2020-05-23 15:02:46 -07:00
Charlie Kobayashi
b30d09a3eb
Scavengers: Initialize all settings as null (#6734) 2020-05-23 14:46:59 -07:00
PartMan
c3def9cdff
Fix Effectiveness showing undefined (#6733)
(change .species => .name)
2020-05-23 12:18:40 -07:00
AnnikaCodes
8fb5e93433
Trivia: support picking a random mode (#6731)
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2020-05-23 15:45:16 +02:00
PartMan
10a50d68a5
Allow scripted buttons to PM bots (#6724) 2020-05-22 18:21:48 -07:00
Charlie Kobayashi
9cb8fc4257
Scavengers: Convert to TypeScript (#6726) 2020-05-22 17:06:03 -07:00
Guangcong Luo
7c979807fa Rename /rename to /renameroom
I didn't notice that this command was named `/rename` and not
`/renameroom`. The problem was that `/rename` looks like it renames
users (like a non-forced version of `/forcerename`), and all other
room commands with this ambiguity do have `room` in them, like
`/deleteroom`, for this exact reason.
2020-05-22 13:31:57 -07:00
PartMan
2588cee95c
Fix Visual Lottery Bug (#6729)
https://www.smogon.com/forums/threads/bug-reports-v4-read-original-post-before-posting.3663703/post-8474970
2020-05-21 17:56:09 -07:00
Nol
41300c183c
Wi-Fi: Update giveaway message (#6725) 2020-05-21 18:14:39 +02:00
spixi
67d6ffb236
Fix /om chat command: wrong URL (#6722) (#6723) 2020-05-20 17:46:27 -07:00
asgdf
9af7d0c948
Wifi plugin: Fix display issues (#6720) 2020-05-20 15:54:18 +04:00
PartMan
7185d8129b Remove 10-minute restriction from Help
(They now work before the 10-limit mark; updating the help message to reflect that)
2020-05-19 00:27:51 +02:00
Guangcong Luo
0fa758bbea Hide uhtml from /chatlog by default
uhtmlchange messages, which should never have been in the chatlog
in the first place, are now always hidden.

uhtml messages are now hidden by default (can be shown with the `all`
option), because they lead to huge message sizes which cause problems
with the server, in gamecorner and a few other rooms which use it a
lot.
2020-05-18 17:04:42 -04:00
Volco
0dee619326
Fix the rename command to log the new room & require a target (#6710) 2020-05-18 09:21:14 -07:00
PartMan
d1394a6346
Add case insensitivity to Scripted Buttons (#6711) 2020-05-17 14:50:16 -07:00
AnnikaCodes
e7d72ba4e8
Add more information to /faq autoconfirmed (#6696) 2020-05-17 07:35:27 -07:00
Charlie Kobayashi
75105eea8d
Scavengers: Remove 10 minute restriction on hints (#6707) 2020-05-16 18:45:16 -07:00
Lusamine
8d910a2ad4
Update datacenters & IP-tools (#6708) 2020-05-16 18:28:06 -07:00
Guangcong Luo
88365abc4a Fix overzealous HTML validator
I forgot h1-h6 could have numbers in them...
2020-05-16 11:55:14 -04:00
Guangcong Luo
78a29656ac Fix /data defaulting to numbers instead of tiers
Fixes #6700
2020-05-16 10:58:31 -04:00
Guangcong Luo
1d6d8f73da Refactor HTML validator
Mostly, extraneous `<` tags are now correctly detected, with a better tag tokenizer.
I also removed the separate passes for <img> and <button> validation.

Fixes #6685

Thanks PartMan for contributing some ideas.
2020-05-16 10:51:45 -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
Kris Johnson
59f2a59fbc
Fix /roomtierdisplay permissions (#6699) 2020-05-16 00:03:18 -07:00
Kris Johnson
9b56380bbc
Random Battles chat plugin: Add /cap1v1 (#6698) 2020-05-16 10:45:31 +04:00
Kris Johnson
2a642afac9
Support changing /data's tier in /roomsettings (#6675) 2020-05-15 18:55:09 -07:00
1Nactive
491b5439d8
vgotd: replace quote with tagline (#6689) 2020-05-15 13:11:35 -04:00
HoeenHero
8c9225fc5c Don't override the rules link with null when initializing 2020-05-15 09:13:14 -04:00
PartMan
a362aeb9b5
SAdd /scav removehint and /scav edithint (#6690) 2020-05-15 09:48:33 +02:00
HoeenHero
a1916a2919 Fix /statcalc 2020-05-14 17:11:17 -04:00
AnnikaCodes
ca45d16cd2
Update links in /intro for Gen 8 (#6678) 2020-05-14 20:00:55 +04:00
TheMezStrikes
b29e3b53af
vgotd: add missing Image property (#6677) 2020-05-14 10:52:51 -04:00
Kirk Scheibelhut
6e2b475dac Change property checks to TypeScript 3.9 2020-05-12 20:11:56 -07:00
Mia
7bd0ce8dc7
Require forcing for bans and blacklists on trusted users (#6680) 2020-05-12 02:02:53 -07:00
HoeenHero
b39b583b4b Add support for a Video Game of the day 2020-05-11 13:39:18 -04:00
Kris Johnson
d20f1fbb64
Typescript info (#6670) 2020-05-11 03:08:33 -07:00
Leonard Craft III
0dfdf5955b
Fix /ms max (#6667) 2020-05-10 01:37:21 -07:00
Leonard Craft III
f7c46b7f33
Allow leaders+ to exportinputlog directly (#6668) 2020-05-08 23:46:25 -07:00
whales
65539381fd Mafia: Bugfixes 2020-05-08 00:41:56 +09:30
Kirk Scheibelhut
2af7040270
Group zMove and maxMove attributes (#6652)
This mostly serves to provide cleaner and more consistent field
naming. maxMove currently doesn't have boosts or effects to group
together but who knows what will be thrown at us via DLC, and being
symmetrical with zMoves is a nice.
2020-05-04 20:21:27 -07:00
Leonard Craft III
5dce0ef1a1
Update /bugs with new bug reports thread (#6653) 2020-05-04 19:35:15 -07:00
Lusamine
49ab39dc8b
Fix sprite formes for Wi-Fi lotto giveaways (#6645) 2020-05-02 20:27:08 -07:00
Charlie Kobayashi
4a3881a1c0
Scavengers: Add Jump Start (#6647) 2020-05-02 20:18:11 -07:00
Nol
7ae54deaf7
Add bl as an alias for blacklist (#6646) 2020-05-02 18:05:08 -07:00
fart
160a737979
escapeHTML when notifications blocked (#6644) 2020-05-02 15:27:44 -07:00
Ben Davies
1f595fd6a6
Prevent user identity updates from sending leave messages for guests (#6641)
Guests usually don't appear in join/leave/rename messages, but it's
possible for a bot to /trn to a guest nick with an assertion from the
login server and trigger a leave message for a guest nick to get sent.
This shouldn't have any consequences for the official client, but can
crash bots that keep state for users.
2020-05-02 12:33:00 -07:00
Waleed Hassan
a29c62e71c
Fix hotpatching chat (#6643) 2020-05-02 12:32:16 -07:00
whales
86e29cbfa6 Mafia: Fix bug when joining games 2020-05-03 01:51:28 +09:30
Waleed Hassan
e34301fc07
Lottery: Listify & Hide participants in a readmore (#6642) 2020-05-02 19:06:26 +04:00
Guangcong Luo
7e5d841739 Improve validator crash phrasing 2020-05-01 13:22:16 -07:00
Guangcong Luo
56f6ab5489 Fix Zygarde-Complete validation 2020-05-01 13:02:30 -07:00
Guangcong Luo
7aa42b1212 Remove Dex.getOutOfBattleSpecies
Literally every current use is a bug.
2020-04-30 23:29:20 -07:00
Guangcong Luo
2b83a5ed51 Support Unown formes
This adds Unown formes as true cosmetic formes, and also applies word
filters to them.
2020-04-30 14:16:56 -07:00
whales
505643144f Mafia: Bugfixes 2020-04-29 16:30:20 +09:30
Kris Johnson
979be98574
Refactor inheritsFrom to changesFrom (#6611) 2020-04-26 14:44:25 -07:00
Austin Couturier
2ea1e00ef2
Mention TypeScript in /git (#6617) 2020-04-26 10:53:16 -07:00
Lusamine
b8885dd360
Update datacenters & ip-tools (#6619) 2020-04-25 17:00:21 -07:00
AnnikaCodes
65fe886111
Don't broadcast errors in !formathelp (#6616) 2020-04-25 14:05:15 -07:00
Guangcong Luo
549ef7edb1 Fix MoveData interface definition
For historical reasons, move property definitions have been very blurry
across `EffectData`. Fortunately, recent refactors have made it
possible to put them all where they're supposed to be.
2020-04-25 12:57:46 -07:00
Guangcong Luo
e091679408 Support Config.debugvalidatorprocesses
Like Config.debugsimprocesses, this can be used to track down queries causing
infinite loops.
2020-04-25 15:55:05 -04:00
Guangcong Luo
1dada44a2a Support server/chat-plugins/private as symlink 2020-04-25 15:51:11 -04:00
Guangcong Luo
6a685df8c7 Fix crashes when hotpatching chat
(Also fix a mistaken thing-of-the-day refactor: I blame giving two
different variables the same name.)
2020-04-25 11:11:24 -04:00
Astrid Halberkamp
3bbb36d491 TOTD: small fixes and upgrades 2020-04-25 17:06:39 +02:00
Astrid Halberkamp
008ff20dd8 Use better chatfilter handling in /makegroupchat 2020-04-25 17:06:39 +02:00
Jeremy Piemonte
dcfbada1ad
Blackjack: Do not require an autostart to create (#6607)
Bug introduced in 36d6dc8b0c (diff-797aaa7fdf5beb7302351b8ad019da67)
2020-04-24 20:14:19 -07:00
Guangcong Luo
31a81a91a2 Fix @type in .ts files
Some JSDoc type assertions failed to get converted during various .ts
refactors. This commit takes care of them.
2020-04-24 14:19:08 -07:00
Guangcong Luo
f6f4467265 Turn on prefer-const for .js files
Not having prefer-const on the JS side makes JS -> TS refactors really
unreadable. This commit just auto-fixes it so we're using
`prefer-const` everywhere.
2020-04-23 11:37:47 -07:00
Guangcong Luo
9bb903da0d Fix TypeScript for thing-of-the-day 2020-04-23 10:30:22 -07:00
Mia
1a62036aaf
Typescript Thing of the Day (#6603) 2020-04-23 10:12:56 -07:00
AnnikaCodes
2c08cde63a
Add G-Max Move to /details results (#6599) 2020-04-22 01:38:37 -07:00
AnnikaCodes
4a13afab51
Datasearch: don't broadcast errors (#6601) 2020-04-22 01:25:10 -07:00
Guangcong Luo
611b186265 Fix port config not being passed to child process
Fixes #6597
2020-04-21 07:26:29 -07:00
Guangcong Luo
8498842697 Make custom room ranks always override
Custom room rank symbols will now override all other ranks in the
userlist.

Their permissions now also fall back to global permissions.

(Also fix an obscure crash with custom rank symbols.)
2020-04-18 07:22:29 -07:00
Guangcong Luo
a049d85a98 Fix build errors from TypeScript update
I'm not entirely sure why these two errors are cropping up now, but
they are.

The "thenable" one seems to be a bug, but in what?
2020-04-17 23:00:28 -07:00
Guangcong Luo
776ccf9796
Refactor Sockets to ProcessManager+TypeScript (#6584) 2020-04-17 04:05:45 -07:00
Guangcong Luo
c49343b7e2 Setting a room rank can no longer demote globals
Previously, if you gave e.g. roomvoice to a global moderator, that
would demote their room rank to voice. Now, they will remain a
moderator, with "voice" only appearing in `/roomauth` and `/auth`.

(Includes a refactor of Config.groups)
2020-04-17 03:32:11 -07:00
Peach
2828427946
Mafia: Misc updates (#6583)
* Attribute non-host mod commands

* Fix crash in queue

* Add command for listing all data entries

* Update permissions in help box

credits to @Claire238
2020-04-15 22:40:43 -07:00
asgdf
31cb98bebe
Improve hosttype detection for special case (#6577) 2020-04-14 15:26:16 -07:00
Lusamine
12a52bc0d0
Add a linebreak to WiFi GA result (#6575) 2020-04-13 20:12:35 -07:00
CameronClarry
15efa254cd
Add '/trivia move' command to trivia plugin (#6561) 2020-04-12 23:08:27 -07:00
AnnikaCodes
e626299c39
Add /faq tournaments (#6500) 2020-04-12 23:05:26 -07:00
Nol
61375a24cd
Update Wi-Fi giveaway message (#6560) 2020-04-11 23:38:42 +02:00
Charlie Kobayashi
44250d7d3b
Support (multiple) twists for all game modes (#6559) 2020-04-11 13:05:42 +02:00
Guangcong Luo
ae129ed8d7 Report full stack trace for crashes
We previously only reported the first line of the stack trace, but now that .readmore exists, showing
the full stack trace isn't too spammy anymore.

Also, private logs are now put into Upper Staff.
2020-04-11 04:20:19 -04:00
Peach
76688629e4
Don't let locked users PM through any level of blocking (#6555) 2020-04-10 17:24:38 -07:00
Peach
0ad24a0acd
Fix bugs in chatlog date parsing (#6550) 2020-04-09 22:47:12 -07:00
whales
cf910afaac Fix bug in roombanning 2020-04-10 13:41:03 +09:30
Marty-D
8a29a46f25
Add more trainer avatars
made by Gnomowladny
2020-04-09 15:22:49 -04:00
asgdf
85b621f0f2
Update datacenters (#6547) 2020-04-09 11:55:25 -07:00
Peach
b812404669
Fix crash in roomlogs (#6546) 2020-04-09 01:32:56 -07:00
Charlie Kobayashi
558202cb96
Make twist setting actually permanent (#6544) 2020-04-08 20:33:20 -04:00
Guangcong Luo
ebd2954d10 Fix punishments 2020-04-08 16:50:26 -04:00
Guangcong Luo
806ce433da Fix zombie processes after hotpatching chat 2020-04-08 12:02:42 -07:00
Mia
3fc757e958
Typescript chat-commands/moderation, refactor Punishments (#6490) 2020-04-08 11:56:19 -07:00
Guangcong Luo
d34f4f23f5 Suppress crash while hotpatching helptickets
I think this was just due to a different helpticket crash, but sadly I didn't really have the free
time to investigate more deeply.
2020-04-07 21:47:56 -04:00
Guangcong Luo
86081c23ab Fix chatlog
- fix timezone
- `/chatlog [roomid]` should open logs for room
2020-04-07 21:47:56 -04:00
Guangcong Luo
572342c8a0 Support listing gvoices with /auth + 2020-04-07 21:47:56 -04:00
Guangcong Luo
f8cac19340 Add more Ash avatars 2020-04-07 21:47:55 -04:00
Austin Couturier
d9db072fc8
info.js: Update the /randomscalc command (#6537)
also change the link for /calc as per pre
2020-04-07 17:26:29 -07:00
Charlie Kobayashi
6c18107ca6
Scavengers: Information commands for twists (#6532) 2020-04-07 09:50:27 +02:00
The Immortal
634658a5ba Refactor unreleased Pokemon
Pokemon that are not available in-game are now consolidated into `isNonstandard`. 'Past' indicates that the Pokemon no longer works in the current generation. 'Unobtainable' indicates that the Pokemon works but can only be obtained through hacking.
2020-04-06 20:53:03 +04:00
HoeenHero
4aa40b64f0 Fix typo in 7583841d42 2020-04-03 11:24:23 -04:00
Kris Johnson
edf18b57d4
Fix /randbats not working in Gen 1/2 battles (#6519) 2020-04-03 17:36:17 +04:00
HoeenHero
7583841d42 Fix issues with /processes and /data
/processes - Accidental conversion of basename -> basespecies reverted.
/data - Fixed providing a pokedex number as an argument.
2020-04-02 23:56:14 -04:00
fart
8fda9da4d0
Fix minor /hidetext bug (#6511)
If /hidetext is used with a linecount parameter on a trusted user, it currently says "USER, 4 is a trusted user, are you sure you want to hide their messages? Use /forcehidetext if you're sure." This change hides the additional linecount parameter from the message.
2020-04-01 09:15:06 -07:00
Charlie Kobayashi
708860f42a
Scavengers: fix point giving (#6510) 2020-04-01 12:09:44 -04:00
Charlie Kobayashi
6feb05c357
Rework special scavenger modes (#6507)
- apply them as "formats"/"mods" instead of a large parent game with another room game nested inside
- the parent game is attached to ``room.scavgame`` as an independent object instead.
- add a command to set the twist (/scav settwist) and reset the twist (/scav resettwist) for scripted formats
     - this means that scavenger-games.js might be updated once per month as new twists are created.
- add a command to start a regular hunt with twists

More than one twist can be loaded into a single scavenger hunt (from scavenger game mode + /scav createtwist)
2020-04-01 00:45:49 -07:00
Mia
4005ff6722
Typescript TCG & Tabletop's plugin (#6474) 2020-03-31 14:09:38 -07:00
Kris Johnson
adb4eed23b
Other Metas chat plugin: Remove Tier Shift check (#6504) 2020-03-30 19:08:16 +04:00
Kris Johnson
b90cae8dff
Other Metas chat plugin: Add past-gen support (#6499) 2020-03-30 18:28:01 +04:00
Kris Johnson
ed9f1eb5e2
Fix /weak not showing Pokemon names (#6498) 2020-03-28 02:49:02 -07:00
whales
64d3cc59c8 Polls: fix blankvoting, help message 2020-03-27 17:09:04 +10:30
Kris Johnson
4cc1ffa4e8
Datasearch: Fix /ms <pokemon> (#6491) 2020-03-26 03:17:02 -07:00
Kris Johnson
994fc60aed
Rename Template to Species (#6478) 2020-03-25 23:29:27 -07:00
Guangcong Luo
5cd743c88a Fix eslint no-unused-expressions issue 2020-03-25 20:34:03 -07:00
asgdf
34162abb8b
Add /monthlock command (#6488) 2020-03-25 03:59:47 -07:00
Guangcong Luo
0afa0d49bc Fix /invite permissions
Now that roomauth bypasses modjoin, promoting anyone to roomvoice is
sufficient to give them access to any room.
2020-03-23 23:52:16 -07:00
Mia
1628258371
Typescript chat-commands/core (#6484)
Also fix TS line numbers in GitHub Actions
2020-03-23 23:50:35 -07:00
Guangcong Luo
604b8142ef Improve /chatlog support for uhtml 2020-03-23 17:50:15 -04:00
whales
9ad7b53bdb Don't fail silently in uhtml commands 2020-03-23 20:33:42 +10:30
fart
80cfacc2b0
Support /hidetext [line count] (#6471) 2020-03-22 15:53:40 -07:00
Kris Johnson
ff0968bdc9
Scalemons: Move stat formula to rulesets (#6481) 2020-03-22 05:44:47 +04:00
whales
003c696f2f Allow tour banning/unbanning without a running tour 2020-03-21 15:48:10 +10:30
Peach
2bf71cd42d
Attribute addhtml and code commands (#6444) 2020-03-20 20:58:56 -07:00
Kris Johnson
770f1a3f7c
Add support for (NU) (#6475) 2020-03-20 20:50:14 -07:00
Astrid Halberkamp
867f8c9843
TOTD: COTD -> COTW 2020-03-18 17:41:41 +01:00
Kris Johnson
53299ea068
Random Battles chat plugin: Fix Let's Go support (#6468) 2020-03-18 12:47:41 +04:00
Kris Johnson
3e26318758
Refactor learnsets.js (#6466) 2020-03-18 00:59:29 -07:00
Mia
6b31c251c7
Fix links for /randbats (#6467)
currently takes you to play.pokemonshowdown.com/dex.pokemonshowdown.com, which is obviously not right.
2020-03-18 00:48:11 -07:00
Guangcong Luo
40499b6cf6 Remove dependency of sim on Config 2020-03-17 21:06:40 -07:00
HoeenHero
b74a86d83c Only prune disconnected users 2020-03-17 13:42:24 -04:00
Kirk Scheibelhut
17501fc001
Remove restrictions on concurrent battle searches (#6462)
https://www.smogon.com/forums/threads/improve-searching-for-concurrent-ladder-battles.3660989/
2020-03-16 21:17:34 -07:00
Kris Johnson
83ebdb27da
Add Dex#getOutOfBattleSpecies (#6463) 2020-03-16 20:31:38 +04:00
Guangcong Luo
64c3d75f1c Hide deleted rooms by default in chatlog 2020-03-16 03:35:32 -04:00
Guangcong Luo
c4e91d20e2 Improve chatlog design
Big thanks to smogon/pokemon-showdown-client@a176317913 for making
this possible!
2020-03-16 03:35:32 -04:00
Guangcong Luo
b7889f048f Fix chatlog permissions
- global auth should now be able to see chat logs of rooms they can't
  moderate

- secret and personal rooms that a staff member is either currently in,
  or has auth in, will now show up in the main logs list (although
  you should just use /chatlog, it's much easier)
2020-03-16 03:21:43 -04:00
Guangcong Luo
7de51956c5 Change BasicChatRoom to Room in some types
`user.can` and `user.authAtLeast` now take `Room | BasicChatRoom`
instead of `BasicChatRoom`. It's now significantly less necessary to
cast things to `BasicChatRoom`.
2020-03-15 19:52:59 -07:00
Lusamine
2283b28afc
Update datacenters & ip-tools (#6459) 2020-03-14 11:27:26 -04:00
Guangcong Luo
99cf399860 Fix /chatlog command 2020-03-14 00:10:14 -04:00
Guangcong Luo
c6d83508ab Rename chat-log to chatlog to match modlog 2020-03-14 00:04:42 -04:00
Guangcong Luo
60cbd7d0d7 Implement /chatlog command 2020-03-14 00:04:16 -04:00
Guangcong Luo
a74fe6e0cc Improve debugging support 2020-03-13 23:57:41 -04:00
Guangcong Luo
f7d2cdf1be Fix log viewer permissions
Drivers/mods should be able to see secret room logs, but not get a list
of secret rooms.
2020-03-13 23:52:41 -04:00
Guangcong Luo
35aad974f8 Implement Chat.normalize 2020-03-13 22:30:17 -04:00
Guangcong Luo
354513ad53
Add log viewer (#6454) 2020-03-13 22:18:00 -04:00
Leonard Craft III
5a581a762d
Fix autostart timer bug with less than 2 players (#6451) 2020-03-12 21:46:47 -04:00
Kris Johnson
b077646808
Random Battles chat plugin: Fix various issues (#6448) 2020-03-12 12:37:10 +04:00
Peach
d9f2f8e745
Block hotpatches while updating/rebuilding (#6445) 2020-03-12 00:45:14 -04:00
Guangcong Luo
64ff1da81f Refactor more things to use inheritsFrom 2020-03-10 09:59:36 -07:00
Kris Johnson
82a3fc7b94
Refactor [Gen 2] Random Battle (#6435) 2020-03-09 11:56:15 +04:00
Kris Johnson
86761e3577
Add Random Battles chat plugin (#6433) 2020-03-09 09:55:43 +04:00
Waleed Hassan
e86ec0b7fe
Fix Wifi GAs (#6431) 2020-03-08 20:23:37 -07:00
Guangcong Luo
efa98a08b9 Improve linkRegex
We're now using regexfree for linkRegex as well as the indentation
rule.

https://zarel.github.io/regexfree/
2020-03-08 20:16:53 -07:00
Guangcong Luo
4616bf1090 Fix bug in /addhtmlbox 2020-03-07 16:31:52 -08:00
Guangcong Luo
647ba61a46 Turn on prefer-regex-exec in eslint 2020-03-07 13:39:02 -08:00
asgdf
cac033ab86
Improve handling of mobile IPs with permalocks (#6338) 2020-03-07 11:50:08 -08: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
Kris Johnson
cc9b6f6c22
Tournaments: Remove space from DQ modlog (#6427) 2020-03-06 21:34:27 -08:00
Waleed Hassan
8aa4f053bb
Use optional chaining and linter improvements (#6422)
This is mostly just a follow up to #6342.

`prefer-optional-chaining` was turned on and fixed in every location it
complained in. The transformed function [0] looks expensive from a
glance but from skimming through the replaced sites it doesn't appear
to be ran in any important place, so it should be OK.

The linter improvements are:
- Increase linter performance
	- Make `full-lint` and `lint` write to different caches so we
	  avoid overwriting their caches since they're different configs
	- Change husky's hook to `npm run lint` so as to write to the
	  same cache
	- Remove `@typescript-eslint/eslint-plugin-tslint` which is
	  essentially a wrapper to TSLint because the rules aren't worth
	  running another linter
- Convert `.eslintrc.json` and `.eslintrc-syntax.json` to two spaces
  rather than four tabs to respect PS' `.editorconfig`
- Rename `fulllint` to `full-lint` to ease spelling it

[0] - https://pastie.io/mmtxpf.js (prettified)
2020-03-06 11:44:32 -08:00
Guangcong Luo
242e9a3ac0 Implement /tour formats
This adds nicer output for the tour formats error message, and also
creates a broadcastable command for it.

Fixes #6419
2020-03-06 10:41:33 -08:00
TheMezStrikes
505836e27e
Escape HTML in events (#6423) 2020-03-06 08:51:46 -08:00
Astrid Halberkamp
de1a29c507
Wifi: Remove friendcodes from giveaways 2020-03-06 00:05:52 +01:00
Guangcong Luo
d007bdc12f
Force timer if blitz mod is in effect (#6418)
Also increase first turn time to 40
2020-03-05 09:43:56 -08:00
Guangcong Luo
b21c9047e2
Migrate to typescript-eslint (#6342) 2020-03-05 08:33:06 -08:00
whales
7038fac173 Fix non-ripgrep modlog 2020-03-02 17:39:36 +10:30
Lusamine
7e8f5ddc36
Update datacenters & ip-tools (#6406) 2020-03-01 03:27:04 -08:00
fart
5a6ea0edc5
Fix /tour autodq off (#6401)
The most recent change to this file prevents "/tour autodq off" from working and sends a "That isn't a valid timeout value." error to the client. This is because it checks for a condition where timeout is greater than 1 hour, but when turning autodq off, the timeout variable is set to Infinity. This proposed change adds a check in the condition for if the timeout value is Infinity and does not send the error if that is the case (but if timeout is a numeric value greater than 1 hour, it still will fail).
2020-02-28 05:38:30 -08:00
whales
26fa367f75
Fix bugs with renaming rooms (#6392) 2020-02-24 23:54:10 -08:00
whales
38daf467fc
Add some common rooms to the roomid type (#6393) 2020-02-24 19:52:41 -08:00
Ben Davies
1be30cf29a Commands: prevent /code from trimming leading horizontal whitespace 2020-02-24 01:45:17 -04:00
whales
4231f3c626
Fix inputlogs for battle evals (#6388) 2020-02-23 03:59:03 -08:00
Guangcong Luo
fee9a3fa0b Fix typo in previous commit 2020-02-23 01:42:51 -08:00
Guangcong Luo
b1ea19d5b5 Further improve handling of crashed subprocesses 2020-02-23 01:33:35 -08:00
Christopher Monsanto
4cb531e4a8
Add Config.startuphook (#6382)
This is called when the server is fully initialized and ready to serve
requests. Useful for notifying a process manager.
2020-02-22 15:51:18 -08:00
whales
1920ca8161 Fix lint error 2020-02-22 01:22:07 +10:30
whales
d546abf87e Mafia: Fix modlog entry for data commands 2020-02-21 20:39:02 +10:30
whales
926970f765
Automatically upload replays when reporting (#6380) 2020-02-21 00:47:19 -08:00
Waleed Hassan
34e215c7a6
Support renaming rooms (#6295) 2020-02-21 00:47:07 -08:00
whales
f2ac6a111e
Support polls allowing multiple responses (#6356) 2020-02-20 23:54:23 -08:00
Kris Johnson
e64e083e6c
Typescript The Cafe (#6379) 2020-02-20 23:01:20 -08:00
Kris Johnson
98190d28a1
Typescript Datasearch (#6376) 2020-02-20 16:37:13 -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
Mia
7d54352169
Add /shuffle command (#6372) 2020-02-18 16:45:32 -08:00
Kris Johnson
5875f1e3cc
Fix Virtual Console in /learn (#6374) 2020-02-18 13:38:19 -08:00
Kris Johnson
2ea84725e2
Typescript Daily Spotlight, RoomFAQs, and Wi-Fi (#6373) 2020-02-18 13:26:44 -08:00
HoeenHero
704772794e Cap tournament disqualification timer at 1 hour 2020-02-16 17:44:16 -05:00
Guangcong Luo
d4e2871665 Support validating Gen 8 egg moves
Gen 8 egg moves can be grafted onto existing Pokémon, removing
compatibility issues.
2020-02-14 10:57:31 -08:00
whales
d1ff1f44a5 Mafia: Fix bug in nighttalk command 2020-02-15 00:04:56 +10:30
Kris Johnson
5550b164c8
Typescript Calculator and Chat Monitor (#6365) 2020-02-13 12:38:12 -08:00
whales
7db204730c
Make User#update more typesafe (#6359) 2020-02-13 10:33:16 -08:00
whales
3f0471cc38 Mafia bugfixes
Fix aliases with starting IDEAs, suggest the correct nighttalk command
2020-02-13 18:09:09 +10:30
Kris Johnson
9aaab2c57b
Typescript Help Tickets and Modlog and fix warnings (#6352) 2020-02-12 21:48:03 -08:00
Kris Johnson
358d947b15
Add Let's Go transfer support (#6367) 2020-02-12 21:22:45 -08:00
Guangcong Luo
224fce2ed4 Update dependency check for sucrase
We try to feature-detect for dependencies, but this one is hard and
I don't want to actually do an actual sucrase compile to check if it's
up to date, hence digging through its version number. Too bad they
added a major feature in a minor version, complicating the check. :/
2020-02-12 15:57:27 -08:00
The Immortal
b91779476f Update /formathelp for OMs 2020-02-12 23:31:01 +04:00
The Immortal
f86adef3ea Fix max line length warning 2020-02-12 15:40:06 +04:00
The Immortal
19cdf79821 Update OMs 2020-02-12 14:19:29 +04:00
Guangcong Luo
1051b9e4ba Sent a useful tip if someone sends /nick 2020-02-11 14:43:05 -08:00
Lusamine
39545c581d
Update datacenters and IP-tools (#6355) 2020-02-09 16:11:33 -08:00
Kris Johnson
36d6dc8b0c
Typescript Jeopardy, Blackjack, and Room Events (#6331) 2020-02-07 03:16:49 -08:00
whales
2a6db11b3e Fix trackRename message 2020-02-06 23:11:58 +10:30
Kris Johnson
64a37210a3
Add generation and natdex support for /movesearch (#6320) 2020-02-05 15:39:42 -08:00
Kris Johnson
d1c0fb26a6
Tournaments: Send name and format to room separately (#6335) 2020-02-05 07:47:06 -08:00
fart
250af8c03b
Fix Lottery Help (#6324)
There is no lottery editmarkup command. The proper use is to use /lottery edit, which allows you to edit the number of max winners, the name of the lottery, and the HTML, but also requires all three parameters be included.
2020-02-03 19:19:00 -08:00
whales
1e017d205b Use room#getGame in a few more places in mafia 2020-02-03 23:50:23 +10:30
Waleed Hassan
f7e024e009
Allow safer and exact type retrieval of Room#game (#6315)
By adding a `getGame` function of type:

```
// null is returned if the gameids don't match
// or the game doesn't exist
getGame<T extends RoomGame>(constructor: new (...args: any[]) => T) => T | null
```
(Credits @urkerab and @whalemer for the function signature.)

It allows refactoring previous code of:

```
if (room.game && room.game.gameid !== 'hangman') return;
const game = room.game as Hangman;
```

to:

```
const game = room.getGame(Hangman);
if (!game) return;
```

This has a couple of advantages:
- TypeScript will throw an error if the if condition is not present.

- In the new code, the template must extends `RoomGame` and be assignable to the same ID, so it's 100% typesafe
2020-02-03 05:09:37 -08:00
asgdf
f5c881cf9f
Add modlog button to appeal tickets (#6329) 2020-02-02 23:04:07 -08:00
whales
3c97e7aa22
Mafia: Misc updates, rework data format (#6277) 2020-02-03 10:58:30 +10:30
Lusamine
9e699ff8d7
Update datacenters & ip-tools (#6300) 2020-02-01 22:01:11 -08:00
whales
bf84c0bc5e Support /forcetrustuser for offline trusting (#6301) 2020-01-26 12:54:07 -08:00
Ben Davies
88ccff34ec Commands: filter guests from the userlist in /cmd roominfo's response 2020-01-20 05:45:26 -04:00
Lusamine
eed30c3759 Update datacenters (#6294)
* Update datacenters and ip-tools

* Clean up DET/Host1Plus/Heficed ranges
2020-01-18 22:26:42 -07:00
HoeenHero
66916aca5a Tickets: Fix bug with expiring ticket bans 2020-01-18 15:18:35 -05:00
whales
c4ae4cfdc3 Fix namemonitor message 2020-01-15 20:19:39 +10:30
Waleed Hassan
02c862da31 Add a GroupSymbol type (#6285) 2020-01-14 14:07:11 -08:00
Waleed Hassan
6714e14fc5 Fix max line length warnings (#6286) 2020-01-14 15:30:50 +04:00
whales
4818190b98 Always show shared battles button in helptickets 2020-01-14 12:29:27 +10:30
Kris Johnson
dde822edd3 Fix Flying Press crash in /coverage (#6275) 2020-01-11 07:31:14 +04:00
HoeenHero
56e850ff8e Remove leftover debug statement 2020-01-10 20:49:20 -05:00
HoeenHero
b1890bb343 Tickets: Only write on destory for open tickets 2020-01-08 08:58:35 -05:00
HoeenHero
584175c57c Update help information for modchat 2020-01-08 08:17:10 -05:00
HoeenHero
77b76a5b09 Fix mistake in ae28a960b (toId -> toID) 2020-01-04 14:54:09 -05:00
not_a_seagull
ae28a960be Convert index.js and team-validator-async.js to typescript (#5987) 2020-01-04 07:11:54 -05:00
asgdf
45b808b181 Fix /statcalc without pokemon argument (#6237) 2020-01-03 01:56:01 +04:00
HoeenHero
86e3c81b8a Tickets: Ticket rooms expire and close after 40 minutes of inactivity 2020-01-01 20:45:17 -05:00
HoeenHero
913a3b456e Tickets: Improve ticketban detection 2020-01-01 20:45:16 -05:00
HoeenHero
4704288839 Tickets: Don't use date strings due to inconsitensies between node versions
Date strings can have inconsitensies between browsers and apparently node versions too.
sim3 uses a newer node version and as a result date calculations are off by one.
I have swapped to using individual date componets eg `new Date(2020, 0)` to fix this.
2020-01-01 20:45:15 -05:00
Ocean-ey
7260db1b3d Update !code description (#6248)
!code no longer requires global voice to use in PM's.
2020-01-01 07:52:31 +04:00
Kris Johnson
649ac8ea6b Typescript uno/othermetas/hangman (#6229) 2019-12-31 17:52:26 +09:00
SirMisterGit
10f034c798 Mafia: Don't show "partners" to traitor faction (#6205) 2019-12-30 20:37:39 -05:00
whales
65d904b6e5 Fix room desynch bug (#6239) 2019-12-31 00:27:40 +09:00
HoeenHero
427dc80346 Tickets: Add a dash to IP-Appeal 2019-12-29 19:26:42 -05:00
whales
1f9bf5df6a Fix modchat error message 2019-12-29 10:29:09 +10:30
Ben Davies
e8c8e0d9bd Add CommandContext#shouldBroadcast and fix !code permission checks (#6198) 2019-12-28 16:26:50 +09:00
Claire238
744853cb89 Fix spelling for punishment list (#6199) 2019-12-23 09:49:46 +09:00
whales
456f987cb3 Give mods access to /host (#6200) 2019-12-23 02:49:23 +09:00
asgdf
b352ab8e3e Update datacenters (#6202) 2019-12-22 05:21:28 +09:00
Ben Davies
8470325f35 Commands: Remove some restrictions on /code (#6182) 2019-12-20 00:45:49 +09:00
Kris Johnson
dd016c21ff Add support in /details for Pokemon that require special trading conditions (#6194) 2019-12-19 20:38:05 +09:00
whales
d7c03256aa Fix modchat modlog entry (#6196) 2019-12-19 20:34:30 +09:00
HoeenHero
d8d59dbbae Fix modchat modlog message 2019-12-18 18:11:39 -05:00
whales
8a2969eb18 Fix rebuilding on windows (#6191) 2019-12-17 05:29:24 +09:00
Kris Johnson
42321c5e68 Display Dynamax Power on moves in /details (#6189) 2019-12-16 15:36:28 +09:00
fart
0291eabce3 Include National Dex mons in veekun command (#6186)
Currently fails on Pokemon and moves not included in gen 8
2019-12-16 04:08:48 +09:00
Leonard Craft III
d57cf6b518 Capitalize "Showdown" in IP-Appeal Help Ticket message (#6185) 2019-12-15 03:32:07 +09:00
HoeenHero
37600b7094 Helptickets: Require users to give input for IP-Appeal tickets 2019-12-13 20:58:53 -05:00
Ben Davies
a17b81ccf7 Trivia: nuke | 0 int flooring hack
Cool optimization bro, too bad numbers like -0 exist
2019-12-13 08:07:35 -04:00
Waleed Hassan
df14f875ec Add a RoomBattle#challengeType property (#5940)
This commit adds a `challengeType` property to `RoomBattle` of
type `rated | unrated | challenge | tour`.

Previously, there was no way to programatically differ an unrated
battle from a challenge, which is useful in places like filters.
2019-12-12 19:09:43 +09:00
Dragonmirror27262
128a3391f8 Fix roomevents help messages (#5800) 2019-12-12 00:20:35 +04:00
whales
82b4d95b8e Mafia: Allow setting an IDEA's rolelist as a theme (#6173) 2019-12-12 00:17:45 +04:00
Kris Johnson
8eaf19f882 Add past gen support for /mnm and /stone (#6177) 2019-12-12 00:13:47 +04:00
whales
dd1dee6fa9 Make subrooms inherit parent room mutes (#6161) 2019-12-11 16:58:39 +09:00
The Immortal
5798aad982
Fix LGTM warning 2019-12-11 06:41:27 +04:00
420Blazeitt
59584aea54 Update /smogdex to gen 8 (#6169) 2019-12-11 03:08:15 +09:00
whales
fb6f7cb7dc Typescript mafia (#6145) 2019-12-09 22:17:09 +09:00
whales
496cbb70db Check permissions for offline warns 2019-12-09 13:49:52 +10:30
Kris Johnson
2854e71166 Fix various evolution methods (#6160) 2019-12-07 17:15:31 +04:00
whales
0b9d8dd109 Support declarative roomsettings syntax (#6119) 2019-12-06 23:16:55 +09:00
Spandan Punwatkar
4876127f08 Update datasearch.js (#6144) 2019-12-05 18:04:01 +04:00
Spandan Punwatkar
530e382df1 Fix moves in /nds (#6138) 2019-12-04 15:24:50 +09:00
HoeenHero
f58dcbb6dd Ladders: Only display one error message 2019-12-03 15:19:48 -05:00
The Immortal
7c6364edaf Fix /mnm crash 2019-12-03 02:00:52 +04:00
HoeenHero
e092caf2d2
Ladders: Delete rating cache if no response. (#6132)
If the remote ladder's update rating method dosen't receive
a response from the login server, it will not change the user's
mmrCache for the format, resulting in future ladder matches using
an outdated ELO until the server receives a response at the end of
a future match.

This is the cause of issues such as users with 1400 ELO being matched
with users with 1000 ELO with a 10 second wait time in current gen OU.

Ensuring the rating is up to date was discussed, but for cases such as
a user searching for a new match before a response is received (or an
error occurs) we decided to accept the mmrCache being at most 1 game
behind, which this change.
2019-12-01 21:47:52 -05:00
whales
f98261d91f Mafia: Use a slightly better hack to allow hosts to broadcast (#6129) 2019-12-01 14:29:50 -05:00
whales
7446c65c93 Mafia updates
Fix Illusionist data, allow hosts to broadcast dt, fix error for joining a full game
2019-12-02 01:16:53 +10:30
whales
06ba503227 Refactor modchat permission check (#6123) 2019-12-01 10:13:22 +13:00
whales
f7d5cefc7d Refactor tournament plugin loading (#6118) 2019-11-30 17:53:01 +13:00
whales
20c708b20a Typescript roomsettings (#6117) 2019-11-30 17:34:14 +13:00
The Immortal
f39b05fd1e Update /mnm
Update to gen 8 and remove unnecessary warnings.
2019-11-30 05:46:12 +04:00
PartMan
37e7189008 Don't display Z-Power for Max moves (#6111) 2019-11-30 10:16:42 +13:00
Konrad Borowski
5fcb840e3b Hide stack traces for private code (#5898) 2019-11-29 10:35:18 +13:00
PartMan
7af93a4a79 Don't display Weight for GMax Pokemon (#6091) 2019-11-29 10:34:54 +13:00
Spandan Punwatkar
3deb1c69c4 Dexsearch: Allow searching national dex (#6106) 2019-11-28 12:40:30 -05:00
Spandan Punwatkar
d2ac1f1eb9 Dexsearch: Allow searching for some formes (#6103) 2019-11-28 23:17:23 +13:00
Spandan Punwatkar
b6b66de896 Update Repo Links (#6102) 2019-11-28 12:47:38 +04:00
urkerab
09b66da216 Use Chat.html`` a bit more 2019-11-27 15:14:46 +01:00
Spandan Punwatkar
63694edf91 Some movesearch changes (#6071) 2019-11-27 22:28:03 +13:00
Guangcong Luo
5364c63e23 Introduce item.itemUser
`item.itemUser` replaces `item.zMoveUser`, and is a new field
representing a list of possible users of an item, for items that are
restricted to specific species.

`item.zMoveUser` is a base forme for items that affect every forme, and
a forme name otherwise (forme name is currently only used for
`forcedForme` uses).

Arceus is a weird case. Both generic Z crystals and Plates, while
having unique effects on Arceus, also have effects on other Pokémon.
For this reason, Arceus isn't listed as an `itemUser` of either of
these item types - use-cases that want this should also check
`item.forcedForme`.

This is mostly intended to be useful to move-searching and custom
rules (like NatDex, which will only allow past-gen items associated
with removed species).
2019-11-25 15:26:36 +13:00
Astrid Halberkamp
aace3c4265 Spoiler racial slur evasion 2019-11-25 02:08:43 +04:00
MrEconomical
dea8411ad3 Fix file extensions in comments (#6062)
Update the extensions of a bunch of files that were migrated to TypeScript in comments
2019-11-24 12:57:12 +13:00
whales
544d331a65 Report normalized target for hotpatches (#6057) 2019-11-24 10:22:48 +13:00
PartMan
3249a10e03 Display user for GMax moves in /dt (#6059) 2019-11-24 10:22:07 +13:00
asgdf
2650884341 Remove erroneous autolink escape formatting (#6047) 2019-11-22 01:11:29 +04:00
whales
841c028f12 Require a break on either side of evaded words (#5991) 2019-11-21 07:15:51 +13:00
Kris Johnson
8370c488ce Fix the evolution method of new Pokemon (#5982) 2019-11-20 21:44:16 +13:00
420Blazeitt
57885ec588 Update /learn description to include /usumlearn (#6024) 2019-11-20 14:41:25 +13:00
TheMezStrikes
3136f4d785 Update datasearch for gen 8 (#5965) 2019-11-19 23:43:43 +04:00
fart
a8b5ef671f Limit MNM warnings to CAP stones (#6018)
Right now the /mnm command results in warnings that the mega stone is a CAP stone, even when it is not. This is because isNonstandard is now set to "Past" instead of undefined.
2019-11-19 20:21:52 +04:00
Lusamine
b0e649972b Update Wi-Fi GA message for Gen 8 (#6004) 2019-11-19 05:20:02 +04:00
Waleed Hassan
27563f6380 RoomGame: Uncomment optional functions (#5992)
TypeScript will now recognizes these functions existence so
we don't have to supress the compiler whenever they come up.
2019-11-18 16:43:40 +13:00
whales
e36dda7b09 Add a few more characters to the evasion filter 2019-11-18 12:59:44 +10:30
Guangcong Luo
f54410a44b Fix crash with /importinputlog 2019-11-17 13:10:43 +13:00
asgdf
f1a714d426 Fix /ts command to use gen 7 tier data (#5971) 2019-11-17 09:09:04 +13:00
Alexander B
347714116c Add "Past Gens Only" to gen 8 /dt (#5958) 2019-11-16 20:20:01 +13:00
Guangcong Luo
a01daed212 Fix /rebuild crash 2019-11-16 10:10:33 +13:00
peach
52a10f8291 Fix paths when hotpatching properly 2019-11-15 23:35:56 +10:30
peach
42aec533a6 Fix paths when hotpatching 2019-11-15 23:34:19 +10:30
whales
0d7e473672 Allow viewing roomfaqs without showing source (#5944) 2019-11-16 00:12:26 +13:00
Kris Johnson
46ad0bccd7 Add Gen 8 Pokemon 2019-11-15 22:01:36 +13:00
whales
28be861480 Don't use default property values in announcements 2019-11-15 16:14:00 +10:30
Guangcong Luo
23f9bfa1b7
Split up server/chat-commands/ (#5943)
`server/chat-commands.js` is now a directory. It's been split into
`core`, `moderation`, and `admin`. `info` and `roomsettings` from
`chat-plugins` have also moved to `chat-commands`.

Some cleanup:

- Bot commands for inserting HTML into rooms like `/adduhtml` have been
  moved from `info` into `admin`.

- `/a` has been renamed `/addline`, for clarity (and also moved from
  `info` into `admin`).

- Room management commands like `/createroom` and `/roomintro` were
  moved to `room-settings`

- `chat-commands/admin` has been TypeScripted
2019-11-15 11:12:54 +13:00
Lusamine
a591b639f7 Fix handling of locked and proxy connections (#5938) 2019-11-15 11:10:04 +13:00
Kirk Scheibelhut
d62a2d9c69 Introduce /modchatnext command (#5934) 2019-11-12 11:37:37 +13:00
Guangcong Luo
411afba392 TypeScript Announcements/Poll chat plugins 2019-11-11 02:13:48 +13:00
Guangcong Luo
c40a7d2fb2 Allow broadcastable commands in command console
Command consoles previously would silently fail if you used a
broadcastable command (like `/dt` or `/learn`). They are now let
through, although actually trying to broadcast (like `!dt`) will
still show an error message.
2019-11-11 02:13:48 +13:00
Astrid Halberkamp
958f79125c
New translations and stuff (#5921)
* Add more command translations

* and some of the one i forgot

* More of the string i forgot

* newline

* Update hindi.json
2019-11-10 13:31:11 +01:00
Astrid Halberkamp
a3244a7449
Fix URL detection in usernames 2019-11-10 13:23:11 +01:00
HoeenHero
6bf6c6596b Do not allow tickets to stay open for more than a day 2019-11-09 14:34:53 -05:00
Waleed Hassan
d4c2349923 Make config-loader return type Config (#5939) 2019-11-09 04:21:54 +10:30
Lusamine
68c0634a5b Update datacenters & ip-tools (#5937) 2019-11-07 17:41:10 +10:30
HoeenHero
e78155766d Tickets: Automate & improve various tasks
- Automatically request PM logs from users when possible in PM harrasment tickets.
- Add a button to check a reported user's global modlog to all tickets.
- Add buttons for force-renaming/clearing the status of a user in inappropriate name/status tickets.
- Add a button for checking shared battles between a the reporter and reported user for battle harrasment tickets.
- Other minor improvements.
2019-11-06 10:27:59 -05:00
HoeenHero
d13a981fea Tickets: Don't active tickets when they are claimed 2019-11-06 10:27:58 -05:00
Waleed Hassan
92b2c128c2 Upgrade to TypeScript 3.7 (#5935) 2019-11-06 23:02:36 +10:30
Spandan Punwatkar
b3017da7d1 Fix movesearch bug with "lowers" (#5933) 2019-11-06 05:17:24 +10:30
whales
50c44fa822 Update mafia data 2019-11-04 12:17:36 +10:30
PartMan7
cef911f215 Add /scav addhint to help (#5928)
* Add /scav addhint to help

* Fix order

Moved requirements to end of line
2019-11-03 21:15:47 +01:00
whales
b9d758b473 Add a couple more letters to the evasion filter 2019-11-02 15:37:52 +10:30
Lusamine
e17ab3670d Allow trusted users to bypass blacklist/roomban if not directly punished (#5925) 2019-11-01 19:52:50 +10:30
whales
22283e8c95 Add a letter to the evasion filter 2019-11-01 18:31:58 +10:30
Lusamine
684b03e2f3 Allow /blockpms to block locked and semilocked users (#5923) 2019-11-01 13:34:52 +10:30
Astrid Halberkamp
c1a50bf0e0 Chat monitor: Improve filter evasion lock modlog message# Please enter the commit message for your changes. Lines starting 2019-10-30 20:04:56 +01: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
Astrid Halberkamp
a09be2cadb Poll: make /poll display the poll instead of help
Requested, consistent with other commands
2019-10-29 20:08:41 +01:00
Astrid Halberkamp
65e9b7037e TOTD: refactor to improve loading 2019-10-29 20:06:38 +01:00
Lusamine
945fb28bdf Update help for newer blockpms options (#5917) 2019-10-30 01:04:18 +10:30
TheMezStrikes
b0176ab926 Update CAP samples (#5918) 2019-10-30 01:03:47 +10:30
whales
51e632975c Implement /sharedbattles for finding shared battles (#5906) 2019-10-30 01:03:31 +10:30
Lusamine
a1fe7d3fc9 Update datacenters and IP-tools (#5915) 2019-10-27 16:25:24 -04:00
Astrid Halberkamp
1453f635f9 Don't make battle filters work in names and statuses 2019-10-27 19:56:53 +01:00
Astrid Halberkamp
ef2b1e3afc Make battlefilter not work for challenge battles 2019-10-27 18:27:58 +01:00
whales
0c1e108739 Mafia: Fix mistake in data 2019-10-26 23:46:20 +10:30
TheMezStrikes
9a4b23ca7e Don't escape HTML for tour names (#5911)
The client already does this, and doing it twice causes `[Gen 7 Let&apos;s Go] OU Single Elimination Tournament!` this, which doesn't seem necessary
2019-10-26 15:25:10 +10:30
TheMezStrikes
5592e8e518 Make /events view visually match /events (#5727)
* Make /events view visually match /events

Lack of consistency was bothering me

* This is why I shouldn't code when I'm sick

* Generalize formatEvent to function

I'm just going to pretend this code is good

* Update room-events.js
2019-10-25 13:04:53 +02:00
Aurolux
4fcc8535c3 Modnote Tours Player Count Upon Start (#5863)
* Modnote Tours Format and Player Count Start

* Fix Trailing Whitespace on line 610

* String Interpolation Injects Integers Too

No need for a method to change the Integer's type to String

* Add a Private Modaction

* Simplify modnote to just player count

* Update server/tournaments/index.ts

Co-Authored-By: Guangcong Luo <guangcongluo@gmail.com>

* Change CommandContext Element to output

Co-Authored-By: Guangcong Luo <guangcongluo@gmail.com>

* Shorten Modlog Entry
2019-10-25 11:49:26 +02:00
Lusamine
a72713f34c Add information about permalocks in help tickets (#5910) 2019-10-24 22:02:21 -04:00
HoeenHero
e9cf821363 Staff closing inactive tickets shouldnt get credit
Closing an inactive ticket indicates that there was no communication
between the user and staff, do not credit a ticket to the staff member.

Also fixes an issue with a error message for closing tickets with a
negative result that were already closed.
2019-10-24 12:57:21 -04:00
HoeenHero
b2a1b395f6 Allow the input log to be re-requested
One issue I ran into this morning was a player not being in the battle
when the log was requested or leaving and then rejoining the battle
after the log was requested. In these situations, the player cannot
see the export request button. This allows the requester to re-send
the request message + button to the players who have not allowed
the input log to be exported yet.
2019-10-24 10:47:02 -04:00
Astrid Halberkamp
2749a731cc
Fix a tiny but huge mistake in filter counting 2019-10-24 08:54:29 +02:00
Astrid Halberkamp
983c650db5
Fix counting hits on filters 2019-10-24 08:48:04 +02:00
Astrid Halberkamp
187a0e6c1b
Log filter changes in upperstaff 2019-10-24 08:46:05 +02:00
Astrid Halberkamp
7ba8d17fa1
Chat Monitor: Better messages for users getting caught 2019-10-24 08:41:40 +02:00
Kirk Scheibelhut
d0f3e711d1 Add chp as an alias for checkpunishment
https://www.smogon.com/forums/threads/add-cp-as-an-alias-for-checkpunishment.3655673/
2019-10-23 17:58:42 -07:00
whales
5d353ec7f8 Mafia: Automatically refresh HTML room lynches (#5891) 2019-10-23 09:13:45 -04:00
whales
3127bd57c4 Filters: Hopefully prevent some false evasion positives (#5907) 2019-10-23 12:18:01 +02:00
Guangcong Luo
78e4d3945b Fix Nidoqueen egg move validation 2019-10-23 13:58:50 +10:30
Astrid Halberkamp
971f028742 Show the actual match to users in battlefilter 2019-10-21 20:11:56 +02:00
Ben Davies
21ce0229f4 Convert messages to Unicode NFKC in filter (#5905) 2019-10-21 20:47:49 +10:30
Astrid Halberkamp
8760b8526f
Allow multiline input of filters 2019-10-21 10:59:10 +02:00
Waleed Hassan
28e870c4fb Server: Use readonly where appropriate (#5902) 2019-10-21 16:12:32 +10:30
Waleed Hassan
c88dfba1d1 Server: Reorganize TypeScript globals (#5903) 2019-10-21 14:39:59 +10:30
Astrid Halberkamp
6709245131 Improve staff room message for evader detection 2019-10-21 01:15:34 +02:00
Astrid Halberkamp
d420306577 use inline code for filter evasion lock messages to clearly show formatting 2019-10-21 01:07:07 +02:00
Lusamine
6785111e32 Update datacenters & ip-tools (#5901) 2019-10-20 20:42:45 +10:30
Guangcong Luo
422f210a6f Suppress eslint error 2019-10-20 17:32:52 +10:30
Astrid Halberkamp
8234802229 Improve filter evasion detection 2019-10-20 01:29:06 +02:00
Astrid Halberkamp
c40e82de16 Just don't filter duplicate letters 2019-10-20 01:25:22 +02:00
Astrid Halberkamp
d1a83a2903 Give leaders filter perms 2019-10-20 01:24:26 +02:00
HoeenHero
71745a047c Tickets: Only display PM log button when a user is reported 2019-10-19 08:30:24 -04:00
Lusamine
d6e85926ef GP help ticket messages (#5897) 2019-10-19 18:50:41 +10:30
HoeenHero
b5d8f8e9fe Help Ticket Improvements
- Remove ticket escalation because its not used.
- Simpliy report category to hopefully reduce the number of tickets opened in the wrong category.
- Improve ticket form interaction with namelocked users.
- Add a button to PM Harrasment ticket staffintros to allow staff to quickly request pm logs.
- - Only works when the reporter reports a user through their usercard.
2019-10-19 00:14:42 -04:00
Astrid Halberkamp
9d2e1c9e3d Don't lock for filter evaded names and statuses 2019-10-19 00:12:54 +02:00
Astrid Halberkamp
2b7ea3ec3f more false positive fixes 2019-10-18 23:14:31 +02:00
Astrid Halberkamp
2482389a81 Try to stop some false positives 2019-10-18 23:06:24 +02:00
Astrid Halberkamp
3344341a8d Fix oversights in filters 2019-10-18 22:29:40 +02:00
Astrid Halberkamp
a1d4b420cd
Refactor filters to always use regex (#5859)
* Refactor filters to always use regex

* Update server/chat-plugins/chat-monitor.js

Co-Authored-By: Kirk Scheibelhut <scheibo@users.noreply.github.com>

* Simplify evasion detection regex storage after peach rightfully pointed out how fucking stupid i am

* Put this garbage in adminlog if that room exists

* fix tslint
2019-10-18 21:19:39 +02:00
Guangcong Luo
09a49a12d2 Change ipbans.txt to lock instead
We no longer have a need to long-term ban IPs. In the long term, we
should actively rename ipbans.txt and figure out better solutions, but
for now, they should just be revised to lock instead of ban.
2019-10-18 14:37:22 +10:30
Lusamine
9d6fbdba41 Fix globalModlog modlogging twice in some cases (#5890) 2019-10-18 09:41:13 +10:30
whales
fa5f1389f8 Fix a few more userid -> id changes (#5886) 2019-10-15 18:20:58 +10:30
asgdf
b2d623de64 Fix typo in modlog entry of /tour forcetimer (#5884) 2019-10-15 08:44:12 +10:30
asgdf
edebcbc4a9 Support loading plugins from chat-plugins/private/ (#5867) 2019-10-14 11:11:37 +11:00
asgdf
c082ed478c Fix nameblacklist target auth check (#5882) 2019-10-14 11:00:39 +11:00
Lusamine
4497dce723 Update datacenters & IP-tools (#5880) 2019-10-13 19:28:35 -04:00
whales
4b4543b2a1 Fix typo in mafia help 2019-10-13 21:41:10 +10:30
asgdf
4b2e1a673e Automatically save replays for global warnings and autolocks (#5857)
* Automatically save replays for global warnings and autolocks

* Fix replay visibility for autolocks in hidden battles
2019-10-13 05:14:46 +11:00
asgdf
a702054881 Don't duplicate some mod actions in room modlogs (#5850) 2019-10-13 02:32:52 +11:00
SuddenlyQ
7ba7e0264d Add /pl as an alias to /punishlog (#5875) 2019-10-12 04:25:20 +02:00
TheMezStrikes
3178912a52 Trim all command arguments (#5865) 2019-10-11 05:32:07 +11:00
Guangcong Luo
41e7c57442 Support silently uploading replays
New `/savereplay silent` command, to upload a replay without a popup.
Intended to make auto-uploads less spammy.
2019-10-10 08:57:46 -04:00
TheMezStrikes
45728784f7 Fix typo to make multi-line adduhtml work (#5864) 2019-10-10 12:33:00 +02:00
Guangcong Luo
7d99c740f9 Fix crash in /coverage and /effectiveness
Also update /data with the correct fix.
2019-10-10 00:49:44 -04:00
whales
ea2dea1283 Rooms: Rooms.get can return null (#5860) 2019-10-09 18:52:33 +11:00
Guangcong Luo
2adc80efe4
Improve egg validator (#5854)
Previously, we split gen 2-5 egg move validation into two phases,
`checkLearnset` where we searched for a valid father, and
`reconcileLearnset` where we made sure the father could learn the move
combination.

Egg move validation has now been completely moved out of these
functions and into `validateSource`, which calls `findEggMoveFathers`.

The new algorithm no longer requires `C` moves to be hardcoded into
`learnsets.js`, now doing a more thorough check validation for the
father's move combination. This should be slower than before, but
net performance should be massively improved due to two other
optimizations in this refactor:

- We no longer do any father-searching if the moveset can be obtained
  any other way - in particular, this means no more father validation
  in gen 6+ where all egg move combinations are legal anyway.

- We only check fully-evolved pokemon as fathers (because anything a
  prevo can learn, its evos can learn, too - yes, we remember to make
  exceptions for Salazzle, Combee, and future-gen evos)

In addition, `/learn` should now provide significantly better
information for egg move breeding, since it uses a more thorough check
instead of the validator's short-circuiting the moment it finds a valid
father.

This also improves some baby-only move validation, specifically fixing
the issue with Seismic Toss Charm Chansey.
2019-10-09 00:59:24 +11:00
whales
c990e015db Remove hidetext abuse monitor (#5855) 2019-10-08 18:06:00 +11:00
Astrid Halberkamp
6e07bb1ad9
Add battle filter and evasion detection to chat monitor (#5842)
* Update chat monitor to include a battle filter, as well as evasion detection

* Forgot about the roomid rename thing

* Mitigate the first problem hopefully

* Mitigate the second problem in an extremely elegant way

* Precompile the substitutions

* Make this new filter not racist towards nigerians

* Totally not ghostwritten code because i'm really smart

* Small edit
2019-10-06 22:05:53 +02:00
Guangcong Luo
c1ecbc6522 Fix misc validator bugs
- Repealing rules now always works, regardless of rule order
  (Fixes AAA validation)
- Fix a check for egg move hidden ability validation
  (Fixes a Gen 4 Dragon Dance Charizard set)
- Always ban AG when banning Uber
  (Fixes allowing Rayquaza-Mega in lower tiers)
- Fix ability validation in Let's Go
- Fix valid-move-combo dexsearch
2019-10-06 17:21:01 +11:00
Guangcong Luo
71498d451d
New validator (#5840)
* Refactor validator

This is a major refactor intended to make the default rules easier to
understand, and also easier for OMs to bypass.

Removed rules:
- `Pokemon`: This is now `-Nonexistent`. Its previous name was intended
  to be interpreted as "simulate the Pokémon games exactly, and only
  allow what they allow". The new name should make it clearer that it
  mainly bans CAPs and other nonexistent Pokémon and functionality.
- `-Illegal`: This is now `Obtainable` (see below).
- `Allow CAP`: This is now `+CAP`. Instead of having a hardcoded rule,
  OMs can now be manually whitelist any pokemon/item/etc or group of
  them, overriding `-Nonexistent`.
- `Ignore Illegal Abilities`: This is now `!Obtainable Abilities` (see
  below).

`Obtainable` was previously `-Illegal`, and does the same thing: Makes
sure you have a regular Pokémon game with only Pokémon that can be
obtained without hacking.

But instead of being a ban, it's now a rule that does nothing by
itself, except contain more rules:
- `Obtainable Moves`
- `Obtainable Abilities`
- `Obtainable Formes`
- `Obtainable Misc`
- `-Nonexistent`
- `-Unreleased`

This allows OMs to piecemeal repeal and unban any of these individual
rules, instead of the previous approach of unbanning them all and
manually reimplementing every single validation you wanted to keep.

* Refactor PokemonSources into a class

This mostly just makes a lot of the weirder checks in the validator
substantially more readable.

This also renames `lsetData` to `setSources`, which should also help
readability.

* Validate Bottle Cap HP types

Fixes an issue reported here:

https://github.com/Zarel/Pokemon-Showdown/issues/5742#issuecomment-533850288

* Fix several move validation issues

Fixes #5742

We have a new MoveSource type: R for Restricted. R moves work like
level-up/tutor/TM moves, except you're limited to one R move.

- Shedinja move stolen from Ninjask in Gen 3-4 are now R moves instead
  of event moves. This allows them to coexist with Nincada egg moves.

- Necrozma-DW/DM now inherit moves/events from Necrozma (like Rotom,
  but with event validation). This allows them to be shiny.

- Pokemon can now get egg moves from their own evolutions. This fixes
  some Tyrogue, Charmander, and Treecko sets mentioned in #5742

- Some more C moves were added, fixing some Hitmontop and Chatot sets
  mentioned in #5742

* Improve ability/move compatibility validator
2019-10-06 04:21:30 +11:00
whales
d70b8d426e Helptickets: Fix bug in interface 2019-10-05 22:43:10 +09:30
Lusamine
3c8ced43af Update datacenters and IP-tools (#5849) 2019-10-05 14:53:21 +10:00
whales
fb469aa3df Fix crash in trivia 2019-10-05 12:10:07 +09:30
whales
d52e57eebd Prevent non-staff from seeing their own IPs (#5845) 2019-10-05 02:38:07 +10:00
HoeenHero
4342023900 Fix mistake in /avatar 2019-10-03 21:51:34 -04:00
HoeenHero
6d070af2c6 userid -> id in scavengers 2019-10-03 21:37:36 -04:00
HoeenHero
b62f7a3e1f Use null over false for nullable syntax 2019-10-03 19:57:53 -04:00
Kirk Scheibelhut
678e548c80 Fix linter errors
eslint:recommended seems tohave gotten more sensitive.
require-atomic-updates was disabled because "I think this is
intentional behavior because that someObj object was read before
await expression and written after await expression." is wayyy
to aggressive: https://github.com/eslint/eslint/issues/11899
2019-10-03 14:26:58 -07:00
HoeenHero
58e2b1dd37 Fix issue with hotpatching minor activities 2019-10-03 14:19:36 -04:00
HoeenHero
61b2d655f9 Fix bugs with promotion/demotion permissions 2019-10-03 13:30:43 -04:00
Spandan Punwatkar
c8873aeec9 Add Announcements (#5404)
(Announcements can't coexist with polls)
2019-10-04 01:21:38 +10:00
Guangcong Luo
cc42db1b5c Improve workaround for TypeScript Promise.all bug 2019-10-03 23:02:36 +10:00
Waleed Hassan
5607c158e4 Use void in promises to appease TSLint (#5827) 2019-10-03 19:08:30 +10:00
asgdf
bd6ac0f024 Prevent overzealous spead of locks under some circumstances (#5824) 2019-10-03 19:00:40 +10:00
Waleed Hassan
da4b887054 Rename Room#id -> Room#roomid, User#userid -> User#id (#5826)
These should make it clearer that userids are IDs but roomids aren't.
2019-10-03 18:57:38 +10:00
urkerab
948257cce7 Change weight units to hectograms (#5765) 2019-10-03 14:00:16 +10:00
whales
cdab768131 Properly give trusted users a 100ms throttle (#5839) 2019-10-03 01:53:22 +10:00
whales
ba47b1ba61 Give trusted users a 100ms chat delay (#5838)
Down from 300ms for global auth
2019-10-03 01:21:29 +10:00
asgdf
f4fff94e2e Fix informational link for Snatch/Mirror Move (#5834) 2019-10-02 16:24:08 +04:00
ZestOfLife
69bd7ced2a Mafia: Fix IDEA data (#5831) 2019-10-02 07:54:20 -04:00
HoeenHero
b055697237 Fix more typing in preperation for TS 3.7.0 2019-10-01 21:44:09 -04:00
HoeenHero
9a2c2adf82 Fix bad typing 2019-10-01 19:55:09 -04:00
fart
2e8949b740 Fix typo in banwords reply (#5833)
Correct spelling not succesful
2019-10-01 04:24:30 +02:00
Lusamine
5244315932 Remove "[unregistered]" label on forcerename messages; shorten reused name message (#5832) 2019-09-30 20:00:45 +02:00
asgdf
3648e575a4 Use global modlog for queries in help tickets instead of failing (#5822) 2019-09-28 11:38:40 +09:30
Lusamine
bab655fbf6 Update datacenters and IP-tools (#5823) 2019-09-27 17:00:52 +09:30
whales
31ead12588 Type Chat.tr properly (#5814) 2019-09-25 15:06:12 +02:00
Astrid Halberkamp
c02bd7c53f Chat: fix indentation
TODO: fix my VSC installation so this doesn't happen again
2019-09-25 13:29:35 +02:00
Astrid Halberkamp
35d9cb6ec6 Make canTalk() translatable
Thanks peach for figuring out the absolute hell of a type signature for Chat.tr
2019-09-25 13:27:38 +02:00
Astrid Halberkamp
487932f04d TOTD: rename atlotd -> athotd 2019-09-25 13:27:08 +02:00
Lusamine
fc887b33e0 Add missing spaces to unticketban and unbattleban modlogging (#5804) 2019-09-21 22:11:26 +09:30
Kirk Scheibelhut
e4f845972b Allow locked players to set modchat in battle (#5803) 2019-09-21 13:02:09 +09:30
Lusamine
4e80031a26 Fix ticketbans logging reasons (#5802) 2019-09-21 12:31:47 +09:30
Lusamine
ba1a7cdee7 Update datacenters and ip-tools (#5801) 2019-09-21 12:06:17 +09:30
whales
cdff583606 Fix blocking PMs (#5797) 2019-09-19 15:05:24 +09:30
ayiadvance
6e76cd87ce Mafia Dead List (#5717) 2019-09-18 11:45:39 -04:00
whales
21d494079d Show "access denied" for modjoined rooms (#5778) 2019-09-18 16:30:30 +09:30
Ben Davies
0a98132e1b Track connection times and log probable ghosts (#5768)
This logs connections that have been around for longer than a week,
every week.
2019-09-17 21:02:57 -07:00
HoeenHero
aac6ecf81b Fix issue with automatic ticket activation 2019-09-17 23:27:59 -04:00
whales
718096b680 Fix tickets with - in the title (#5792) 2019-09-18 09:49:33 +09:30
HoeenHero
05d3142aa2 Tickets: Use inputUsername when getting a ticket 2019-09-17 19:44:34 -04:00
HoeenHero
797e3d255c Empty ticket rooms should be marked as unresolved 2019-09-17 16:20:06 -04:00
HoeenHero
788a95aaa4 Tickets: pad close buttons for mobile & add a ticket stats button in the ticket list 2019-09-17 16:07:59 -04:00
HoeenHero
a5bbf3d0f8 Properly track ticket activations and unclaimed time 2019-09-17 15:49:57 -04:00
HoeenHero
010d2a8f43 Update ticket titles for stats 2019-09-17 14:16:54 -04:00
HoeenHero
7648ecfa4e
Record statistics for help tickets (#5574) 2019-09-17 13:29:16 -04:00
whales
4d9e87cd78 Support blockPMs ac / trusted (#5790) 2019-09-17 18:22:40 +10:00
whales
79507c5b2f Helptickets: Improve navigation (#5785)
- Strip metadata when returning to top
- Handle invalid queries more elegantly
2019-09-15 20:11:42 -10:00
Charlie Kobayashi
4b351ed8e9 Add more hunt management options (#5777)
* Add more hunt management options

- Hints: add a command to display hints that can be recalled using /scav hint and /viewhunt for hunts that last several hours.  This allows previously given hints to still be visible even after it scrolls out of chat, or the user uses /clear after completing some difficult param question.  This command cannot be used until after 10 minutes of the hunt.
- /scav status is enhanced to show users who have tried to guess in the last 5 minutes in bold (<strong> for you HTML purists)

This has been approved by all 4 roomowners.
2019-09-15 22:28:05 +02:00
Marty-D
6d48520345 IPTools: Update proxies 2019-09-15 15:15:54 -04:00
whales
e3238aa27b Fix typo in subroom command (#5783) 2019-09-15 01:38:21 -07:00
whales
56d2fdb19a Helptickets: Don't drop metadata when going back (#5784) 2019-09-15 01:37:43 -07:00
whales
000e162a09 Fix help tickets (#5782) 2019-09-15 01:21:16 -07:00
asgdf
320e92ab43 Linkify autoconfirmed alt display (#5779) 2019-09-15 01:20:36 -07:00
Ben Davies
a4dfc68526 Bump max room FAQ length to 8KB (#5719) 2019-09-15 06:30:33 +02:00
whales
2f0b8251ab Improve subroom checks (#5754) 2019-09-15 06:29:00 +02:00
whales
fc2c69eb99 Destroy groupchats on all global punishments (#5755) 2019-09-15 06:27:51 +02:00
TheJetOU
f51a1f3742 Add CommandContext method for Chat#(status)filter (#5737)
* Add CommandContext method for Chat#(status)filter

* Don't use instanceof
2019-09-15 06:25:54 +02:00
whales
b8114fbae0 Improve username punishments (#5743)
* Improve username punishments

Track how many times a name has been forcerenamed, note differently for offline warns and forcerenames

* Hyperlink names, show trusted/ac/registered

* rebase

* pseudorank -> accountstatus
2019-09-15 06:25:15 +02:00
Kirk Scheibelhut
55d39e5067 Support unlisted replays 2019-09-14 18:32:03 -07:00
Astrid Halberkamp
8abd02cdb5 Poll: Make quizzes less terrible for colorblind people 2019-09-15 02:51:15 +02:00
Astrid Halberkamp
32268b80bf TOTD: Add athlete of the day 2019-09-15 02:19:19 +02:00
Astrid Halberkamp
2dc82f154d Poll: add support for quiz questions using + in options 2019-09-15 02:19:18 +02:00
Astrid Halberkamp
ffa478a9a2 TOTD: add missing page 2019-09-15 02:19:18 +02:00
Astrid Halberkamp
75960ed966 TOTD: anime -> animanga 2019-09-15 02:19:17 +02:00
whales
83e442959b Mafia: Sort rolelist (#5780) 2019-09-14 17:01:38 -04:00
whales
29ad859b10 Helptickets: Show the user or room being reported (#5761) 2019-09-14 11:55:06 -07:00
whales
561dd2211c Fix editbattle for field state (#5776) 2019-09-13 04:12:53 -07:00
Guangcong Luo
fb6bb28bb1 Fix whitespace issue in #5772 2019-09-13 02:48:39 -07:00
fart
7af0d8ad77 Add IP lookup link to /alts (#5772) 2019-09-13 02:46:19 -07:00
Lusamine
8c87c50917 Improve clearstatus modlog message (#5775)
- Fix spacing in clearstatus modlogging
- Add quotes around the bad status
2019-09-13 02:39:13 -07:00
Kirk Scheibelhut
4acede6ed6 Add missing gen2 trainer sprites 2019-09-11 20:59:47 -07:00
Astrid Halberkamp
02a04e7c2e TOTD: add anotd for the anime and manga room 2019-09-11 17:28:13 +02:00
Astrid Halberkamp
315d5eb156 Make /busy do /blockpms + by default 2019-09-11 17:28:13 +02:00
Jeremy Piemonte
985caee5ff Blackjack: Fix spacing typo in forceend modlog (#5721) 2019-09-10 22:59:56 -07:00
Ben Davies
59314bc69e Remove a line in /cmd userdetails that's no longer necessary 2019-09-08 23:40:13 -03:00
Ben Davies
190ace0902 Fix typo in edge case in /cmd userdetails 2019-09-08 23:38:22 -03:00
Ben Davies
75df03c35a Make a couple improvements to /cmd (#5766) 2019-09-08 21:52:31 -04:00
TheJetOU
f2783c642d Add a RoomID type (#5759) 2019-09-07 14:15:27 -05:00
whales
52a5312550 Fix bug in IPTools#testConnection (#5763) 2019-09-07 02:03:09 -05:00
Lusamine
b69a7800d4 Update IPTools and datacenters (#5762) 2019-09-06 20:33:51 -04:00
TheJetOU
cc333f4fdf Improve Lottery (#5748)
- Anyone can now see the amount of participants
- Max winners can't go above `Number.MAX_SAFE_INTEGER`
- `/lottery edit` can be used to edit the lottery
- "Page unavailable" is not shown to guest users, instead the not "allowing guests to join" is deferred to `/lottery join`.
- Punished users are dropped before generating winners
2019-09-06 10:19:42 -04:00
Ben Davies
3eb70cdd90 Update the server WRT SockJS desktop client fix (#5757) 2019-09-04 14:54:11 -05:00
whales
4d556c8fd8 Fix modlog entries for autolocks in groupchats (#5753) 2019-09-04 02:01:49 -05:00
Ben Davies
2e586e0a58 Update the server WRT client connection timeouts (#5751)
* Remove the new xhr-streaming ghost connection hack

Once the client uses timeouts, this is no longer necessary.

* Update SockJS client to v1.4.0

This fixes an issue where it would attempt to parse the entire HTTP
response received as JSON, not the response's body alone.
2019-09-03 21:32:06 -05:00
asgdf
5b2f993b12 Fix some small oldgens dexsearch issues (#5750)
* Fix searching by BST with /ds1

* Use gen-appropriate type effectiveness in /ds
2019-09-03 09:58:54 +04:00
HoeenHero
44dcede8ff Fix crash in alts 2019-09-01 14:10:58 -04:00
Kirk Scheibelhut
f936d9d4be Remove extra <br /> in lottery display
This seemed desirable in tested, but probably because I hadn't
refreshed. Also, the creator can wrap their content in a div and
give it a margin-bottom.
2019-08-31 22:19:36 -07:00
Kirk Scheibelhut
92d0df80d9 Tweak lottery page display
Center header/button/results when there's a lottery taking place.
2019-08-31 22:07:49 -07:00
Guangcong Luo
7e58790121 Fix bugs when logging out during a RoomGame 2019-08-31 10:50:00 -05:00
TheJetOU
e476279ba5 /showpunishments: Fix sorting (#5741)
(Thanks to @DaWoblefet for the report)
2019-08-30 13:02:15 -05:00
whales
71f4c020c1 Show trusted status is whois (#5740) 2019-08-30 09:46:57 -05:00
whales
16551a7c5c Typescript lottery (#5739) 2019-08-30 09:12:49 -05:00
whales
e949471403 Fix indirect punishments (#5738) 2019-08-30 08:46:38 -05:00
whales
b15dd2a528 Typescript punishments (#5728) 2019-08-29 19:46:42 -05:00
Ben Davies
166efd79d9 Fix typo in IPTools 2019-08-28 19:20:01 -03:00
TheJetOU
79c42ccac4 Lottery improvements (#5736)
- Fix typos in help command
  - Link lottery in declare message
  - Don't delete lotteries when ended
  - Remove useless if-cond checks
2019-08-27 19:56:14 -07:00
TheJetOU
54db9e2ebb Fix missed Rooms() (#5735) 2019-08-27 21:44:01 +02:00
whales
f143d83a67 Refactor Chat to a big class (#5729) 2019-08-27 08:08:33 -07:00
whales
ba328099d2 Remove Tournaments.tournaments map (#5734) 2019-08-27 07:34:19 -07:00
HoeenHero
bb7dde3b93 Make tournaments not break when hotpatched
It might be wise to refactor this to not use a standalone
tournaments object later.
2019-08-26 15:12:30 -04:00
Ben Davies
ae023212b5 Clean up sockets on process exit too, not just process disconnect
Sometimes when the server gets killed, the TCP closing handshake on
sockets currently open never actually gets completed, screwing with
things like bots that don't implement keepalive/timeouts of any kind.
2019-08-26 15:20:07 -03:00
TheJetOU
620fd82376 Add lottery plugin (#5722) 2019-08-26 09:56:01 -07:00
Ben Davies
dc5a26a347 Remove old hack for xhr-streaming connections
This was actually closing open connections instead.
2019-08-25 13:13:32 -03:00
TheJetOU
2b28c9fd6b Refactor Rooms(), Users() to Rooms.get(), Users.get() (#5725) 2019-08-25 06:33:56 -07:00
whales
2a776b78ad Display a specific message for forcetrusted user's auth (#5731) 2019-08-25 05:05:21 -07:00
Jeremy Piemonte
9a2b2fed90 Allow non-ac users to send links in help tickets (#5726) 2019-08-25 05:04:28 -07:00
whales
3e7b30dbda Fix lint errors in tournaments (#5730) 2019-08-25 04:17:47 -07:00
TheJetOU
7fe2e5338c TypeScript Tournaments (#5723) 2019-08-24 03:48:13 -07:00
whales
043b011f76 Improve hidetext permissions (#5724) 2019-08-24 03:44:49 -07:00
Guangcong Luo
e0a2cf07e1 Correctly define global types for .ts files
Global types are defined differently for `.ts` files than for `.js`
files, leading to some confusion for past refactors.

This commit defines them correctly.

I'm also considering making certain global types only available under
namespaces, but I don't want to do that to `User` or `Room`, so for
now, there are no changes there, besides putting streams in the
`Streams` namespace (so `WriteStream` is now `Streams.WriteStream`).
2019-08-23 09:33:49 -07:00
ayiadvance
461583ee48 Role Clarifications in /mafia dt (#5705)
Created distinctions between:
Role Cop and Role Cop (Classic)
Red Goo and Red Goo (Cracking Idea)
Neapolitan and Vanilla Cop

Also clarified some roles and standardized how Idea Variant roles are listed.

Added a distinction between Silencer and Silencer (Greater Idea) and between Grey Goo and Grey Goo (Cracking Idea). Also added the (xxx Idea) tag to the roles in their respective ideas.
2019-08-23 07:40:07 -04:00
whales
ffcdadf3bb Mafia: Implement forced selflynch, disabling hammer (#5718) 2019-08-23 07:35:29 -04:00
HoeenHero
7bbec56c33 Allow moderators to view room faq sources 2019-08-20 15:54:58 -04:00
Guangcong Luo
35b0fc1593 Add missing BW2 avatars
Added:
- nate-dueldisk
- rosa-dueldisk
- bianca-pwt

We only had dueldisk versions before, so they've been swapped for their
regular avatars (previously, `nate` was the duel disk version, now, it's
the normal version, and `nate-dueldisk` is the duel disk version).

In addition, wally-gen7 has been removed - it was a duplicate of the
normal wally.
2019-08-20 06:26:54 -04:00
Guangcong Luo
2cf9f6d233 Add fan-made Gen 7 avatars from Beliot419
(Also pixelate the "avatar changed" message.)
2019-08-19 23:39:06 -07:00
TheJetOU
8f02f0aab8 Revert "Add margin in helptickets (#5713)" (#5720)
This reverts commit f128b74276.
2019-08-19 11:40:39 -07:00
supermii2
c48ca2c8c5 Add mirror flag to movesearch. (#5716) 2019-08-18 15:59:02 +02:00
whales
7eee6b3489 Fix URL for snatch and mirror dex lists (#5715) 2019-08-18 09:12:48 -04:00
Jeremy Piemonte
5beddaa839 Blackjack: Various improvements and bug fixes (#5714)
- Ensure the first card of the dealer is on the top of the turnlog
- Don't allow people to use the command to start the game if the game has already started
- Use user names instead of user ids in the initial playerlist for join messages
- Modlog conditionally if the game was ended forcibly or not
2019-08-17 22:18:39 -07:00
TheJetOU
f128b74276 Add margin in helptickets (#5713) 2019-08-17 20:50:13 +02:00
supermii2
29655db703 Add descriptions for charge/recharge moves in /dt (#5712)
Charge moves and Recharge moves will have a tag when using /dt, similar to other tags like "Supressed by Gravity"
2019-08-17 10:37:02 +02:00
supermii2
5c45b6dca0 Added various flags to movesearch (#5707)
- added flags for charge, gravity, recharge and reflectable
2019-08-16 22:47:40 +02:00
RyotaMitaraiWeb
ee0575a6f3 Minor typo fix in /itemsearch help (#5709) 2019-08-16 21:57:32 +02:00
TheJetOU
f4e6fd7584 Implement a /showglobalpunishments command (#5703) 2019-08-15 20:25:30 +02:00
Bär Halberkamp
1728d8b24a fix an oversight in my previous commit 2019-08-15 19:36:06 +02:00
Bär Halberkamp
e756e74293 Fix exploit allowing filter evasion using forcepromote 2019-08-15 18:50:50 +02:00
Kirk Scheibelhut
8c49d0c164 Auto-accept challenges from challenge target (#5706) 2019-08-14 13:38:22 -07:00
TheJetOU
5597916644 TypeScript Rooms and Roomlogs (#5699) 2019-08-14 20:44:57 +02:00
TheJetOU
edc7d43a80 Refactor /(allow)exportinput log (#5456) 2019-08-14 09:59:01 +02:00
Nol
e016f6defa Fix typo when game of blackjack is ended (#5704) 2019-08-13 15:07:27 -07:00
ayiadvance
76af6c5a12 Updated /intro (#5698) 2019-08-13 14:49:02 -07:00
TheJetOU
3c3d897b92 Move JSDoc comments from assignment to declaration (#5701)
This makes IntelliSense show the JSDoc comment.
2019-08-13 17:25:29 +02:00
TheJetOU
f586e88326 Simplify Map declarations (#5702) 2019-08-13 17:23:27 +02:00
RyotaMitaraiWeb
239d354adf Update a link in the /intro command (#5697) 2019-08-12 16:09:30 -04:00
Kirk Scheibelhut
9ab3f5a668
Make /hotpatch fail if git history hasn't changed (#5688)
/forcehotpatch can be used to perform the hotpatch regardless.
2019-08-12 10:23:24 +02:00
TheJetOU
4f7ad0132b TypeScript Ladders (#5696) 2019-08-12 09:48:18 +02:00
TheJetOU
e988e2b83a Don't clear player.userid upon unlinking (#5695) 2019-08-12 09:27:46 +02:00
TheJetOU
af93684d5e Fix Chat#collapseLineBreaksHTML 2019-08-11 11:03:35 -05:00
TheJetOU
16124e556d Import Chat correctly (#5693) 2019-08-11 17:24:31 +02:00
TheJetOU
4b0be1b5b4 TypeScript RoomGame and RoomBattle (#5692) 2019-08-11 17:03:36 +02:00
TheJetOU
3d18ab84a5 TypeScript Monitor (#5691) 2019-08-11 13:36:08 +02:00
whales
10266ffe92 Typescript chat (#5620) 2019-08-10 15:30:34 -07:00
whales
a04f3dc7ad Rework enabling mafia to be more like other chatgames (#5689) 2019-08-10 16:59:54 -04:00
whales
9b43bf4448 Set prevUsers properly when merging (#5690)
* Set prevnames properly when merging

* change param order

* rename, again
2019-08-09 17:57:44 -07:00
Guangcong Luo
5bd2c87190 Properly clear timer in nextRequest 2019-08-09 13:27:01 -07:00
Jacob McLemore
91f81460cb Scavengers: Add Recycled Hunts functionality (#5666) 2019-08-09 09:33:21 +02:00
Quinton Lee
24e01843d2 Tournaments: Always enforce scouting setting (#5671)
Previously players were able to join battles as soon as they ended
2019-08-08 21:05:39 -07:00
whales
90babd72b9 Fix disabling mafia (#5686) 2019-08-08 21:04:41 -07:00
Bär Halberkamp
3a278dd2a8 First batch of commands to make translatable 2019-08-09 02:53:11 +02:00
whales
0dd9e0813f Separate add and regexadd in /banword (#5687) 2019-08-08 14:26:18 -07:00
TheJetOU
e212330126 Track turns in RoomBattle (#5685) 2019-08-08 14:22:47 -07:00
Guangcong Luo
cf96a48347 Fix first-turn timer with Config.forcetimer
Fixes #5683
2019-08-07 13:26:09 -07:00
Guangcong Luo
021eb56f4f Fix dc messages appearing after battle end 2019-08-07 13:26:08 -07:00
Guangcong Luo
cb746524c1 Fix turn limit for tying games 2019-08-07 13:26:07 -07:00
Guangcong Luo
03c642b7d6 Default to not reporting joins in modchat 2019-08-07 13:26:07 -07:00
Jeremy Piemonte
83bb9a3180 Implement blackjack game (#3726) 2019-08-06 20:23:08 +02:00
Kirk Scheibelhut
7639b59c21
Improve /hidereplay privacy (#5678)
- hide the room as well so that it doesnt show up in a user's trainer card and end up auto-linking to replays
- upload a replay after the game to ensure the hidden setting is properly written
2019-08-06 11:04:16 +02:00
maxalexandderpi
54a4baedaf Let users see who made a hangman/poll (#5680) 2019-08-05 23:59:59 -05:00
Guangcong Luo
00184f61b2 Fix modchat permission check
It was interacting badly with the new code to give drivers moderator
permissions in battles.
2019-08-05 17:23:26 -05:00
Guangcong Luo
9423ce942c Support saving replays for punishment
`forpunishment` replays are saved as "private", but with no URL-guessing
protection, so staff looking for punishment logs can still find them.
2019-08-05 17:37:19 -04:00
whales
912449e056 Fix potential crash in allowexportinputlog (#5677) 2019-08-05 15:46:29 +02:00
Kris Johnson
368cce2be6 OM: Add /crossevolve command for Cross Evolution (#5673)
* OM: Add a crossevolution command

* oops

* Add /crossevolve command for Cross Evolution
2019-08-05 12:13:14 +04:00
whales
9b222862c5 Send updateuser when changing status type (#5675) 2019-08-05 09:56:54 +02:00
whales
2336659432 Fix self idle display on merging (#5674) 2019-08-05 09:42:19 +02:00
whales
188d8b8c85 Automatically consent to extracting your own battlelog (#5672) 2019-08-04 23:06:07 -05:00
Marty-D
3ab1db925c
IPTools: Update proxy list 2019-08-04 11:42:05 -04:00
Slayer95
2989e653dd
Info: Fix target validation in /host 2019-08-03 23:26:05 -05:00
Kirk Scheibelhut
7f4dd13aec Update /punishlog tags 2019-08-03 12:52:27 +02:00
Kirk Scheibelhut
e8b3343ba4 Add MAFIAHOSTBAN to punishlog
Mafia specific, but still enough of a punishment to perhaps be
useful when viewing a user's punishment history.
2019-08-03 12:35:43 +02:00
Kirk Scheibelhut
3021826112
Have /hidereplay turn on /modjoin % once the battle is over (#5667) 2019-08-02 22:19:33 +02:00
Bär Halberkamp
d128ca8b9f Thing of the day: no longer rely on uhtmlchange making new htmlboxes 2019-08-02 00:45:10 +02:00
Bär Halberkamp
25de7934a6 Thing of the day: Tweak how pre-noms work 2019-08-01 22:48:59 +02:00
whales
2eaed9105d Update status properly on merging (#5663) 2019-08-01 13:56:43 +02:00
Kirk Scheibelhut
d02079c0b9 Don't apply getBattles skip logic if usernameFilter is set 2019-08-01 12:41:36 +02:00
TheJetOU
a12496e97b Allow filtering by userid prefix in battle search (#5662) 2019-08-01 10:20:18 +02:00
Kirk Scheibelhut
4326aeae04
Add forcedpublicprefixes for public OLT battles (#5661) 2019-08-01 09:28:48 +02:00
HoeenHero
e5b575f950 Implement Chat.stripFormatting (#5658)
Strips chat formatting from a string.
This is used for properly validating the length of room faqs
and daily spotlights.
2019-08-01 00:08:11 -05:00
Quinton Lee
c544514d67
Chat monitor: fix removing filtered shorteners 2019-07-27 13:34:40 -05:00
HoeenHero
f3d04f09cd Allow mods to create, edit, and remove room faqs
Also makes room faq topics in /roomfaq clickable.
2019-07-26 20:30:21 -04:00
HoeenHero
a67be91f27 Make uptime avaliable to regular users
This command was originally restricted because users would complain
about lag when the uptime hit about a week. I'm removing this because
it makes it alot harder to verify a server's uptime meets the
requirements when registering servers, and its been a year or so
since lag complaints related to uptime were an issue.
2019-07-26 08:11:53 -04:00
HoeenHero
eb80893c58 Inap username/status tickets shouldn't start activated
Also updated some ticket form text and added "help" to the list of phrases that will not active a ticket.
2019-07-26 08:06:54 -04:00
whales
93ab00e173 Fix kaomoji canTalk checking for real 2019-07-24 20:11:01 -05:00
whales
3499df5b38 Check canTalk properly in kaomoji (#5655) 2019-07-24 17:39:02 -05:00
HoeenHero
5659b628a3 Prevent most commands from being used with kaomoji commands 2019-07-24 11:00:29 -04:00
Ben Davies
29b06abce1 Add a few kaomoji commands (#5645)
This adds /shrug, /tableflip, and /tableunflip.
2019-07-22 20:21:35 -05:00
whales
b06d638b6e Fix username report tickets (#5642) 2019-07-22 12:58:57 +02:00
Guangcong Luo
a3ba27ba8f Improve modchat
- Modchat permission code should be simpler now
- Mods now have 'modchatall' (can set modchat up to their own rank)
- 'modchatall' (ROs) can no longer remove modchat higher than their own
  rank
- 'makeroom' (Leaders) still can remove higher modchat
2019-07-20 08:53:16 -05:00
Guangcong Luo
dd6ce3c2dd Give sysops isStaff
This fixes a situation where sysops couldn't see the results of
commands they used.
2019-07-20 08:53:15 -05:00
Guangcong Luo
8313f6a825 Properly give gdrivers roommod powers
The previous solution had some rough edges, like accidentally
knocking global leaders down to roommod.

This also restores the corresponding symbols, for better clarity.
2019-07-20 08:50:59 -05:00
Kirk Scheibelhut
21cd5cf02c Actually ACTUALLY prevent Idle state from propagating 2019-07-19 09:31:19 -07:00
Kirk Scheibelhut
ba4e0254d8 Actually prevent Idle state from propagating 2019-07-19 09:03:27 -07:00
asgdf
97a42995db Add easy method of undoing /trustuser (#5631) 2019-07-19 10:40:19 -05:00
Kirk Scheibelhut
c43e2557f0 Prevent Idle state from propagating (#5630) 2019-07-18 21:12:39 -05:00
Kirk Scheibelhut
b0a7b61693 Include status message in helpticket messaging (#5626) 2019-07-18 13:51:26 -05:00
Kirk Scheibelhut
37ba36b2da Remove Idle popup (#5622)
This was originally added in the original design when we were
actively logging Idle users out of their account. Currently it
serves mostly to explain what Idle is, but mostly it just annoys
users.
2019-07-17 12:19:39 -05:00
whales
94bb4084d5 Typescript users (#5617) 2019-07-16 19:22:38 -07:00
Guangcong Luo
0cc534092a Support timer rules 2019-07-16 16:03:02 -05:00
Guangcong Luo
bee09145e8 Fix Scuntorpe Problem in status monitor 2019-07-16 13:52:21 -05:00
Guangcong Luo
47f9372d2a Clear timer after battle end
This should fix the bug where timer messages would sometimes still
show up after the end of the game.
2019-07-16 11:10:53 -05:00
Guangcong Luo
6c3db44ee5 Implement OU (Blitz) format 2019-07-16 08:17:06 -04:00
asgdf
1f2a17e5d1 Support ohko flag in movesearch, update helptext (#5614) 2019-07-15 22:17:23 -05:00
whales
45c0777ed6 Fix tour replacing for real (#5613) 2019-07-15 20:54:42 -05:00
fart
77e054d96c Fix /coverage bug (#5611) 2019-07-15 20:48:42 -05:00
whales
97cba5a732 Fix alt checking for tour subs (#5612) 2019-07-15 20:48:05 -05:00
Guangcong Luo
d209bcc8f3 Fix crashes in modlog 2019-07-15 21:47:09 -04:00
Kirk Scheibelhut
632de55431
Create Chat.statusfilter which also performs basic rank impersonation filtering (#5610) 2019-07-15 13:59:33 -07:00
Kirk Scheibelhut
8b82693168 Add /help documentation for /tour sub 2019-07-15 11:46:34 -07:00
Guangcong Luo
c2a35ff868 Optimize getIdentityWithStatus
Most of the return value is never used.

(Also fix bug with statuses containing `,`)
2019-07-15 12:33:21 -05:00
whales
82a666cc0e Fix tour format reporting (#5609) 2019-07-15 11:22:13 -05:00
whales
551bc33b30 Stop status desyncing when joining rooms or renaming (#5608) 2019-07-15 10:12:23 -05:00
Guangcong Luo
b7e94c1da3 Fix crashes in chat commands 2019-07-15 10:58:09 -04:00
whales
257cea4d62 Fix status in userdetails (#5607) 2019-07-15 09:56:40 -05:00
whales
8ad6c9246f Don't report name after forcerename for namelocked users (#5583) 2019-07-15 00:57:29 -05:00
Guangcong Luo
22ca01123d Refactor tournaments for better prop names
- `tour.originalFormat` -> `tour.baseFormat`
- `tour.teambuilderFormat` -> `tour.fullFormat`

These should better reflect what they actually mean.
2019-07-15 00:35:31 -05:00
whales
9147863403 Tournaments: Support replacing players (#5600) 2019-07-15 00:07:37 -05:00
whales
e918287cd6 Allow starting tournaments with a custom name (#5604) 2019-07-15 00:04:49 -05:00
Guangcong Luo
cb858bce1b Add sonic.net to residential ISP list 2019-07-15 00:23:07 -04:00
Guangcong Luo
a2f9a9191e Add 'ok' to Help tickets content-free message list 2019-07-15 00:23:07 -04:00
Guangcong Luo
315dd3999f Disallow ties before turn 100 2019-07-15 00:23:07 -04:00
HoeenHero
2677443ba4 Prevent users from being added to battles they are already in 2019-07-14 23:57:54 -04:00
Kirk Scheibelhut
951c582fe3 Add support to local /laddertop for restricting by user prefix (#5606) 2019-07-14 22:25:35 -05:00
Marty-D
80da1aa377
IPTools: Update proxy lists 2019-07-14 21:29:53 -04:00
Bär Halberkamp
49d4b5abd2 Refactor statuses into statusType and userMessage (#5597)
(and improve persistence)
2019-07-14 20:22:02 -05:00
TheJetOU
3c8b4f6872 Tournaments: Fix crash in /tournament cap (#5605)
`note` in this.modlog expects a string.
2019-07-14 17:46:39 -04:00
Guangcong Luo
56565e9d21 Support treating a rank as another rank in battles
This adds a Config setting, `globalGroupInPersonalRoom`, which will
just straight-up let global drivers act as mods in battles and
groupchats.

Fixes #5564
2019-07-14 01:33:58 -05:00
HoeenHero
b4f95342a4 Properly handle multiline modlog messages 2019-07-13 11:09:32 -04:00
Guangcong Luo
2f15e1559c Add documentation for /adddatacenters 2019-07-12 23:52:34 -05:00
Ben Davies
ed4b97a110 Allow bots to set statuses in the global room (#5596)
This makes it easier to automatically set the status on connect. Instead
of making it so users can't set their status if they can't talk at all,
make it so they can't set it if they're locked or semilocked.
2019-07-12 16:43:55 -05:00
whales
934a6cd246 Mafia: Implement silences (#5584) 2019-07-12 07:40:22 -04:00
Guangcong Luo
f8c06f9ef7 Require <style>/<script> tags to be closed 2019-07-11 04:24:14 -05:00
TheJetOU
ade29349c6 Send Elo rating in rated battles (#5595) 2019-07-11 02:38:49 -05:00
TheJetOU
0663bb66d0 Refactor punishments (#5599)
- splits `keys` into `userids` and `ips`
- explicitly lists the `reason` and `expireTime` columns in functions that don't use them
2019-07-09 18:36:50 -05:00
Ben Davies
d4c479686c Use dns.lookup over dns.resolve4 in IPTools.dnsblQuery
This helps prevent DNS poisoning attacks if the platform supports DNSSEC
since dns.resolve4 uses c-ares, which doesn't support DNSSEC.
2019-07-08 21:39:44 -03:00
whales
729144606e Prevent /groupchatuptime from being used without a room (#5592) 2019-07-06 14:24:33 -05:00
whales
2ad511fd24 Filter statuses properly (#5593) 2019-07-06 05:24:01 -05:00
Guangcong Luo
4d80d4b1a9 Use nicknamefilter for status messages
Namefilter is a complete mismatch for status messages, since names
have very specific requirements that don't apply to status messages.
Nicknames have no such restriction, and work basically the same as
status messages.
2019-07-06 03:49:46 -05:00
Ben Davies
dda24addcd Add a 15 second timeout when warning individual users (#5588)
It's possible to spam /warn in groupchats, preventing users from being
able to close the warn modal. This mitigates that by limiting the rate
you can warn a user to once every 15 seconds, which is longer than the
amount of time it takes for the warn modal to allow you to close it.
2019-07-05 14:08:30 -05:00
whales
25971c4096 Clarify /away error messages (#5587) 2019-07-05 02:01:16 -05:00
Jeremy Piemonte
8b761ab96a Back: Return an error message if user is back (#5586)
I did this command about 3 times thinking the server was lagging, but instead it wasn't sending a response.
2019-07-05 00:22:34 -05:00
Zyresus
f7d53e03ce Update domain blacklist (#5572) 2019-07-04 14:14:58 -07:00
whales
d6ded68606 Fix config modification for unit tests (#5585) 2019-07-03 21:38:02 -07:00
Kirk Scheibelhut
e85ebf2bcc Include player count in |tournament|start and /tour getusers (#5581) 2019-07-03 15:56:07 -07:00
Kirk Scheibelhut
ff911e2230 Fix crash in datasearch related to absent template.learnset
If a target doesn't exist the learnset won't either - stub out with
an empty learnset instead.
2019-07-03 09:16:04 -07:00
whales
67c5dc4c5b Check for obvious invalid statuses (#5577) 2019-07-02 22:05:36 -07:00
whales
c6af44d0ca Space clearstatus modlog entry properly (#5578) 2019-07-02 22:02:32 -07:00
TheJetOU
bff15e051e Don't show users in roomauth if they're away (#5575) 2019-07-02 14:37:27 -07:00
Bär Halberkamp
795dde17df Don't allow people with banwords in their status to talk 2019-07-02 22:37:52 +02:00
Bär Halberkamp
801e4e21fc Away users don't get hit by the idle timer 2019-07-02 22:15:05 +02:00
Bär Halberkamp
7b08090786 Idle -> (Idle) for consistency 2019-07-02 19:06:19 +02:00
whales
35a8eebce2 Various status improvements (#5573)
* Allow staff to clear statuses

* Check banwords in a better way

* Don't inline setstatus

* Handle an edge case when clearing statuses
2019-07-02 17:33:23 +02:00
HoeenHero
836fc71c00 Update /endlockdown and /crashfixed
Merged the commands together, and made them PM all users as well as post in all rooms just like /lockdown.
2019-07-02 11:21:50 -04:00
HoeenHero
607ecf3a2c Enable mafia by default
Recommended by @Zarel, shouldn't be disrupting to any rooms that don't want it.
2019-07-02 11:21:46 -04:00
HoeenHero
06a0b93e83 Escape HTML in ticket list 2019-07-02 11:21:42 -04:00
HoeenHero
864d2aaefa Fix bots bypassing the AFK timer 2019-07-02 11:21:37 -04:00
Bär Halberkamp
3bed11f2d6 Using /status while away or busy should preserve status type 2019-07-02 16:31:50 +02:00
Bär Halberkamp
18b0bd1396 Away: fix duplicate protocol message 2019-07-02 16:22:03 +02:00
whales
a8de9f999c Notify users when trying to use a banned status (#5571) 2019-07-02 15:04:04 +02:00
Bär Halberkamp
a84d495eff ACTUALLY pass forStatus to namefilter calls 2019-07-02 14:41:33 +02:00
Bär Halberkamp
1ca759b1c1 Fix one last place where statuses were cleared without that being a good thing 2019-07-02 14:36:53 +02:00
whales
6015b01d1b Fix typing on NameFilter (#5568)
* Fix typing on NameFilter

* actually fix properly lol
2019-07-02 14:33:04 +02:00
Bär Halberkamp
b912e9ec83 Don't spam staff room about status message abuse 2019-07-02 14:15:29 +02:00
Bär Halberkamp
ec3bfe8294 Fix /rules 2019-07-02 14:13:11 +02:00
Bär Halberkamp
48c9304a4a Fix a bug with clearing non-afk statuses 2019-07-02 13:58:30 +02:00
Spandan Punwatkar
eec921a474 Update Nature Swap (#5567) 2019-07-02 14:44:18 +04:00
Bär Halberkamp
89e0aa4c72 Add status commands to /help 2019-07-02 01:24:48 +02:00
Guangcong Luo
c5eeea2818 Fully fix double-elimination tournaments
(Also improve documentation of ElimNode)

PR #5509 was the correct direction, but it missed a spot.
2019-07-01 15:10:59 -07:00
Kirk Scheibelhut
a61c10eeb8
Remove hardcoded URLs in favor of Config.routes (#5557) 2019-07-01 10:19:21 -07:00
Kirk Scheibelhut
df083d7528 Remove Object.assign(function) pattern from TeamValidator{Async} 2019-07-01 08:20:51 -07:00
Kirk Scheibelhut
65aeec5c1d Change invite only modjoin from + -> % (#5562) 2019-06-30 18:21:22 -07:00
Guangcong Luo
64ae404da9 Lock (don't ban) IPs of permabanned users
This makes it so permabanned users can't permanently take out a shared
IP.
2019-06-30 21:19:10 -04:00
Guangcong Luo
f569c020ee Fix #hostfilter entering punishments table 2019-06-30 21:18:52 -04:00
Guangcong Luo
7722d48bea Report host type in /ip 2019-06-30 21:18:30 -04:00
Bär Halberkamp
ed5d534224
Add an AFK timer and status messages (#5002) 2019-07-01 01:47:13 +02:00
asgdf
6e709206c3 Support /math in PMs (#5561) 2019-06-30 15:50:33 -07:00
Kirk Scheibelhut
0941b9b546 Fix lint error in server/ip-tools.ts 2019-06-29 07:28:58 -07:00
Guangcong Luo
3ccc94279a Update /offertie
- Disallow use in tournaments

- Add /requesttie alias
2019-06-27 19:16:12 -04:00
Guangcong Luo
82e8dc6ea1 Add proxy IP detector to IPTools
By default, PS doesn't have very many tools for dealing with ban
evaders on proxies - most of the main server's protection is in private
code.

This commit adds a basic IP evaluator to PS. It categorizes IPs into
residential, mobile, and proxy (and a few other determinations), and
locks proxy IPs by default. DNSBL entries remain semilocked.

This behavior can, as always, be customized via hostfilter. Detect
`user.locked === '#hostfilter'` for the proxy IP lock, which you can
just set `user.locked = null` to disable.

Fixes #5239
2019-06-27 10:25:19 -07:00
Jacob McLemore
36edfd8bde Datasearch: Add ability to search for moves not in a Pokemon's moveset (#5522) 2019-06-27 09:24:56 -07:00
HoeenHero
1df2fc5ead Remove leftover code for previously removed ticket types 2019-06-25 19:09:33 -04:00
HoeenHero
efe6245239 Fix input logs (#5539) 2019-06-26 07:38:17 +09:00
LegoFigure11
cb60a80327 /calc: Update credits and add Battle Spot calculator (#5554) 2019-06-26 03:11:18 +09:00
whales
ba473ac1ea Allow for namelocking without their exact current name (#5552) 2019-06-23 14:54:27 -07:00
anAwsomePerson
9b6950f282 Change dexsearchhelp (#5555) 2019-06-23 14:52:14 -07:00
whales
233e9d07dc Fix whitelisting FRd names (#5553) 2019-06-22 22:58:49 +09:00
Guangcong Luo
4d231a7f96 Comment replay permission check 2019-06-22 21:54:39 +09:00
Marty-D
2daad0c775 Actually fix full replay uploading 2019-06-21 14:42:09 -04:00
Kirk Scheibelhut
0900f11727 Allow roomauth to /hidetext even when there's no user object (#5546) 2019-06-21 17:24:30 +09:00
Kirk Scheibelhut
85b6325d4a Allow for viewing only punishment-related actions in the modlog (#5535) 2019-06-21 17:11:01 +09:00
maxalexandderpi
39799dc50d Update link in !suggestions (#5550) 2019-06-20 18:35:44 -07:00
TheJetOU
4d6bb5638e Prevent duplicate options in polls (#5532) 2019-06-18 23:32:36 +02:00
TheJetOU
c878afa2ad Slightly improve groupchats (#5544)
* Slightly improve groupchats
https://www.smogon.com/forums/posts/8138951
https://www.smogon.com/forums/posts/8155622

* Fix typo

Co-Authored-By: Kirk Scheibelhut <scheibo@users.noreply.github.com>
2019-06-18 21:21:54 +02:00
Kirk Scheibelhut
79f34441f2 Include a >version-origin hash if different from >version (#5542) 2019-06-16 13:24:11 +09:00
whales
04dcdaadb9 Fix checking punishments for subrooms (#5541) 2019-06-16 06:14:27 +02:00
whales
ccf1531f64 Fix crash in uno (#5540) 2019-06-15 13:41:56 +09:00
Kirk Scheibelhut
89b7f8fd3f Fix crash in /crq (#5536) 2019-06-12 22:37:16 +09:00
asgdf
b7812e64d2 Support filtering by zmove in movesearch (#5531) 2019-06-12 09:36:23 +09:00
Bär Halberkamp
dfccccd977 Actually, this isn't needed with the fix in punishments.js.
Whoops, overkill
2019-06-11 22:00:28 +02:00
Bär Halberkamp
50f2588c84 Punishments: fix several bugs in interaction between namelocks and locks, specifically extending 2019-06-11 21:54:25 +02:00
Kirk Scheibelhut
77edd18e59 Improve /calc's random battle auto detection to include unrated battles 2019-06-10 11:20:44 -07:00
whales
8ed9dfa4d5 Fix namemonitor message (#5530) 2019-06-09 21:16:52 -07:00
Bär Halberkamp
05d80815f0
TOTD: Increase nomination length limit by 25 2019-06-09 00:05:55 +02:00
Guangcong Luo
5508b46629 Make /crq userdetails|roominfo always respond
userdetails and roominfo are now guaranteed to send a response, with an
`id` field guaranteed to be equal to the target of the original client
query.

Fixes #5525
2019-06-05 16:05:29 -05:00
whales
33b505383c Clarify NameMonitor message (#5524) 2019-06-05 02:13:25 -05:00
RandbatsCalc
2aeec71a7a Info.js: Randbats calculator typo fix (#5521)
Fix misspelled "Calculator"
2019-06-04 01:22:17 -04:00
whales
5433e2104a Fix a potential user game state desync (#5517) 2019-06-02 17:06:01 -05:00
whales
a87143f613 Fix crash in multi elim tours (#5516)
With the old api, node.getChildAt would return null if the node had no children
2019-06-02 00:17:57 -05:00
whales
8214d994a8 Ensure all desyced games are cleared (#5514) 2019-06-01 09:47:50 -05:00
Guangcong Luo
540f01991c
Remove stray console.trace 2019-05-29 09:46:39 -05:00
whales
959d4c1ad4 Clear forcerename monitor names on namelock more completely (#5510) 2019-05-29 09:41:54 -05:00
Kirk Scheibelhut
1711ab4bab Notify users the first time a PM/challenge is blocked (#5469) 2019-05-29 09:31:57 -05:00
Guangcong Luo
3c6c4b0985 Fix Config.forcetimer 2019-05-25 14:36:02 +02:00
SuddenlyQ
24d0aa0441 Fix quotation marks when a username is already in use (#5512) 2019-05-23 16:22:02 -07:00
jetou
da32e5c4c2 Support requesting ties (#5454) 2019-05-23 17:42:34 +01:00
whales
448a25212e Fix multi-elimination tours (#5509) 2019-05-22 00:53:57 +01:00
whales
4ae608304b Don't notify using a forcerenamed name for namelocked users (#5504) 2019-05-19 22:34:41 +01:00
jetou
8f1093509d Improve roomevents (#5458)
* Improve roomevents

* toId -> toID
2019-05-19 21:08:01 +02:00
Konrad Borowski
78b8e2c6c9 Scavengers: Make queue rows template more reasonable to read 2019-05-19 18:25:18 +02:00
Charlie Kobayashi
f1ae0d6827 Scavengers: Viewhunt/Queue improvements/fixes (#5498)
* Scavengers: Viewhunt/Queue improvements/fixes

- Add "unrated" hunts to queue system
- fix /forcestarthunt, an add an unrated option for this.
- allow /viewhunt to show the current question while leaving the unknown answer blank

* Update scavengers.js
2019-05-19 18:12:43 +02:00
Guangcong Luo
9126fbfae2 Support alternative custom avatar config
The new config should be better compatible with group custom avatars.
2019-05-18 09:56:46 -04:00
Guangcong Luo
3ee9e6f802
Check games more defensively in user.rename
In theory this should be always kept in sync, but in practice it's kind of hard to keep it in sync.
2019-05-18 14:28:39 +01:00
whales
7375f17fe6 Track forcerenamed names (#5500) 2019-05-18 09:54:17 +01:00
jetou
5bf5df4ac7 Chat-commands: Fix hotpatching loginserver (#5502) 2019-05-17 15:44:53 +04:00
HoeenHero
5202d7cc5b Tournaments: Only increase player count by 1 2019-05-16 11:12:42 -04:00
HoeenHero
2915094c55 Mafia: Properly sub players out 2019-05-15 21:30:44 -04:00
Quinton Lee
33663ac040
Tournaments: Fix disqualifying and signups list sorting 2019-05-15 19:30:44 -05:00
HoeenHero
dea7aec87b Mafia: Fix crash with kicking players pre-game 2019-05-15 20:12:57 -04:00
Guangcong Luo
7436c1f0f2 Remove import = and export =
`import =` and `export =` are really only intended for backwards
compatibility with CommonJS. While I really don't like the new module
system TC39 has designed for us, it's what we should be using, and
consistency is important.
2019-05-16 01:27:07 +04:00
Kirk Scheibelhut
032096b53b Fix indent in server/loginserver.ts 2019-05-15 09:51:28 -07:00
HoeenHero
3c1294bcca Properly handle users leaving tournaments 2019-05-15 11:13:31 -04:00
jetou
a9ac65362f LoginServer: Fix makeRequests (#5501) 2019-05-14 21:32:18 -07:00
Quinton Lee
571bd9f68d
LoginServer: Fix instantRequest 2019-05-14 22:39:39 -05:00
Kirk Scheibelhut
56768f45de Fix /eff regression for type names 2019-05-14 17:26:04 -07:00
jetou
9fd6daa6d8 Initialize players with the player rank (#5499) 2019-05-14 16:56:43 +10:00
Guangcong Luo
4e3d3662ce RoomBattle: Don't destroy players at end of game 2019-05-14 11:04:34 +10:00
Guangcong Luo
e1c364fb79 Refactor DNSBL -> IPTools
This is mostly a TypeScript refactor, but it does come with several
renames:

Dnsbl -> IPTools
Dnsbl.query -> IPTools.queryDnsbl
Dnsbl.reverse -> IPTools.getHost
2019-05-14 10:57:08 +10:00
Kirk Scheibelhut
3d24166cdf toId -> toID
Closes #5479
2019-05-12 17:53:01 -07:00
Guangcong Luo
ca4247c7e6 Fix full-replay uploading 2019-05-12 13:26:40 +09:30
Guangcong Luo
2093539e06
Update RoomGame API (#5492)
- The big change here is that player.userid can now be empty. You can
  now fit state into RoomGamePlayer subclasses even when there are no
  users associated with them.

- `game.players` has been introduced as the new canonical list of
  players, including userless players. The old `game.players` has been
  renamed `game.playerTable`, for clarity.

- `game.addPlayer` now returns the added player

All existing RoomGames have been updated for the new API, and
RoomBattle is now officially a RoomGame subclass.

Tournaments was also massively refactored to be properly updated for
the old API, since that never happened, and should now be a lot more
readable.
2019-05-12 12:56:32 +09:30
whales
601759bbe3 Stop hidetext message from getting hidden (#5497) 2019-05-11 12:08:09 +09:30
jetou
9a7ce703f2 TypeScript server/chat formatter.js (#5495) 2019-05-10 09:23:46 -07:00
jetou
3a03568be2 TypeScript ladders-remote and ladders-local (#5490) 2019-05-09 11:09:27 -07:00
jetou
600ee612d2 TypeScript server/loginserver.js (#5485) 2019-05-07 21:17:53 -07:00
Jacob McLemore
a1f18f0290 Chat-Plugins: Fix regression in weakness command (#5484) 2019-05-07 18:42:53 +09:30
whales
1a41502ff2 Stop hidetext hiding the log message (#5483)
Relevant when hidetexting yourself
2019-05-07 16:42:57 +09:30
Kirk Scheibelhut
a9b26fce72 Typescript server/verifier.js (#5482) 2019-05-07 14:09:01 +09:30
Marty-D
8980989580 DNSBL: Add some hostnames 2019-05-06 12:26:01 -04:00
Konrad Borowski
6f41e28982 Trivia: Remove Weakest Link commands from help
This game mode is played very rarely.
2019-05-05 19:27:28 +02:00
Kirk Scheibelhut
10c744f733 Introduce an ID type to sim (#5468) 2019-05-04 13:13:12 +12:00
JetOU
1669fde631 Fix bug in /msg (#5466) 2019-04-29 16:04:35 +12:00
Marty-D
82f0f9c71b
DNSBL: Add some hostnames 2019-04-25 12:26:13 -04:00
Bär Halberkamp
c2cd72521a Rename variable in /warn 2019-04-24 12:25:50 -04:00
Bär Halberkamp
6f0d639755 Fix a logic mistake in my previous commit 2019-04-23 20:33:15 -04:00
whales
579dc632a3 Helptickets: Only prompt for info if ticket is inactive (#5461) 2019-04-23 17:16:40 -04:00
Bär Halberkamp
d0346b9090 Helptickets: don't send automated message when staff use blocked msgs 2019-04-23 17:14:01 -04:00
Bär Halberkamp
cf05bc158e Allow global warns on users that have disconnected
This is so staff can still log the ip and name for users who just logged off
2019-04-23 17:09:01 -04:00
Guangcong Luo
d96bec3e43 Refactor Punishments.search
It used to have a really weird return signature. I've replaced it with
an array of search results, which should be easier to use and make more
sense.
2019-04-23 05:31:50 +09:30
Kirk Scheibelhut
7e4929a39f Change protocol for '|split' message type (#5331) (#5332) 2019-04-22 09:20:47 +09:30