Commit Graph

1635 Commits

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