Commit Graph

129 Commits

Author SHA1 Message Date
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
Mia
010ffe1a41
Admin: Fix /disablecommand message (#8019) 2021-02-13 23:19:59 -05:00
Guangcong Luo
148439dc27 Refactor /editbattle
This moves the `player()` and `pokemon()` functions to be defined
inside `eval`, allowing them to be used by `>>>` and `/evalbattle`.

This should hopefully make the commands more readable as well.
2021-02-02 13:52:16 -08:00
Guangcong Luo
796be8da60 Implement /ebat reseed
Fixes #7963
2021-02-02 13:45:34 -08:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
Mia
3479c1f5e0 Admin: Allow dev staff to use /processes 2021-01-28 15:00:05 -06:00
TheMezStrikes
593e589bb4
Default sendhtmlpage to all connections (#7939) 2021-01-23 04:36:05 -08:00
urkerab
5cb927d439
Remove variables made redundant by PR #7663 (#7873)
The `hotpatchVersions` variable was only used by `requiresForce`.

The `patch` variable no longer provides any benefit over `target`,
so I removed it too.
2021-01-03 21:17:30 +04:00
Annika
ca9ce2f225
Refactor /updateserver (#7836)
Now, `/updateserver` updates both public and private code.

To update only one, use `/updateserver private` or `/updateserver public`.
2020-12-26 07:17:43 -08:00
Mia
9712f6ecf1
Modlog: Remove Rooms global in PM (#7799) 2020-12-13 12:52:52 -08:00
Mia
b7001afdba
Chat: Add a method for iterating commands (#7722) 2020-12-03 19:37:59 -08:00
Annika
70016c9e49 Admin: Fix /updateserver private 2020-11-25 13:48:31 -08:00
Guangcong Luo
847681d9e9 Improve /updateserver, /rebuild, /hotpatch UX
My carefully-designed `/updateserver` UX has been ruined by the
addition of the rebuild step.

The new `/updateserver`, `/rebuild`, and `/hotpatch` commands are now
once again as carefully-designed as before, and should represent a
much improved server administration experience.
2020-11-17 10:45:40 +00:00
Mia
7307364451
Remove /forcehotpatch (#7663)
Hotpatches now always rebuild before patching.
2020-11-14 21:01:35 -08:00