Shared state between client and server
This commit is contained in:
+4
-2
@@ -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`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user