Shared state between client and server
This commit is contained in:
@@ -16,6 +16,7 @@ export interface ServerModSource {
|
||||
// importable urls of the scripts: data: urls in the worker, file urls in tests
|
||||
server_url?: string;
|
||||
worldgen_url?: string;
|
||||
shared_url?: string;
|
||||
}
|
||||
|
||||
export async function start_game(
|
||||
@@ -44,6 +45,13 @@ export async function start_game(
|
||||
runtime,
|
||||
});
|
||||
|
||||
// every mod's shared rules first, so server scripts can count on any mod's being there
|
||||
await runtime.load_shared_scripts(
|
||||
game,
|
||||
mods.flatMap((mod) =>
|
||||
mod.shared_url ? [{ mod: mod.listing.id, version: mod.listing.version, url: mod.shared_url }] : []
|
||||
),
|
||||
);
|
||||
await runtime.load_scripts(
|
||||
game,
|
||||
mods.flatMap((mod) =>
|
||||
|
||||
Reference in New Issue
Block a user