Nitpick; the button to check out a text ticket shows as "Claim" when someone else is already looking at the ticket or it is already closed, which doesn't really make sense.
https://www.smogon.com/forums/threads/clean-up-update-error-message-for-faq.3764560/
!faq fails no longer send the failed message message in chat, this is very helpful for room auth who are the users of broadcast commands
For whatever reason '!faq all' fails used a replybox? I can't think of a single non dev command that uses visible replyboxes in chat for fails, so changed this for an errorReply.
I cleaned up the wording of the /help faq, and I added some topics that were not there previously.
I figured PR #11105 would have some unintended side effect, but this
one isn't bad at all. There's no longer an easy way to tell whether
requests are move requests or not, but it's easy enough to instead
track the current turn.
* !rfaq fail over to !faq
Approved Suggestion: https://www.smogon.com/forums/threads/have-rfaq-fail-over-to-faq-if-a-match-is-not-found.3687458/
Code calls for RFAQ topics if that fails it checks the FAQ topic list. Sounds straightforward until you realize the faq broadcast fail command is archaic and for some reason the failed FAQ broadcast message still goes through on top of the actual faq error return message, along with the faq help, it's very messy I might just fix that next. This is bypassed by having the run broadcast call AFTER the topic is read as valid, so none of this nonsense can happen. I really thought this would be easy, turns out, not really (atleast for me).
Fix /removedaily, adding a new "all" option to work like it's
documented to work, and fix the documentation.
Also remove support for legacy image format. A lot of functions were
async that didn't need to be.
Also remove an entirely unused sorting pass mistakenly introduced in
11ab3d83f8
(The queue was sorted, then immediately ignored to iterate it by index,
which is for the best, because showing the queue in any order other
than queue order is not useful.)
Replace outdated (like, since XY outdated) links with current links.
I don't *love* dumping users at the Smogon Metagames forum, but there is no where else I am aware of that has all of our formats listed out.
Also updated the description to explain how /tier works and explain what type of information it contains.
https://www.smogon.com/forums/threads/clarification-on-how-long-a-ban-lasts.3761482/
2 day bans do not say the amount of time which can be confusing to new users as they think a room ban is permanent. This commit does so without influencing week room ban text logs which already do note the 1 week time limit. This is an approved suggestion on the forums as well.
* Make ds collapsible
* Make other search commands collapsible.
* Remove all as a parameter for searches
* use readmore element with content attrs defined
* Rework to support chrome due to details linebreak quirk
* Move the toggle button down to the results line for broadcast commands
* command properly functions when duplicated but cant broadcast with the normal name.
* Prevent users from providing no argument.
* Removed extraneous null check and ternary assignment.
* Remove extraneous newline.
* Update server/chat-commands/avatars.tsx
---------
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Adds trap as a search param to movesearch without modifying any moves.
* minor regex optimization.
* Implement in a less hacky manner.
* clean up adding both trapping statuses to the orgroup.
* Fixed conditional mixing trapped moves with other volatilestatuses.
* Implemented tier searching using inequalities.
* Fixed the value of OU being higher than CAP.
* Fixed AND searching for tiers with inequalities.
* Update server/chat-plugins/datasearch.ts
* Update server/chat-plugins/datasearch.ts
---------
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
"Standard NatDex" is very weird compared to how OMs usually work.
See "TierShift Mod" and "Godly Gift Mod". NatDex now gets its own mod,
which can be mixed into any other format, instead of needing to start
with NatDex.
This would make Min Source Gen overriding annoying, so it now defaults
to the current gen in Gen 9+, if Obtainable is set and +Past isn't. So
now you don't need to manually set Min Source Gen to enforce Obtainable
in Gen 9.
NatDex Mod refactor caught a bug. `format.gen` isn't meaningful.
...maybe it should be... Main concern would be perf impact, to load
all the datamods to get their gen. Probably not worth it?
boolean -> number and number -> string should be explicit. Probably
string -> number should be, too, but I'm not ready to turn on the lint
option yet.
This was supposed to be part of the big ESLint refactor but I forgot
to push it. <_<
ESLint has a whole new config format, so I figure it's a good time to
make the config system saner.
- First, we no longer have separate eslint-no-types configs. Lint
performance shouldn't be enough of a problem to justify the
relevant maintenance complexity.
- Second, our base config should work out-of-the-box now. `npx eslint`
will work as expected, without any CLI flags. You should still use
`npm run lint` which adds the `--cached` flag for performance.
- Third, whatever updates I did fixed style linting, which apparently
has been bugged for quite some time, considering all the obvious
mixed-tabs-and-spaces issues I found in the upgrade.
Also here are some changes to our style rules. In particular:
- Curly brackets (for objects etc) now have spaces inside them. Sorry
for the huge change. ESLint doesn't support our old style, and most
projects use Prettier style, so we might as well match them in this way.
See https://github.com/eslint-stylistic/eslint-stylistic/issues/415
- String + number concatenation is no longer allowed. We now
consistently use template strings for this.
A private command table named /foo - say, with /foo bar and /foo baz - would leak its existence when /foo is used, reporting back that the command '/foo ' does not exist - whereas a nonexistent command would not have the trailing space.
* Auctions: Fix addplayer command
* hijack pr for styling changes
* minor formatting change
* Add team name column to overall pricelist
* Add support for max players
* Don't send bid error messages to everyone
* Remove tiers hover text, add hover text of entire draft list when hovering over a teams player list
* Trivia: Fix crash and Number mode game cap
Discussed with Trivia auth.
Fixes an issue in Number mode where the game fails to end after a specified amount of questions, and fixes a crash caused by ending a game with no participation
* Update server/chat-plugins/trivia/trivia.ts
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
---------
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
Previously, `/calculate` would fail to include the correct base prefix (`0x`, `0b`, `0o`) when the result was `0` because the code used a falsy check (`if (result)`). This commit replaces that condition with `if (Number.isFinite(result))`, ensuring zero is properly displayed in the requested base.
* Implement Gen 9 Battle Factory
* Make OU mons female when possible for Cute Charm Enamorus
* delete yanmega
* Update data/random-battles/gen9/teams.ts
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Apply more suggestions from code review
* Simplify two lines
---------
Co-authored-by: ACakeWearingAHat <45981036+ACakeWearingAHat@users.noreply.github.com>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Use value rules for timer
* lint
* fix rule overrides
* fix the "boolean" value rules
* add limits for number based rules
* Realized that you don't need boolean value rules
* oops
* fix checks for lower bounds
* 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>