Shared state between client and server

This commit is contained in:
2026-10-03 18:45:07 -03:00
parent 63e6248f9f
commit 7417bfd5f1
24 changed files with 656 additions and 193 deletions
+4 -2
View File
@@ -36,7 +36,7 @@ export interface ManifestJson {
authors?: string[];
game_version?: string;
dependencies?: { id: string; version: string }[];
scripts?: { server?: string; client?: string; worldgen?: string };
scripts?: { server?: string; client?: string; worldgen?: string; shared?: string };
credits?: string;
}
@@ -449,7 +449,9 @@ export function validate_manifest(json: unknown, folder_name: string): Problems
problems.push("scripts must be an object");
} else {
for (const [side, path] of Object.entries(json.scripts)) {
if (!["server", "client", "worldgen"].includes(side)) problems.push(`unknown script "${side}"`);
if (!["server", "client", "worldgen", "shared"].includes(side)) {
problems.push(`unknown script "${side}"`);
}
if (typeof path !== "string") problems.push(`scripts.${side} must be a path`);
}
}