Commit Graph

232 Commits

Author SHA1 Message Date
Guangcong Luo
d0e1c7a1a9 Suppress console output 2025-07-23 21:10:45 -07:00
Guangcong Luo
42b4dccae4 Fix HEAD requests 2025-07-23 18:43:14 -07:00
Guangcong Luo
5f06cdf622 Minor fixes 2025-07-23 17:40:50 -07:00
Guangcong Luo
ba1e7458bf Misc refactors 2025-07-23 13:28:09 -07:00
Guangcong Luo
e338ce4313 Annotate mime types with utf-8
(Thanks @DieterReinert)
2025-07-23 13:28:07 -07:00
Guangcong Luo
c721409fe6 More MIME types
Co-authored-by: Slayer95 <ivojulca@hotmail.com>
2025-07-23 13:06:01 -07:00
Guangcong Luo
f6fc8cc03b Support HEAD requests part 2
Co-authored-by: Slayer95 <ivojulca@hotmail.com>
2025-07-23 05:09:44 -07:00
Guangcong Luo
168fd7a3c9 Remove unused function params 2025-07-23 05:06:23 -07:00
Guangcong Luo
0bc33e24b9 Support HEAD requests
Co-authored-by: Slayer95 <ivojulca@hotmail.com>
2025-07-23 05:01:39 -07:00
Guangcong Luo
458c26c83b Properly type Options 2025-07-23 02:46:44 -07:00
Guangcong Luo
a7378ce470 Remove weird unused directory streaming feature
This comes from:

9c3f819abb

And I have no clue what it does but it's never been documented so
presumably it's never been used. It takes up wayy too much code
complexity for an undocumented feature that we'll never use, so out it
goes.
2025-07-23 02:42:38 -07:00
Guangcong Luo
299dd767dd Fix double-send bug in certain error conditions
This appears to be a bug in upstream node-static. This fix also means
we're passing around Results rather than tuples, which makes some
function signatures notable simpler.
2025-07-23 02:27:36 -07:00
Guangcong Luo
4fc3ed81ee Refactor to Promises 2025-07-23 02:02:29 -07:00
Guangcong Luo
340c863dec Lint 2025-07-22 21:57:29 -07:00
Guangcong Luo
7a161108b1 TypeScript vendored node-static 2025-07-22 21:57:07 -07:00
Guangcong Luo
62a899b4e4 Vendor node-static 2025-07-22 21:55:59 -07:00
Sergio Garcia
fc23103de1 Fix random typos (#11020)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-04-13 23:59:36 -07:00
Guangcong Luo
4079fe7846 Database library: Support raw strings in SQL()
This is nearly never the right thing to do, but I guess some people
want raw power.
2025-04-12 17:13:47 -07:00
Slayer95
674defa1b1 Fix uncaught exceptions in net library (#10628)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
Added missing error event handler
2025-03-01 03:18:43 -08:00
Guangcong Luo
be518c5025 Suppress crash from probable race condition
Some checks failed
Node.js CI / build (18.x) (push) Waiting to run
Publish to npm / test (push) Has been cancelled
Publish to npm / get-version (push) Has been cancelled
Publish to npm / npm-publish (push) Has been cancelled
2025-02-26 22:28:46 -08:00
Guangcong Luo
73a04cdcba TypeScript: Enable noImplicitOverride
Some checks are pending
Publish to npm / test (push) Waiting to run
Publish to npm / get-version (push) Waiting to run
Publish to npm / npm-publish (push) Blocked by required conditions
Node.js CI / build (18.x) (push) Waiting to run
2025-02-26 14:38:32 -08:00
Guangcong Luo
62023bd299 Emit .d.ts types for NPM package
Some checks are pending
Publish to npm / test (push) Waiting to run
Publish to npm / get-version (push) Waiting to run
Publish to npm / npm-publish (push) Blocked by required conditions
Node.js CI / build (18.x) (push) Waiting to run
2025-02-26 02:44:08 -08:00
Guangcong Luo
e25bec3620 Remove some implicit conversions
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. <_<
2025-02-25 22:55:01 -08:00
Guangcong Luo
78439b4a02 Update to ESLint 9 (#10926)
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.
2025-02-25 20:03:46 -08:00
Guangcong Luo
ec7332b498 Import Utils from lib/utils
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
This mostly is just a step towards removing sim's dependency on Node's
stdlib.
2025-01-14 23:01:53 -08:00
Mia
d3e60b31f7 Sim: Use a CSPRNG (#10806)
* Sim: Use a CSPRNG

* Add test

* fix test prng

* move prng test to others

* fix slight hack

* tf?

* Fuck this

* fucking lol

* fix crap

* i'm going to kill someone

* i hate state

* fix test

* Good work genius

* typo

* Fix exportinputlog

* Refactor for inputlog backwards compatibility

This is a pretty major refactor which is mostly unrelated to the
feature, but it does make the code a lot simpler.

* Readability pass

* Readability (again)

* Remove sodium-native dependency

* Refactor to serialize seeds in hex strings

(Also removes the Buffer dependency from PRNG, and slightly improves
comments.)

* Apparently << is 32-bit signed

* Readability

---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2025-01-11 13:56:34 -06:00
Kris Johnson
89128dee97 Utils#Multiset: Redefine get to remove undefined return (#10329) 2024-06-06 17:16:59 -06:00
Mia
b048de52e2 Make the logs/ directory prefix configurable 2024-05-19 12:30:22 -05:00
Mia
bdc1ed2401 Chatlog: Add support for linecounts on the database 2024-05-18 03:14:57 -05:00
Mia
56c3b69fcd Utils: Ensure require cache clearing is exhaustive
Previously, this was limited by a depth check that always got hit, meaning it never fully properly cleaned out the module tree (most likely due to the fact the uncacheModuleTree call would loop around to the same module through recursion, meaning mod.children never got deleted, so it never stopped looping). This commit fixes that.
2024-04-22 15:41:54 -05:00
Guangcong Luo
517f34bee8 Fix outdated reference to .end() in Streams doc 2024-01-17 22:20:59 -08:00
Guangcong Luo
6f1a640b71 Improve Streams docs 2024-01-17 22:19:52 -08:00
Guangcong Luo
e22f49ef04 Fix REPL crashing on startup
The problem is that we were cleaning up old REPL sockets after
launching new ones. This moves the cleanup step to before Artemis
and Friends processes are launched.
2023-12-29 17:08:58 -06:00
urkerab
cd7aa49a16 Deep freeze an object's values directly (#10022) 2023-12-28 07:10:32 -08:00
Guangcong Luo
9cd64cba15 Freeze cached Sim objects
We're hunting ~~wabbits~~ validator bugs.

Honestly, this has been a long time coming, but Object.freeze perf
used to not be good enough for us to use it here. Here's hoping!
2023-12-07 01:26:51 -05:00
Guangcong Luo
6b42b4f6b2 Experimental direct replay uploading
We have a new replay server on a new engine using a new schema.

Everything's gone remarkably well, considering.
2023-12-02 11:07:08 -05:00
Mia
4b79ee1276 Net: Expose response data to consumers
Headers are useful for a couple of Net consumers (rate limit data, that sort of thing.)
2023-11-28 12:27:38 -06:00
Mia
effb8ed103 Utils: Explicitly traverse the module tree to ensure no references are held long-term 2023-11-20 22:19:49 -06:00
Mia
071d7e3c94 Process-manager: Don't hold unnecessary module references past their expiry 2023-11-20 21:28:42 -06:00
Mia
56a5175d00 Fix typo
Didn't mean to commit this.
2023-11-04 16:43:55 -05:00
Mia
d6c78db0dd SQL: Account for dist files in loading extensions 2023-11-04 16:41:47 -05:00
Mia
5f6d9029ac Prevent chat processes from nesting 2023-11-04 16:37:49 -05:00
Mia
0211066723 Add offline messaging (#8440) 2023-11-04 14:45:18 -05:00
Mia
f190b1c8a7 Add a chat plugin for storing teams remotely (#9513) 2023-09-24 11:22:26 -05:00
Mia
8caf1b7932 Process-manager: Respawn timed-out processes 2023-06-12 13:17:58 -05:00
Annika
0bc78dddf5 TypeScript 5! 2023-04-09 13:02:19 -07:00
Mia
35c7c62566 Fix Postgres config loading 2022-12-22 15:57:05 -06:00
Mia
b11177d530 Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00
Mia
93a0a0f61c Rooms: Only lockdown after restarts when battles crash (#9110) 2022-12-04 12:45:31 -05:00
Mia
8bdebea6e4 Fix eslint errors 2022-11-17 16:18:39 -06:00