Commit Graph

1635 Commits

Author SHA1 Message Date
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
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
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
354513ad53
Add log viewer (#6454) 2020-03-13 22:18:00 -04:00
Kris Johnson
b077646808
Random Battles chat plugin: Fix various issues (#6448) 2020-03-12 12:37:10 +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
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
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
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
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
whales
38daf467fc
Add some common rooms to the roomid type (#6393) 2020-02-24 19:52:41 -08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
HoeenHero
427dc80346 Tickets: Add a dash to IP-Appeal 2019-12-29 19:26:42 -05:00
Claire238
744853cb89 Fix spelling for punishment list (#6199) 2019-12-23 09:49:46 +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
fb6f7cb7dc Typescript mafia (#6145) 2019-12-09 22:17:09 +09: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
The Immortal
7c6364edaf Fix /mnm crash 2019-12-03 02:00:52 +04: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
The Immortal
f39b05fd1e Update /mnm
Update to gen 8 and remove unnecessary warnings.
2019-11-30 05:46:12 +04: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
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
Astrid Halberkamp
aace3c4265 Spoiler racial slur evasion 2019-11-25 02:08:43 +04: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
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
whales
e36dda7b09 Add a few more characters to the evasion filter 2019-11-18 12:59:44 +10:30
asgdf
f1a714d426 Fix /ts command to use gen 7 tier data (#5971) 2019-11-17 09:09:04 +13:00
whales
0d7e473672 Allow viewing roomfaqs without showing source (#5944) 2019-11-16 00:12:26 +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
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
HoeenHero
6bf6c6596b Do not allow tickets to stay open for more than a day 2019-11-09 14:34:53 -05:00
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
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
whales
22283e8c95 Add a letter to the evasion filter 2019-11-01 18:31:58 +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
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
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
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
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
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
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
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
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
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
whales
fa5f1389f8 Fix a few more userid -> id changes (#5886) 2019-10-15 18:20:58 +10:30
whales
4b4543b2a1 Fix typo in mafia help 2019-10-13 21:41:10 +10:30
SuddenlyQ
7ba7e0264d Add /pl as an alias to /punishlog (#5875) 2019-10-12 04:25:20 +02: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
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
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
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
Spandan Punwatkar
c8873aeec9 Add Announcements (#5404)
(Announcements can't coexist with polls)
2019-10-04 01:21:38 +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
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
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
ayiadvance
6e76cd87ce Mafia Dead List (#5717) 2019-09-18 11:45:39 -04: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
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
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
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
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
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
Astrid Halberkamp
02a04e7c2e TOTD: add anotd for the anime and manga room 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
TheJetOU
f2783c642d Add a RoomID type (#5759) 2019-09-07 14:15:27 -05: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
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
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
620fd82376 Add lottery plugin (#5722) 2019-08-26 09:56:01 -07:00
TheJetOU
2b28c9fd6b Refactor Rooms(), Users() to Rooms.get(), Users.get() (#5725) 2019-08-25 06:33:56 -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
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
TheJetOU
5597916644 TypeScript Rooms and Roomlogs (#5699) 2019-08-14 20:44:57 +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
RyotaMitaraiWeb
239d354adf Update a link in the /intro command (#5697) 2019-08-12 16:09:30 -04:00
TheJetOU
4b0be1b5b4 TypeScript RoomGame and RoomBattle (#5692) 2019-08-11 17:03:36 +02:00
whales
a04f3dc7ad Rework enabling mafia to be more like other chatgames (#5689) 2019-08-10 16:59:54 -04:00
Jacob McLemore
91f81460cb Scavengers: Add Recycled Hunts functionality (#5666) 2019-08-09 09:33:21 +02: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
Jeremy Piemonte
83bb9a3180 Implement blackjack game (#3726) 2019-08-06 20:23:08 +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
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
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
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
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
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
Kirk Scheibelhut
b0a7b61693 Include status message in helpticket messaging (#5626) 2019-07-18 13:51:26 -05:00
whales
94bb4084d5 Typescript users (#5617) 2019-07-16 19:22:38 -07:00
Guangcong Luo
bee09145e8 Fix Scuntorpe Problem in status monitor 2019-07-16 13:52:21 -05:00
asgdf
1f2a17e5d1 Support ohko flag in movesearch, update helptext (#5614) 2019-07-15 22:17:23 -05:00
fart
77e054d96c Fix /coverage bug (#5611) 2019-07-15 20:48:42 -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
Guangcong Luo
b7e94c1da3 Fix crashes in chat commands 2019-07-15 10:58:09 -04:00
whales
8ad6c9246f Don't report name after forcerename for namelocked users (#5583) 2019-07-15 00:57:29 -05:00
Guangcong Luo
a2f9a9191e Add 'ok' to Help tickets content-free message list 2019-07-15 00:23:07 -04:00
whales
934a6cd246 Mafia: Implement silences (#5584) 2019-07-12 07:40:22 -04: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
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
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
06a0b93e83 Escape HTML in ticket list 2019-07-02 11:21:42 -04:00
whales
a8de9f999c Notify users when trying to use a banned status (#5571) 2019-07-02 15:04: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
Spandan Punwatkar
eec921a474 Update Nature Swap (#5567) 2019-07-02 14:44:18 +04: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
7722d48bea Report host type in /ip 2019-06-30 21:18:30 -04:00
asgdf
6e709206c3 Support /math in PMs (#5561) 2019-06-30 15:50:33 -07: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
LegoFigure11
cb60a80327 /calc: Update credits and add Battle Spot calculator (#5554) 2019-06-26 03:11:18 +09: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
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
whales
ccf1531f64 Fix crash in uno (#5540) 2019-06-15 13:41:56 +09:00
asgdf
b7812e64d2 Support filtering by zmove in movesearch (#5531) 2019-06-12 09:36:23 +09: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
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
959d4c1ad4 Clear forcerename monitor names on namelock more completely (#5510) 2019-05-29 09:41:54 -05: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
whales
7375f17fe6 Track forcerenamed names (#5500) 2019-05-18 09:54:17 +01:00
HoeenHero
2915094c55 Mafia: Properly sub players out 2019-05-15 21:30:44 -04: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
56768f45de Fix /eff regression for type names 2019-05-14 17:26:04 -07: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
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
Jacob McLemore
a1f18f0290 Chat-Plugins: Fix regression in weakness command (#5484) 2019-05-07 18:42:53 +09:30
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
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
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
Guangcong Luo
17ebb805a4 Fix typechecking in punishments.js
It turns out the line `let Punishments = module.exports;` makes it into
`any`, and disables nearly all typechecking of anything to do with
`Punishments`. This refactor fixes that, and also fixes a bunch of flaws
newly caught by TypeScript.

I tried my best not to make any changes to actual functionality. These
changes should be effectively purely code cleanup.
2019-04-22 08:39:05 +09:30
JetOU
19d561d76f Calculator: Support modulos (#5455) 2019-04-17 22:22:30 +09:30
Jacob McLemore
454c599b84 Movesearch: Add ability to search for moves in more than one Pokemon's learnset (#5346) 2019-04-17 16:44:42 +09:30
Konrad Borowski
f123adf560 Uno: Include card name in aria-label
Buttons with content like "S" aren't accessible as it's not obvious
that "S" means Skip, and they don't mention which color the card is,
which before this change was visible only by checking the style
attribute.

Having an aria-label attribute gives an accessible alternative for
screen readers. A screen reader probably won't tell an user a button
is red, and this is somewhat important while playing Uno.
2019-04-16 22:20:13 +02:00
Kirk Scheibelhut
7177f4ddcf Include diffs of all User settings in |updateuser| (#5438) 2019-04-16 06:20:36 +09:30
whales
71c372f7d0 Scavs: Fix reset message (#5447) 2019-04-16 05:18:21 +09:30
HoeenHero
820eff0410 Escape HTML in help ticket hover messages 2019-04-14 07:38:46 -04:00
HoeenHero
d6b4705870 Help Tickets: General Improvements 2019-04-13 15:50:23 -04:00
Distrib
2713112c7b Helptickets: Fix Request a password reset (#5446)
I just noticed that the link is not up to date. On the room help is another link, so I replaced it.
2019-04-13 13:29:20 +02:00
whales
e29df1d09f Update scavengers (#5434)
Tie databases to the room so they survive hotpatches, change finish message order
2019-04-11 23:07:11 +09:30
Austin Couturier
706b46cafd Allow Global Voices and higher to pm /code (#5411) 2019-04-06 01:02:49 +08:00
Guangcong Luo
5f8b1b81f1 Improve Help ticket messages 2019-04-05 10:55:03 -04:00
Guangcong Luo
851d1a8fb9 Improve !code's appearance
(Also alias /calc to /math)
2019-04-05 10:54:34 -04:00
Guangcong Luo
12f49b20e1 Move /code and /pi to chat-plugins/info.js
The two are definitely not core commands.
2019-04-05 09:41:11 -04:00
JetOU
25dd6ffcbc Improve /sp (#5309)
* Improve SP

* Remove useless code

which fixes a build error, killing two birds with one stone

* Move sorting code to page

* Increase readability

* Further increase redability

* Remove useless alts filtering

* Add semicolon

* Standardize output in punishments.js

* Remove punishDesc

* Close div tag

* Don't show if they end in 0s

* Improve conditional
This should (hopefully) fix a bug where a roomban showed up as 12 months, which is what happenes when `Chat.toDurationString` gets a negative number, `Chat.toDurationString` doesn't recognize anything below 1000ms anyway.

* Prevent rooms with '-' to use /sp

* Pluralize IP

* Fix mismatched tags

* Fix sort callback

* Remove useless conditional
2019-04-04 18:19:41 -04:00
Spandan Punwatkar
6856ee9b23 Add sort parameter to /dexsearch (#5291) 2019-04-03 14:42:47 +08:00
JetOU
0976c5f3c3 Helpticket: Use for-of instead of for-in in arrays (#5385) 2019-03-30 20:56:41 -05:00
Lucas-Meijer
c8fe3374e9 Mafia: Shorten Idea Timer and Correct IDEA Rolelists (#5357) 2019-03-28 08:54:09 -04:00
HoeenHero
d40c4f9db7 Update language support for /analysis 2019-03-27 13:15:28 -04:00
HoeenHero
8d9af2bb83 Battlesearch: Fix date sorting 2019-03-27 13:15:24 -04:00
JetOU
b396ce9edb Allow multi-line htmlbox (#5334) 2019-03-27 22:06:51 +08:00
Ivo Julca
d4b9b98678 TCG: Refactor net functions
- Fix error handling
- Use async-await
2019-03-24 02:24:30 -05:00
Snaquaza
00fab15ca4 Mafia: Add Themes (#5305) 2019-03-17 06:54:29 -04:00
Ivo Julca
3686dcfe46 TS: ModdedDex#generateTeam() returns PokemonSet[] 2019-03-12 00:29:59 -05:00
Ben Davies
80cbca67e5 Make /modjoin false set room modjoin property to null, not undefined 2019-03-11 18:58:55 -03:00
Ben Davies
6809679733 Trivia: allow batch adding/submitting questions 2019-03-11 14:55:02 -03:00
Bär Halberkamp
f46aa55f43 Info: That's supposed to be global mod not roommod... 2019-03-11 17:50:25 +01:00
JetOU
708f656873 Info: Add /showpunishments command (#5223)
* Info: Add /roomstatus command

https://www.smogon.com/forums/threads/3534365/page-81#post-7977912
I'm not a big fan of the approach used here, but I didn't have any better ideas that worked.

* Fix build errors

* Remove response function

* Change command name

* Rewrite

* Use HTML pages

* Reword entries

* Check username map instead of IP map

* Prevent duplicate punishments from appearing.

* Use this.title

* Remove debug code

* Add a check if punishments exists

* Show ip and alts

* Pluralize IP

* Slight refactor in punishDesc

* Add check for Punishments.roomIps existence

* Return an error message for rooms without '-'

More specifically, rooms that aren't public, hidden or private. They couldn't use them anyway. This just handles them correctly.

* Join ip

* Use room.chatRoomData instead of...

checking for '-' in roomids.

* Update help command

* Clarify error message

* Simplify permission check

* Remove muteQueue variable

* Fix punishDesc

Alts would overwrite reason if it existed and punishDesc would always contain undefined due to not being defined empty. This commit fixes both bugs.

* Allow roomstaff to use /sp

* Refactor store iteration to for...of

As per CONTRIBUTING.md
2019-03-09 22:44:30 +01:00
JetOU
85533ee3a0 Change forEach to for...of (#5269) 2019-03-08 11:24:58 -06:00
Ben Davies
f6db058bd2
Chat-plugins: ignore links when determining room FAQ length (#5262) 2019-03-07 13:42:28 -04:00
Bär Halberkamp
c28340714d
Chat monitor: Compare userids in namefilter 2019-03-06 20:54:44 +01:00
Bär Halberkamp
cf8cff25b6 Spotlights: disable spotlights in temp rooms 2019-03-06 03:05:05 +01:00
TheMezStrikes
b20daa42cc Trim FAQ target (#5252) 2019-03-05 07:35:01 -06:00
Bär Halberkamp
ac470ec52c Add a FAQ option for RNG 2019-03-04 20:41:56 +01:00
Konrad Borowski
90dcec5644 Use FS when loading Scavengers' data (#5238)
This prevents issues with loading old state while hotpatching.
2019-03-03 16:59:33 -06:00
Guangcong Luo
ce5a954ae2 Use array spread instead of Array.from 2019-03-03 08:47:08 -06:00
Kirk Scheibelhut
6e122d5d74 Refactor lib/ to be native Typescript (#5217) 2019-03-02 11:12:24 -06:00
The Immortal
075da69253 Update Other Metagames 2019-03-01 17:27:26 +04:00
Konrad Borowski
04fef9e8df Log long modlog queries 2019-03-01 02:35:39 -06:00
Konrad Borowski
0a9af088ce Make modlog asynchronous
This should prevent issues in which the /modlog takes forever
because it's waiting for previous /modlog command.
2019-03-01 02:35:39 -06:00
Konrad Borowski
42d7f97bc8 Make !rules broadcastable
This fixes a regression.
2019-02-27 21:16:21 +01:00
Kirk Scheibelhut
b09fd63377 Refactor sim/ to be native Typescript (#5210) 2019-02-26 11:03:30 -06:00
Kris Johnson
da6f42c5c1 Change Untiered to (DUU) for Doubles (#5178) 2019-02-25 07:35:41 +04:00
The Immortal
bc1ff9fac4 Revert "Change (PU) to Untiered (#5170)"
This reverts commit d40fe510b4.
2019-02-25 06:26:21 +04:00
Bär Halberkamp
eb67a12ad6 Translation support (#5167) 2019-02-23 19:36:42 -06:00
Kris Johnson
d49610fcd7 Datasearch: Fix event Pokemon showing in LC searches (#5177) 2019-02-22 18:30:56 -06:00
Kirk Scheibelhut
dc4bfbc4ae Fix some Typescript related TODOs (#5198) 2019-02-22 17:48:16 -06:00
whales
fc2eda1cf7 Mafia: Resolve chat pages properly (#5192) 2019-02-21 13:35:44 +01:00
Bär Halberkamp
b3df28035d Chat monitor: make inap pokemon names weeklock instead of namelock 2019-02-21 01:06:53 +01:00
uzelbot
922a4cef95 Remove * from most permissions shown in /help (#5168) 2019-02-20 00:59:50 -06:00
Guangcong Luo
64089636dd Simplify evo data representation 2019-02-19 23:46:55 -06:00
Guangcong Luo
46134ce5f6 Improve data representation of evo method 2019-02-19 23:42:06 -06:00
Jacob McLemore
bad622e1cd Add evolution method information (#5179) 2019-02-19 23:04:20 -06:00
Guangcong Luo
997274cfc5 Use editprivacy permission for /ionext
This matches the permission for /ioo
2019-02-18 21:57:45 -05:00
HoeenHero
c6ed4cedb7 TCG: Update wiki domain 2019-02-18 08:39:53 -05:00
whales
374a1cde5a Mafia: Fix html room updates (#5174) 2019-02-17 11:08:37 -05:00
Bär Halberkamp
9ab6bbbf2e Cafe: Fix path 2019-02-16 23:56:46 +01:00
Kris Johnson
d40fe510b4 Change (PU) to Untiered (#5170) 2019-02-16 03:07:51 +04:00
HoeenHero
6d7115dfd5 Support the random battles damage calculator 2019-02-12 14:33:24 -05:00
Bär Halberkamp
5fb8b5e954
Add a PageContext for HTML pages and expand html page functionality (#5160) 2019-02-12 19:00:14 +01:00
whales
7f2994b4f9 Mafia: Fix starting games through the UI (#5156) 2019-02-12 08:44:18 -05:00
Guangcong Luo
b498bb222c Require object literal method shorthand 2019-02-11 18:14:09 -06:00
SuddenlyQ
0796613a72 Add in-battle mod detection to /weak and /coverage (#5144) 2019-02-09 12:25:45 -05:00
Guangcong Luo
248e7ed767 Fix Help Tickets preview 2019-02-09 00:09:49 -06:00
Guangcong Luo
f2edf2bd17 Fix crash in /processes 2019-02-08 23:20:23 -06:00
Kris Johnson
39ee0477c1 Movesearch: Account for custom recoil (#5151) 2019-02-07 16:50:47 -06:00
HoeenHero
222b4e7454 Fix ticket activation when the creator is staff 2019-02-07 15:43:01 -05:00
HoeenHero
6c3b8b5de5 Help Tickets: Require users to explain their issue before getting help (#5148) 2019-02-07 13:07:18 -06:00
Spandan Punwatkar
a041239224 Add Recoil as Move Search Parameter (#5149) 2019-02-07 12:10:11 -06:00
whales
7e8d588f7d Mafia: Support hiding discards, starting from open signups (#5142) 2019-02-06 19:15:09 -05:00
Guangcong Luo
8eba261f0b Fix crash in /data 2019-02-06 16:24:48 -06:00
HoeenHero
870d308ee6 Fix modlog search location 2019-02-06 11:59:04 -05:00
Bär Halberkamp
89838d657f Fix chat plugin file I/O after server/ refactor 2019-02-06 17:54:30 +01:00
HoeenHero
7f68ab7352 Battlesearch improve UI 2019-02-06 11:16:04 -05:00
Marty-D
0cc5649187
Help tickets: Remove timerstalling 2019-02-06 11:07:13 -05:00
Guangcong Luo
70b3e9a525 Rename channel -> room, subchannel -> channel
"channel" is just a fancy way of saying "room, but in sockets".
Renaming them like this should make it clearer exactly what's going
on in sockets.
2019-02-05 16:55:37 -06:00
Guangcong Luo
f3e45fbb72 Move server code to server/
Also move mods/ to data/mods/

This makes PS more monorepo-like. The intent is to further separate
the sim and the server code, but without fully committing to splitting
the repository itself.

We now support `./pokemon-showdown start` in addition to
`./pokemon-showdown`. I'm not clear which I want to be the default
yet.
2019-02-03 16:07:06 -06:00