Commit Graph

3589 Commits

Author SHA1 Message Date
dot-Comfey
08e88a160d
Add mass invites (#10519) 2024-09-17 20:43:38 -05:00
larry-the-table-guy
ddf5848a38
Datasearch: Optimize runDexsearch (#10536)
* add crude profiling to runDexSearch

No behavioral changes (other than console.log spam), this commit is just to establish a baseline and pinpoint the slow portions

* optimize datasearch.ts - pull move filter prep out of loop

Based on preliminary benchmarks, most of the time was spent getting the move validator, even for queries that don't specify a move.
More importantly, the parameters for fetching the move validator are known very early in the function and don't change during the loop.
Pulling that portion out of the loop is an easy win.

* improve profiling for runDexSearch

- add subcategories for filtering on move (the next optimization target)
- report unaccounted time amounts ('known unknowns')
- make grand total stand out more

* optimize dexsearch - fetch move list in outer loop

Move list depends on 'alts', which does not change in the loop over mons. Minor win, but simple.

* optimize dexsearch - filter move list by gen in outer loop

Neither 'mod' nor 'altMoves' changes during the inner loop.

* log pokemonSource in runDexSearch - expose possible leak

pokemonSources, which appears to act as a set, grows with each iteration, adding seemingly redundant items.
Will need to look closely at TeamValidator to identify the problem. My guess is that it's putting object references into a Set,
which, for objects other than strings, only cares about object identity.

* profile runDexSearch - count checkCanLearn calls

Also, semi-fix issue identified in prior commit - the endless growth of the restrictiveMoves list.
Counting the calls to checkCanLearn helps us reason about whether the cost per call is reasonable.

* fix perf bug in TeamValidator.checkCanLearn

use the cached ruleTable, save 100x.

* optimize runDexSearch - only init move filters when needed

For queries that never mention a move, a considerable chunk of time is wasted getting the objects needed for
'checkCanLearn'. I measure ~1ms savings for the relevant queries, which is often a decent percentage.

* profile dexsearch - delete and format

This is to document that they are not the bottlenecks.

* remove nested profiling from dexsearch

We've gotten to the point where we actually *are* measuring microseconds, so the frequent calls
are too expensive. This is a good problem to have! What we can see from running npm test is
that 'filters' and 'unaccounted' still account for a majority of the time. So, there's still
room for improvement, if that's ever a serious concern.
Personally, I think working on the moves API would be more fruitful.

* remove all profiling code

No more console.log or performance.now() calls. Ready to merge.

* Update server/chat-plugins/datasearch.ts

Format the 'format' string in-line.

Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>

* Remove ts-expect-error from datasearch.ts

* Fix uninit lint in runDexSearch

---------

Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
2024-09-17 11:46:35 -06:00
adrivrie
247c2aa70a
Random typo fixes (#10556) 2024-09-17 08:09:48 -05:00
Mia
4731f1283d Helptickets: Prevent unregistered users from submitting IP-Appeals 2024-09-12 21:40:33 -05:00
Karthik Bandagonda
b2baca4fd5
Auctions: Remove credits column in snake draft (#10545)
* Auctions: Remove credits column in snake draft

* Update server/chat-plugins/auction.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-09-12 15:36:40 -06:00
Karthik Bandagonda
18eb7d5be5
Auctions: Add support for snake draft (#10526) 2024-09-05 20:00:04 -05:00
Karthik Bandagonda
67354c8f3d
Run updatesearch after changing privacy of game room (#10529) 2024-09-02 15:23:22 -05:00
Mia
fb38517c27 Chat: Stop enforcing room banwords on usernames/statuses 2024-09-01 16:29:37 -05:00
Mia
abf66be9df /show: Remove extraneous button while broadcasting
This isn't really necessary, was only ever a stopgap. We have an actual code fix for it now, so it's fine.
2024-08-31 13:59:23 -05:00
Mia
0af0886121 Remove unnecessary break statement 2024-08-30 00:37:37 -05:00
Mia
cefac5f255 Punishments: Remove stopgap patch 2024-08-30 00:17:47 -05:00
Mia
b487ee646c Punishments: Properly cull duplicated punishments from the PunishmentMap arrays
Splicing an array while you're for-of looping that array is bad, kids.
2024-08-30 00:10:27 -05:00
Mia
5d49882565 Punishments: Ensure duplicated punishments are properly erased 2024-08-29 23:48:47 -05:00
Mia
9b365c8ed5 Scavs: Fix crash 2024-08-29 16:12:03 -05:00
Mia
1dd9192e52 Room-settings: Clarify /makechatroom failure messages 2024-08-26 22:54:06 -05:00
Karthik Bandagonda
b31cf95cfb
Auctions: Allow adding offline managers (#10508)
* Auctions: Allow adding offline managers

* lint
2024-08-26 18:54:08 -06:00
Mia
8dab4c3dd8 Chat: Render commands properly in disabled message 2024-08-26 18:14:32 -05:00
Annika
a6a2f2a487 Trivia: Fix official-ending message 2024-08-22 05:26:21 +00:00
Mia
5bade3789a Fix typo 2024-08-21 22:42:24 -05:00
Mia
7ea985eb91 Seasons: Fix badges being awarded incorrectly 2024-08-21 22:37:41 -05:00
Lucas
5b5653c8db
Scavengers: Support HTML in hunts (#10414) 2024-08-21 18:51:02 -05:00
Mia
e6d3806b41 Auctions: Prevent NaN time limits 2024-08-21 18:44:57 -05:00
Karthik Bandagonda
3dd6c259da
Auctions: Allow bid timer to be changed + display running timer (#10499) 2024-08-21 18:42:46 -05:00
Karthik Bandagonda
8ba361029d
Auctions: Add Smogon export button for pricelist + More formatting changes (#10486)
* Auctions: Add Smogon export button for pricelist

* small formatting change

* fix formatting of help

* improve formatting of table at end of auction

yes I am hijacking this pr for other things

* call checkChat for /overpay

* Allow manually ended auctions to have the same end formatting

* Fix parsing negative credit amounts

* Remove font weight override on username list

* slightly decrease font size
2024-08-21 18:28:35 -05:00
Nonexistent-0
185cb4dd85
Server-Side Compatibility for the Tera Type Preview Checkbox (#10483) 2024-08-21 10:53:02 -04:00
KingNeodude
04def3ffc9
Remove line break from helpticket help (#10493) 2024-08-17 13:34:55 -04:00
HiZo
783f724a03
Super Staff Bros: Implement bugfixes and balance updates (#10448)
* Refactor where Frostyicelad gets Fishious Rend

* Fix Froggeh's move

* Fix multiple teras, correct protocol message for shinies, other stuff

* Fix things i didnt test from the last commit and partman not displaying shiny

* Remove Goro Yagami

* Accurately depict Haste Inky's boost distribution

* simplify

Co-authored-by: urkerab <urkerab@users.noreply.github.com>

* fix

* Update data/mods/gen9ssb/moves.ts

* Fix Hogwash interaction with substitute

Also fix R8's move interaction with Substitute

* Add comment

* properly implement changing genders

* Rename Lily's move

'Recharge' as a move was already taken up by the must recharge forced move selection so this aims to revert that

* Fix bug with saintly bullet

* Update moves.ts

* Update conditions.ts

* Update moves.ts

* Update random-teams.ts

* Update pokedex.ts

* Wowee this is a LOT of balance changes

* Document Amnesia for phoopes

* all but archas to go

* dont explode pokemon immediately from end round + perish song

* Revert archas back to original pre nerf z move idea

* Nerf Xprienzo

* Add illusion checks

* Nerf Scovillain too.

* Improve Wonderer

* Tweak my quote a bit

* im bad

* Opple is now Apple

* apple wanted new quotes

* Finall add meme format

* display pestering assault in commands + add long desc for vruuuum

* Desc for nya innate

* Update Ultra Mystik desc

* Cake helped descriptions, also misc bugfixes and clarifications

* Don't hardcode custom mega abilities

* Update server/chat-plugins/randombattles/ssb.ts

* Update server/chat-plugins/randombattles/ssb.ts

* Update ssb.ts

---------

Co-authored-by: urkerab <urkerab@users.noreply.github.com>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-08-12 23:25:34 -06:00
Mia
d547101d5f Core: Fix tabbing commands with room permissions
I always forget that just object && condition returns object. Broke this here.
2024-08-10 02:23:02 -05:00
Sergio Garcia
a6b6d7771e
COIL: Fix help text (#10480) 2024-08-08 00:05:21 -06:00
Karthik Bandagonda
0bd4f7306e
Auctions: Allow users to place bids without using /bid (#10481) 2024-08-07 10:37:57 -05:00
shrianshChari
645aa3833d
/calc: Add Randoms calc support for Random Doubles (#10477) 2024-08-05 23:46:31 -06:00
Sergio Garcia
e7961d4eea
Improve types for offline pms module (#10438) 2024-08-06 00:45:42 -05:00
Sergio Garcia
9c2da0a7fe
Add support to /removequote last (#10472)
* Allow removing last quote

Standarize with a1ced8d4b3

* Update server/chat-plugins/quotes.ts

* oops

---------

Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
2024-08-06 00:42:50 -05:00
Mia
90d35efe0d Suspect tests: Allow setting float COIL B values 2024-08-06 00:39:08 -05:00
Mia
cfefa23d7e
Add a /crq for command tab-completion (#10468) 2024-08-03 14:43:43 -05:00
Leonard Craft III
6fd9510e8b Fix /hightraffic message 2024-08-02 21:33:35 -05:00
Andrew Werner
3aac2bd8f0 Mafia: Show eliminated players in order of elimination 2024-08-02 22:24:11 -04:00
Leonard Craft III
945cfd8491 Improve /pick error handling 2024-08-02 21:23:31 -05:00
Kris Johnson
44e21e43c3 Add August 2024 rotational formats 2024-08-01 01:30:27 -06:00
adrivrie
389b03e161
Random Battles: July 2024 balance patch (#10451)
* raise dubs and lower baby elo winrate threshold

* Random Battles: July 2024 balance patch
2024-07-31 16:28:58 -06:00
Mia
663d56f393 Helptickets: Unify log parsing for battle rooms and replays 2024-07-28 13:26:37 -05:00
Karthik Bandagonda
dbff9d1033
Auctions: Don't allow suspended teams to place bids (#10447) 2024-07-26 17:50:38 -05:00
Kris Johnson
3c8c0ba6a3 More accurately define formathelp 2024-07-26 13:38:55 -06:00
Kris Johnson
099143e2b6 Suspect Tests: Escape HTML for suspects 2024-07-26 08:58:33 -06:00
HoeenHero
10fbf907d3
Mafia: Refactor plugin to stop misusing the playerTable (#10200)
* Mafia: Stop removing players from the player table upon elimination.

* Mafia: Stop using RoomGame#playerTable

Unbeknownst to me when I wrote this plugin, playerTable is not a source of truth for who is in the game or not.
With this commit, I'm making it a policy for the mafia plugin to never directly read or mutate from the playerTable.

As an alternative, RoomGame#players is an array of players that can be accessed, and a Mafia#getPlayer(ID) method was added for ease of getting a specific player.

RoomGame#playerCount will no longer reflect the number of un-eliminated players as players in a Mafia game can be revived and are not removed from the game until it ends or they sub out.
Instead, we will not use the Mafia#getRemainingPlayers() method to get a array of remaining players and check its length for the uneliminated player count.
2024-07-26 10:19:08 -04:00
Mia
7b1f2d8d4a Helptickets: Properly locate Pokemon names in reports 2024-07-25 20:28:06 -05:00
Mia
f4eafcc9ec Helptickets: Use the replays database for pokemon name reporting 2024-07-25 20:24:14 -05:00
Mia
b7d8474a3e Helptickets: Ensure opponents are parsed from replay DB results 2024-07-25 20:17:47 -05:00
Distrib
029a6bb53d
Update /faq lostpassword (#10439) 2024-07-24 18:31:33 -05:00
Karthik Bandagonda
e8361dfa76
Auctions: Fix edge case for removing players after an undo (#10437) 2024-07-23 20:05:59 -05:00