Commit Graph

142 Commits

Author SHA1 Message Date
Mia
2834e06085
Admin: Limit the size of pageids sent in /j view-bot 2022-05-11 10:23:59 -05:00
Mia
94cc6115cd Admin: Clarify index.ts process display in /processes 2022-05-03 14:32:12 -05:00
Hisuian Zoroark
fe683a8510
Editbattle: Fix HP editing (#8646) 2022-02-07 16:01:02 -07:00
Mia
8d9cbebb5f
Fix /ebat number parsing
https://www.smogon.com/forums/threads/bug-reports-v4-read-original-post-before-posting.3663703/page-69#post-9074782.
Running toID() on negative numbers stripped out the negative.
2022-01-11 14:50:27 -06:00
Mia
6429937906 Admin: Make /bash broadcastable
Convenience.
2022-01-04 14:30:20 -06:00
Annika
b3839dec66 /evalsql: Properly log to <<upperstaff>>
Previously it just logged `[object Object]`.
2021-12-10 19:21:15 -08:00
Mia
f608496938
Support JSX in HTML pages (#8523)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-11-12 22:06:26 -08:00
Mia
a7d27dde3a Add help for all commands in server/chat-commands/ 2021-09-23 12:11:55 -05:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Mia
3ece2f9eef /evalsql: Fix error handling 2021-08-22 19:47:20 -05:00
Mia
8cf1035ee2
SQL: Automatically prepare statements unless told otherwise (#8439) 2021-08-18 12:51:39 -07:00
Mia
77861ceae6
SQL: Use a QueryProcessManager subclass (#8422) 2021-08-14 17:45:51 -07:00
Annika
633e061067 Modlog: Remove text logging code 2021-08-09 14:06:14 -07:00
Annika
982c357f88 /evalsql: Fix bug 2021-07-23 15:27:10 -07:00
Annika
bcbe100c41
Modlog: Use SQLite for searches (#8004) 2021-07-23 13:47:49 -07:00
Annika
19c6daf9f2 /evalsql: Make table scroll horizontally 2021-07-21 14:34:25 -07:00
Mia
879bb9dc18 /evalsql: Destroy DB after use 2021-07-21 15:06:14 -05:00
Mia
9ed2c0036f
Add a command for evaluating SQLite (#8407) 2021-07-21 13:05:02 -07:00
Mia
e5fbd64427
Support adding friends (#7333) 2021-07-16 12:56:34 -07:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Mia
7fe886302c /botmsg: Fix filter check 2021-06-29 00:45:29 -05:00
Mia
d829ceeff4 Chat: Validate command recursion 2021-06-28 21:28:30 -05:00
PartMan
0d7159b12c
/botmsg: Permit ROs too (#8370)
(Bots become ROs of subroom groupchats if they create them.)
2021-06-22 15:52:54 -07:00
Mia
66261e99d2
Admin: Support /eval in PMs (#8249) 2021-05-25 16:28:09 -07:00
Quinton Lee
3783f11ea0
Implement /sendprivatehtmlbox (#8285) 2021-05-14 02:47:33 -07:00
Mia
ec1c8cc95d /botmsg: Bypass room throttles 2021-05-09 18:05:25 -05:00
HoeenHero
36fe51f71c Dont block future updates if Config.privatecodepath is not set. 2021-05-08 20:55:49 -04:00
Guangcong Luo
11a6902154 Force rebuild when using /rebuild 2021-05-06 01:36:34 -07:00
Mia
abcf367181 Admin: Respawn Dexsearch processes in formats hotpatch 2021-05-03 11:41:49 -05:00
Quinton Lee
51e005e65d
Implement /closehtmlpage (#8253) 2021-05-02 13:42:46 -07:00
Guangcong Luo
a480a84ce4 Chat API: Add requireUser
This simplifies a lot of `splitUser` uses that immediately go on
to make sure the user actually exists.
2021-04-30 17:14:35 -07:00
Guangcong Luo
0230a002fd Make bot attribution stricter
Admins should not be using `addhtml` commands for jokes. This makes
it so only gbots get access to unattributed `addhtml`.
2021-04-30 17:14:35 -07:00
Guangcong Luo
d80319d114
Implement /botmsg (#8240) 2021-04-29 00:54:57 -07:00
Quinton Lee
6079927a95
Commands: Support sending |selectorhtml| to bot HTML pages (#8228) 2021-04-25 20:20:57 -07:00
Guangcong Luo
810aff74cd Namespace more server global types 2021-04-25 14:16:27 -07:00
Guangcong Luo
0e0389bdc8 Rename pageContext.send to pageContext.setHTML
It's currently not very similar to commandContext.send so using the
same name could make things very confusing.

We have a new `pageContext.send` function that actually behaves as
you'd expect.
2021-04-25 13:25:42 -07:00
Guangcong Luo
486f292904
Refactor everything to use Utils.sortBy (#8220)
A few uses of `array.sort()` have been left alone:

- sorting in `data/` because they aren't supposed to import anything

- `set-importer` because I still have no clue what that's for and what
  dependencies it is/isn't allowed to have

- `sort()` with no arguments used as a lexical sort (at which point
  `sortBy` offers no benefits)

All other cases have been replaced with `Utils.sortBy`, which should
be a massive increase in readability.

Sort orders should be much more readable now, without needing to puzzle
through sign issues. The order is always low-to-high, A-to-Z,
true-to-false.
2021-04-23 22:41:00 -07:00
Annika
c87f63f4f0 /processes: Fix RAM usage display
`ps` reports RSS in kb, not bytes, making /processes off by a factor of 1024
2021-04-17 22:17:48 -07:00
Marty-D
84301ca382
Admin: Fix typo in processes 2021-04-12 17:36:43 -04:00
Mia
c43da18531
Admin: Add ram info to /processes (#8189) 2021-04-08 12:19:18 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
Quinton Lee
697cd715bb
Add feedback to /sendhtmlpage and /highlighthtmlpage (#8187) 2021-04-07 22:27:39 -07:00
Annika
3ecff41881 /hotpatch: Remove non-alphanumeric characters
Today I accidentally typed a space after /hotpatch formats, and I don't see why it should reject that.
2021-04-02 14:22:03 -07:00
Mia
f7044d542a Admin: Fix crash in /processes 2021-04-01 00:29:49 -05:00
Mia
bfafdb0936
Admin: Ignore the current 'ps' process in /processes (#8049) 2021-03-18 07:07:11 -07:00
Mia
b8ae8c9ef0 Admin: Document exclusion in keysToCopy 2021-03-08 08:41:09 -06:00
Mia
07b1c01f75
Support hotpatching User/Room/ProcessManager protos (#8095) 2021-03-08 05:23:17 -08:00
Mia
9e0c1b7894
Restore /potd (#8092) 2021-03-03 18:24:57 -08:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Mia
fffc564c24
Add 'ps' output to /processes (#8047) 2021-02-16 20:04:03 -08:00