Commit Graph

263 Commits

Author SHA1 Message Date
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