Single module modding

This commit is contained in:
2026-11-14 12:18:41 -03:00
parent 605008f584
commit 313098892e
134 changed files with 919 additions and 924 deletions
+5 -4
View File
@@ -3,15 +3,16 @@
/// <reference lib="deno.worker" />
// runs the mods' content scripts for server/load_mods.ts, without permissions like the game's worker, since the host
// that loads mods can read and write files. gets each one's script and answers with what each registered, in order
// runs the content phase of the mods' scripts for server/load_mods.ts, without permissions like the game's worker,
// since the host that loads mods can read and write files. gets each one's script and answers with what each
// registered, in order
import { type ContentScriptCode, run_content_script } from "@/common/content_scripts.ts";
import { data_url } from "@/common/mod.ts";
self.onmessage = async (event: MessageEvent<ContentScriptCode[]>) => {
const results = [];
for (const { mod, version, code } of event.data) {
results.push(await run_content_script({ mod, version, url: data_url(code) }));
for (const { code, ...script } of event.data) {
results.push(await run_content_script({ ...script, url: data_url(code) }));
}
self.postMessage(results);
};