@wildshard/engine 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/budgets/shard-size-baseline.json +10 -4
- package/index.html +6 -4
- package/lint/engine-sides.json +21 -0
- package/lint/host-callback-syntax.mjs +2 -1
- package/lint/host-callbacks.mjs +3 -3
- package/lint/host-files.mjs +5 -4
- package/lint/no-base64.mjs +3 -1
- package/lint/ratchet.json +0 -68
- package/lint/ratchet.mjs +1 -4
- package/lint/shard-imports.mjs +6 -7
- package/lint/shard-source.d.mts +9 -0
- package/lint/shard-source.mjs +91 -0
- package/lint/shardfile-boundaries.mjs +10 -8
- package/lint/sim-closure.mjs +6 -3
- package/lint/wildshard-plugin.d.ts +4 -0
- package/lint/wildshard-plugin.js +22 -23
- package/package.json +25 -16
- package/scripts/agent-sync.mjs +27 -8
- package/scripts/app-build/appCook.ts +8 -2
- package/scripts/app-build/catalogue.ts +10 -7
- package/scripts/app-build/gen.ts +22 -2
- package/scripts/app-build/isolation.d.mts +10 -0
- package/scripts/app-build/isolation.mjs +47 -0
- package/scripts/app-build/outputProducts.d.mts +3 -0
- package/scripts/app-build/outputProducts.mjs +35 -0
- package/scripts/app-build/previousDeploy.d.mts +2 -0
- package/scripts/app-build/previousDeploy.mjs +10 -1
- package/scripts/app-build/serviceWorker.ts +10 -3
- package/scripts/app-build/splitOutput.mjs +4 -2
- package/scripts/app-build/standaloneOutput.d.mts +1 -1
- package/scripts/app-build/standaloneOutput.mjs +5 -3
- package/scripts/app-build/titlePreloads.d.mts +8 -0
- package/scripts/app-build/titlePreloads.mjs +69 -0
- package/scripts/app-build/worldMapAtlas.ts +10 -6
- package/scripts/app-build-pipeline.mjs +34 -3
- package/scripts/built-product.mjs +1 -1
- package/scripts/cell-mem-bench.mjs +81 -23
- package/scripts/check-custom-sections-zero.mjs +1 -1
- package/scripts/check-devserver.mjs +3 -1
- package/scripts/check-models.mjs +2 -0
- package/scripts/check-paths.allow.json +0 -115
- package/scripts/check-paths.mjs +2 -2
- package/scripts/check-platform-ratchets.mjs +2 -3
- package/scripts/chromium-keychain-check.mjs +4 -2
- package/scripts/chromium-keychain.d.mts +1 -1
- package/scripts/chromium-keychain.mjs +3 -1
- package/scripts/ci-static.sh +1 -1
- package/scripts/committed-fast-checks.mjs +0 -2
- package/scripts/content-sw-proof.mjs +2 -1
- package/scripts/cook-worker.mjs +9 -3
- package/scripts/cook.mjs +20 -3
- package/scripts/devices.d.mts +4 -0
- package/scripts/devices.mjs +39 -0
- package/scripts/devserver-client.d.mts +4 -2
- package/scripts/devserver-client.mjs +25 -8
- package/scripts/docs-inputs-proof.mjs +6 -6
- package/scripts/doctor-proof.mjs +1 -1
- package/scripts/e2e-faults.mjs +159 -0
- package/scripts/e7-voice-staging-proof.mjs +1 -1
- package/scripts/gate-related-tests.mjs +1 -1
- package/scripts/git-source-view.mjs +1 -1
- package/scripts/goldens/capture.mjs +17 -5
- package/scripts/grid-crossing-nightly.mjs +59 -0
- package/scripts/grid-crossing-qa.mjs +44 -0
- package/scripts/grid-crossing-ratchet.d.mts +6 -0
- package/scripts/grid-crossing-ratchet.mjs +52 -0
- package/scripts/grid-crossing-report.mjs +122 -0
- package/scripts/grid-crossing-stages.mjs +47 -0
- package/scripts/grid-crossing-tour.mjs +277 -0
- package/scripts/grid-crossing-walk-proof.mjs +136 -18
- package/scripts/host-ruler/roots.mjs +2 -2
- package/scripts/host-ruler.d.mts +91 -0
- package/scripts/host-ruler.mjs +565 -0
- package/scripts/live-prepush.py +3 -5
- package/scripts/loading-flow/benchmax.mjs +3 -1
- package/scripts/look-loop/test_look_loop.py +1 -38
- package/scripts/memory-proof.mjs +213 -0
- package/scripts/mmo-bots.mjs +8 -2
- package/scripts/net-lag-proof.mjs +219 -0
- package/scripts/night-market-kit-budget.mjs +2 -2
- package/scripts/offline-proof-rules.d.mts +5 -3
- package/scripts/offline-proof-rules.mjs +34 -7
- package/scripts/offline-proof.mjs +88 -18
- package/scripts/{shard-platform-output.mjs → output-reader.mjs} +1 -1
- package/scripts/page-release/content.d.mts +9 -1
- package/scripts/page-release/content.mjs +131 -17
- package/scripts/page-release/flow.mjs +36 -10
- package/scripts/page-release/stamp-content.mjs +24 -0
- package/scripts/page-release.mjs +28 -6
- package/scripts/page-size.mjs +2 -1
- package/scripts/pin-packs.ts +1 -1
- package/scripts/pins.ts +4 -4
- package/scripts/precommit-checks.mjs +1 -7
- package/scripts/precommit-jobs.mjs +0 -1
- package/scripts/precommit-source.py +1 -9
- package/scripts/program-discovery.mjs +1 -1
- package/scripts/ring-cook.mjs +2 -1
- package/scripts/ring-step.ts +1 -1
- package/scripts/script-scenario-metrics.mjs +1 -1
- package/scripts/shard-output-content.d.mts +1 -1
- package/scripts/shard-output-content.mjs +2 -2
- package/scripts/shard-outputs.mjs +1 -1
- package/scripts/shard-public.mjs +1 -1
- package/scripts/shard-wire-meter.mjs +24 -9
- package/scripts/side-parity.mjs +4 -2
- package/scripts/standalone-smoke.mjs +8 -3
- package/scripts/tier-textures-proof.mjs +101 -0
- package/scripts/tier-textures.mjs +78 -0
- package/scripts/tile-bake-report.mjs +1 -1
- package/scripts/tile-bakes.mjs +1 -1
- package/scripts/title-assets.generated.json +2 -0
- package/scripts/tsconfig.json +1 -2
- package/scripts/vendor/basisu/LICENSE +201 -0
- package/scripts/vendor/basisu/basis_encoder.cjs +2 -0
- package/scripts/vendor/basisu/basis_encoder.wasm +0 -0
- package/scripts/vitest-push-guards.config.ts +1 -1
- package/scripts/vps/harden-apply.sh +4 -1
- package/scripts/vps/harden-prometheus.sh +176 -0
- package/scripts/vps/harden.sh +16 -0
- package/scripts/vps/rebuild.sh +18 -0
- package/scripts/vps/wildshard-config +84 -24
- package/scripts/worker-client-play.mjs +7 -2
- package/scripts/worker-client-proof.mjs +1 -1
- package/scripts/worker-client-slug.mjs +44 -0
- package/scripts/worktree-reap.mjs +5 -5
- package/src/.oxlintrc.json +3 -182
- package/src/client/app/entry.ts +47 -12
- package/src/client/engine/boot/bootCache.ts +2 -2
- package/src/client/engine/boot/bootTrace.ts +12 -4
- package/src/client/engine/boot/browserChunkRecovery.ts +4 -0
- package/src/client/engine/boot/clearDownloads.ts +5 -2
- package/src/client/engine/boot/contentRead.ts +11 -0
- package/src/client/engine/boot/gpuFiles.ts +4 -2
- package/src/client/engine/boot/lastEnd.ts +99 -12
- package/src/client/engine/boot/parsedPages.ts +127 -58
- package/src/client/engine/boot/texturePack.ts +2 -2
- package/src/client/engine/build.d.ts +2 -0
- package/src/client/engine/core/Game.ts +18 -0
- package/src/client/engine/core/bootstrap.ts +4 -1
- package/src/client/engine/debug/probe.ts +18 -1
- package/src/client/engine/fx/LightPool.ts +41 -1
- package/src/client/engine/net/netPlayer.ts +19 -2
- package/src/client/engine/net/otherPlayers.ts +55 -8
- package/src/client/engine/net/predictor.ts +33 -9
- package/src/client/engine/net/redial.ts +29 -6
- package/src/client/engine/pwa/cacheNames.ts +58 -1
- package/src/client/engine/pwa/sw.js +53 -14
- package/src/client/engine/render/dataLook.ts +152 -40
- package/src/client/engine/render/families/detail.ts +89 -0
- package/src/client/engine/render/families/pbr.ts +7 -1
- package/src/client/engine/render/look.ts +6 -0
- package/src/client/engine/render/lookLight.ts +103 -11
- package/src/client/engine/render/lookRender.ts +105 -0
- package/src/client/engine/render/precompile.ts +20 -14
- package/src/client/engine/saves/indexed.ts +2 -2
- package/src/client/engine/telemetry/browserErrors.ts +28 -4
- package/src/client/engine/telemetry/deviceSnapshot.ts +155 -0
- package/src/client/engine/telemetry/staleBuildReport.ts +22 -1
- package/src/client/engine/ui/debugOptions.ts +1 -1
- package/src/client/engine/ui/lookLightOption.ts +10 -6
- package/src/client/engine/ui/namePrompt.ts +7 -0
- package/src/client/game/boot/audio.generated.ts +114 -216
- package/src/client/game/boot/bytes.generated.ts +118 -238
- package/src/client/game/boot/placedSpawn.ts +35 -0
- package/src/client/game/boot/spawnDownload.ts +25 -6
- package/src/client/game/boot/versions.generated.ts +7 -7
- package/src/client/game/devScene/hook.ts +291 -0
- package/src/client/game/grid/area.ts +38 -0
- package/src/client/game/grid/cellLoading.ts +12 -2
- package/src/client/game/grid/live.ts +134 -12
- package/src/client/game/grid/liveSession.ts +47 -5
- package/src/client/game/grid/mapAtlas.ts +18 -4
- package/src/client/game/grid/menu.ts +4 -0
- package/src/client/game/grid/minimapBlend.ts +15 -5
- package/src/client/game/grid/neighbourPanels.ts +10 -1
- package/src/client/game/grid/oneWayIn.ts +5 -1
- package/src/client/game/grid/placedCards.ts +55 -0
- package/src/client/game/grid/placedCells.ts +233 -0
- package/src/client/game/grid/placedContent.ts +85 -0
- package/src/client/game/grid/prefetch.ts +9 -1
- package/src/client/game/grid/productInputs.ts +3 -1
- package/src/client/game/grid/productLeases.ts +4 -1
- package/src/client/game/grid/products.ts +8 -4
- package/src/client/game/grid/regionalRuntime.ts +6 -0
- package/src/client/game/grid/regionalWorld.ts +15 -2
- package/src/client/game/grid/roadCull.ts +44 -14
- package/src/client/game/grid/roadLook.ts +24 -15
- package/src/client/game/grid/roadLookPlatform.ts +4 -2
- package/src/client/game/grid/roadResources.ts +24 -0
- package/src/client/game/grid/roadSign.worker.ts +4 -3
- package/src/client/game/grid/roadSignPaint.ts +16 -5
- package/src/client/game/grid/roadSignPreparation.ts +4 -3
- package/src/client/game/grid/roadSignScale.ts +8 -0
- package/src/client/game/grid/roadTileBacking.ts +13 -3
- package/src/client/game/grid/roadTileCapture.worker.ts +3 -1
- package/src/client/game/grid/roadTileCaptureWorker.ts +2 -1
- package/src/client/game/grid/roadTileWrite.worker.ts +4 -2
- package/src/client/game/grid/roadTileWriter.ts +2 -1
- package/src/client/game/grid/screenReports.ts +39 -0
- package/src/client/game/grid/session.ts +29 -4
- package/src/client/game/grid/shardfileFar.ts +9 -3
- package/src/client/game/grid/softWallLook.ts +25 -8
- package/src/client/game/mainMenu.ts +6 -2
- package/src/client/game/plugin/context.ts +2 -1
- package/src/client/game/plugin/followedMovers.ts +7 -1
- package/src/client/game/quest/figures.ts +2 -0
- package/src/client/game/session/finish.ts +11 -1
- package/src/client/game/shard/titleList.ts +6 -2
- package/src/client/game/shardfile/assetCache.ts +4 -4
- package/src/client/game/shardfile/client.ts +4 -1
- package/src/client/game/shardfile/clientAssets.ts +9 -5
- package/src/client/game/shardfile/clientLibrary.ts +1 -1
- package/src/client/game/shardfile/clientWater.ts +51 -9
- package/src/client/game/shardfile/clientWorker.ts +21 -8
- package/src/client/game/shardfile/look.ts +8 -3
- package/src/client/game/shardfile/product.ts +34 -7
- package/src/client/game/shardfile/productChecks.ts +2 -2
- package/src/client/game/shardfile/productCost.ts +2 -2
- package/src/client/game/shardfile/readAsset.ts +2 -2
- package/src/client/game/shardfile/reflectingWater.ts +73 -0
- package/src/client/game/shardfile/seatGrace.ts +9 -0
- package/src/client/game/shardfile/skinPlayback.ts +1 -1
- package/src/client/game/systems/npc/figureRows.ts +9 -0
- package/src/client/game/titleDeck.ts +4 -3
- package/src/client/host/online/doctor.ts +2 -0
- package/src/client/host/online/linkScreens.ts +30 -4
- package/src/client/host/online/shell.ts +14 -0
- package/src/client/host/standalone/shell.ts +4 -0
- package/src/cook/game/astc6Encode.ts +55 -0
- package/src/cook/game/astc6Wasm.ts +176 -0
- package/src/cook/game/cookJob.ts +30 -6
- package/src/cook/game/cookWorker.ts +38 -11
- package/src/cook/game/entryTotals.ts +51 -24
- package/src/cook/game/shardCook.ts +67 -9
- package/src/cook/game/spawnParts.ts +33 -8
- package/src/cook/game/tierTextures.ts +349 -0
- package/src/e2e/smoke/game.ts +19 -14
- package/src/e2e/smoke/page-globals.d.ts +9 -8
- package/src/e2e/smoke/template2.spec.ts +8 -7
- package/src/server/engine/ai/bossContenders.ts +27 -3
- package/src/server/engine/ai/phases.ts +1 -1
- package/src/server/engine/entities/creatureRefill.ts +9 -2
- package/src/server/engine/net/ledgerBook.ts +2 -0
- package/src/server/engine/net/room.ts +15 -0
- package/src/server/engine/sim/respawn.ts +8 -0
- package/src/server/game/boss/arenaRoomEntry.ts +5 -1
- package/src/server/game/boss/arenaRoomNative.ts +2 -0
- package/src/server/game/boss/native.ts +2 -1
- package/src/server/game/boss/nativeWake.ts +9 -5
- package/src/server/game/boss/openArenaNative.ts +2 -2
- package/src/server/game/boss/openArenaRoom.ts +3 -1
- package/src/server/game/grid/room.ts +44 -3
- package/src/server/game/grid/simulation.ts +23 -0
- package/src/server/game/population/mixedRoster.ts +11 -3
- package/src/server/game/population/nativeBake.ts +8 -3
- package/src/server/game/population/nativeReturns.ts +6 -3
- package/src/server/game/population/roster.ts +5 -3
- package/src/server/game/quest/eliteDrops.ts +15 -4
- package/src/server/game/quest/nativeChapter.ts +1 -1
- package/src/server/game/quest/nativeComposition.ts +5 -1
- package/src/server/game/riding/nativeTaming.ts +10 -6
- package/src/server/game/riding/wildRefill.ts +3 -2
- package/src/server/game/shardfile/bossRow.ts +4 -2
- package/src/server/game/shardfile/homeKeeper.ts +4 -2
- package/src/server/host/bake/headlessWorker.ts +1 -1
- package/src/server/host/dedicated/cellHost.ts +98 -16
- package/src/server/host/dedicated/cellProtocol.ts +16 -1
- package/src/server/host/dedicated/cellWorker.ts +8 -5
- package/src/server/host/dedicated/dedicatedRoom.ts +16 -6
- package/src/server/host/dedicated/gridCells.ts +15 -6
- package/src/server/host/dedicated/loopLag.ts +21 -0
- package/src/server/host/dedicated/main.ts +13 -5
- package/src/server/host/dedicated/packReader.ts +3 -3
- package/src/server/host/dedicated/placementFile.ts +4 -19
- package/src/server/host/dedicated/roadRoom.ts +34 -4
- package/src/server/host/dedicated/serverMetrics.ts +126 -0
- package/src/server/host/dedicated/socketPump.ts +21 -4
- package/src/server/host/dedicated/socketTransport.ts +2 -1
- package/src/server/host/dedicated/workerTable.ts +15 -4
- package/src/server/host/dedicated/world.ts +95 -8
- package/src/server/host/headless.ts +1 -1
- package/src/server/host/headlessRuntime.ts +1 -1
- package/src/server/host/standalone/roadWorld.ts +15 -3
- package/src/server/host/standalone/serverHost.ts +4 -1
- package/src/server/host/standalone/serverProduct.ts +41 -11
- package/src/shared/engine/ai/BossBrain.ts +8 -0
- package/src/shared/engine/net/deviceWord.ts +138 -0
- package/src/shared/engine/net/socketFrames.ts +7 -4
- package/src/shared/game/boss/wake.ts +6 -0
- package/src/shared/game/devColliders.ts +47 -0
- package/src/shared/game/eliteSystem.ts +8 -0
- package/src/shared/game/grid/allocator.ts +3 -0
- package/src/shared/game/grid/catalogueSlot.ts +7 -0
- package/src/shared/game/grid/placementRows.ts +36 -0
- package/src/shared/game/plugin/bossRecord.ts +3 -2
- package/src/shared/game/shardfile/ktx2Targets.ts +23 -3
- package/src/shared/game/shardfile/outputDescriptor.ts +9 -5
- package/src/shared/game/shardfile/packReads.ts +28 -3
- package/src/shared/game/shardfile/serverPack.ts +9 -0
- package/src/shared/game/systems/looks/trampleField.ts +2 -0
- package/src/shared/host/formatJsonSchema.ts +2 -2
- package/src/tsconfig.json +1 -27
- package/lint/host-reviews.json +0 -14
- package/lint/listed-view-code.json +0 -13
- package/lint/platform-pending-users.json +0 -2520
- package/lint/platform-pending-users.md +0 -18
- package/scripts/cell-mem/metrics-preload.mjs +0 -65
- package/scripts/check-closed-components.d.mts +0 -7
- package/scripts/check-closed-components.mjs +0 -87
- package/scripts/g571-hosts.d.mts +0 -3
- package/scripts/g571-hosts.mjs +0 -54
- package/scripts/host-ruler/register-migrate.mjs +0 -242
- package/scripts/listed-view-code.d.mts +0 -7
- package/scripts/listed-view-code.mjs +0 -93
- package/scripts/look-loop/fit-lut.py +0 -142
- package/scripts/look-loop/palette-delta.py +0 -183
- package/scripts/look-loop/regions/driftwood-isle.json +0 -25
- package/scripts/look-loop/regions/far-reach.json +0 -225
- package/scripts/look-loop/regions/open-plot-night-market.json +0 -855
- package/scripts/look-loop/regions/pine-hollow.json +0 -22
- package/scripts/look-loop/regions/sunscar-dunes.json +0 -281
- package/scripts/platform-chargebacks.d.mts +0 -9
- package/scripts/platform-chargebacks.mjs +0 -135
- package/scripts/shard-component-spans.d.mts +0 -15
- package/scripts/shard-component-spans.mjs +0 -18
- package/scripts/shard-components.d.mts +0 -16
- package/scripts/shard-components.mjs +0 -363
- package/scripts/shard-platform-hosts.d.mts +0 -2
- package/scripts/shard-platform-hosts.mjs +0 -93
- package/scripts/shard-platform-sections.d.mts +0 -2
- package/scripts/shard-platform-sections.mjs +0 -9
- package/scripts/shard-platform.d.mts +0 -76
- package/scripts/shard-platform.mjs +0 -1072
- package/src/.oxfmtrc.json +0 -48
- package/src/scripts/ask-new.sh +0 -29
- package/src/scripts/asks.mjs +0 -142
- package/src/scripts/herdr-prompt.sh +0 -34
- package/src/scripts/herdr-question-open.sh +0 -67
- package/src/scripts/md-wrap.mjs +0 -229
- /package/scripts/{shard-platform-format.d.mts → node-format.d.mts} +0 -0
- /package/scripts/{shard-platform-format.mjs → node-format.mjs} +0 -0
- /package/scripts/{shard-platform-output.d.mts → output-reader.d.mts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Scope } from '@wildshard/engine/app/scope';
|
|
2
|
+
import { withOwner } from '@wildshard/engine/app/ownership';
|
|
3
|
+
import type { Physics } from '@wildshard/engine/physics/Physics';
|
|
4
|
+
import { groups } from '@wildshard/engine/physics/groups';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* SHARD-SOURCE AP5 (J347): a watched part's solid boxes, as the dev hook's `swapColliders` hands them to a physics world.
|
|
8
|
+
* The page's world (the player's prediction) and the in-page server's world (the worker, over the harness port) both take
|
|
9
|
+
* them through `swapDevBoxes`, so the two sets never differ. DEVSERVER-only on both sides: each caller reaches this module
|
|
10
|
+
* behind the `__DEVSERVER__` define, so a production bundle drops it (engine `scripts/check-devserver.mjs`).
|
|
11
|
+
*/
|
|
12
|
+
export interface DevBox {
|
|
13
|
+
readonly centre: readonly [number, number, number];
|
|
14
|
+
readonly half: readonly [number, number, number];
|
|
15
|
+
/** world rotation quaternion (x, y, z, w) */
|
|
16
|
+
readonly rotation: readonly [number, number, number, number];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The harness-port message that carries one part's boxes to the in-page server. */
|
|
20
|
+
export interface DevCollidersMessage { readonly wildshardDevColliders: string; readonly boxes: readonly DevBox[] }
|
|
21
|
+
|
|
22
|
+
const numbers = (value: unknown, length: number, above = -Infinity): boolean => Array.isArray(value) && value.length === length
|
|
23
|
+
&& value.every(n => typeof n === 'number' && Number.isFinite(n) && n > above);
|
|
24
|
+
const isBox = (value: unknown): value is DevBox => typeof value === 'object' && value !== null && 'centre' in value && numbers(value.centre, 3)
|
|
25
|
+
&& 'half' in value && numbers(value.half, 3, 0) && 'rotation' in value && numbers(value.rotation, 4);
|
|
26
|
+
|
|
27
|
+
export const isDevColliders = (value: unknown): value is DevCollidersMessage => typeof value === 'object' && value !== null
|
|
28
|
+
&& 'wildshardDevColliders' in value && typeof value.wildshardDevColliders === 'string' && 'boxes' in value && Array.isArray(value.boxes) && value.boxes.every(isBox);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Replace part `name`'s boxes in `physics`: the new set is made under a fresh child of `owner` first, then the old set's
|
|
32
|
+
* scope is disposed (its colliders leave the world with it). An empty set removes the part's boxes.
|
|
33
|
+
*/
|
|
34
|
+
export function swapDevBoxes(physics: Physics, owner: Scope, held: Map<string, Scope>, name: string, boxes: readonly DevBox[]): void {
|
|
35
|
+
const old = held.get(name);
|
|
36
|
+
if (boxes.length === 0) held.delete(name);
|
|
37
|
+
else {
|
|
38
|
+
const scope = owner.child(`devColliders.${name}`);
|
|
39
|
+
withOwner(scope, () => {
|
|
40
|
+
for (const box of boxes) physics.world.createCollider(physics.R.ColliderDesc.cuboid(...box.half)
|
|
41
|
+
.setTranslation(...box.centre).setRotation({ x: box.rotation[0], y: box.rotation[1], z: box.rotation[2], w: box.rotation[3] })
|
|
42
|
+
.setCollisionGroups(groups('WORLD')));
|
|
43
|
+
});
|
|
44
|
+
held.set(name, scope);
|
|
45
|
+
}
|
|
46
|
+
old?.dispose();
|
|
47
|
+
}
|
|
@@ -313,6 +313,14 @@ export class EliteCore<S extends EliteCoreScript> {
|
|
|
313
313
|
this.save();
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
/** SERVER-CELLS SC10: a served cell slept this long with nobody in it: a fallen lair's timer spends it (a dusk lair still waits for dusk). */
|
|
317
|
+
slept(seconds: number): void {
|
|
318
|
+
for (const e of this.entries) if ((e.state === 'dead' || e.state === 'absent') && e.timer > 0) {
|
|
319
|
+
e.timer = Math.max(0, e.timer - seconds);
|
|
320
|
+
if (e.timer === 0 && (e.script.def.rule === 'dusk' || e.script.def.rule === 'night')) e.waitDusk = true;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
316
324
|
/** Copy the lair rules only, preserving their historical wire field order and null last-hit sentinel. */
|
|
317
325
|
snapshot(): EliteCoreContinuation {
|
|
318
326
|
// A page's save can hold a lair this world has no row for: its record rides along, for the world that has one.
|
|
@@ -108,6 +108,9 @@ export class ResidencyAllocator {
|
|
|
108
108
|
if (!Number.isFinite(this.playing) || this.playing <= 0) throw new RangeError('Invalid residency envelope');
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
/** The playing envelope this allocator admits against (the tier's, else §3.2's). */
|
|
112
|
+
envelope(): number { return this.playing; }
|
|
113
|
+
|
|
111
114
|
/** Admit a claim, or share one already held under the same id; null when it cannot fit even after eviction. */
|
|
112
115
|
reserve(claim: ResidencyClaim): ResidencyLease | null { return this.reserveClaim(claim, 0); }
|
|
113
116
|
/** Speculative IO may use existing headroom, never evict another owner's ready world. */
|
|
@@ -16,6 +16,8 @@ export interface CatalogueDocument {
|
|
|
16
16
|
/** Parsed by `parseGridCatalogue`, which owns its shape. */
|
|
17
17
|
readonly grid: {readonly cells: readonly {readonly instance: string; readonly slug: string}[]};
|
|
18
18
|
readonly shards?: readonly CatalogueHead[];
|
|
19
|
+
/** The slugs a released page's placement file added to `grid` at runtime (SA33's file, `placedCells.ts`); never in a baked copy. */
|
|
20
|
+
readonly placed?: readonly string[];
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
const SLOT = Symbol.for('game.catalogue');
|
|
@@ -62,3 +64,8 @@ export function autoPlaced(row: {readonly slug: string}): boolean {
|
|
|
62
64
|
if (catalogue === undefined || catalogue.placements.some(placed => bareSlug(placed.slug) === bareSlug(row.slug))) return false;
|
|
63
65
|
return catalogue.grid.cells.some(cell => bareSlug(cell.slug) === bareSlug(row.slug));
|
|
64
66
|
}
|
|
67
|
+
/** A shard the API placed on this channel after the build (the placement file's cell, `placedCells.ts`): Shard Select cards it, an open
|
|
68
|
+
* plot or an auto-placed shard too, because with no crossing (staging's default) its card and `?chunk=` are the only ways in. */
|
|
69
|
+
export function placedByFile(row: {readonly slug: string}): boolean {
|
|
70
|
+
return installedCatalogue()?.placed?.some(slug => bareSlug(slug) === bareSlug(row.slug)) === true;
|
|
71
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SA33's placement file, read by both ends: the box (`src/server/host/dedicated/placementFile.ts`, Node's key check) and a released page
|
|
2
|
+
// (`src/client/game/grid/placedCells.ts`, WebCrypto). Game layer, so the page's grid code may read it.
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
/** SA33's placement file (`releases/<channel>-placements.json`), as the API signs it under its own placement key: every cell the API
|
|
5
|
+
* placed on one channel, in its grid's order. Read by both ends, as the release file is: the box by Node's key check
|
|
6
|
+
* (`placementFile.ts`), a released page by WebCrypto (`src/client/game/grid/placedCells.ts`). */
|
|
7
|
+
export interface PlacementFile {
|
|
8
|
+
/** Which kind of signed file this is, so a body can never be read as another kind's. */
|
|
9
|
+
readonly kind: 'placement';
|
|
10
|
+
readonly channel: 'production' | 'staging';
|
|
11
|
+
/** Rises with every write; an older file is never believed (J179). */
|
|
12
|
+
readonly serial: number;
|
|
13
|
+
/** SA47: `hash` is the channel pointer's shardfile (the raw upload), so a box whose build's book lacks the slug opens it from the
|
|
14
|
+
* cook's `index/<build>/<hash>.json`. A file from before SA47 names none. */
|
|
15
|
+
readonly cells: readonly { readonly instance: string; readonly slug: string; readonly cell: readonly [number, number]; readonly hash?: string }[];
|
|
16
|
+
}
|
|
17
|
+
const placedId = v.pipe(v.string(), v.regex(/^_?[a-z0-9]+(?:-[a-z0-9]+)*$/u), v.maxLength(64));
|
|
18
|
+
const placedSpot = v.pipe(v.number(), v.integer());
|
|
19
|
+
const placedHash = v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/u));
|
|
20
|
+
/** A placement file's body, once its signature has held. The spot's bounds are `placeCell`'s. */
|
|
21
|
+
export const PlacementSchema: v.GenericSchema<PlacementFile> = v.object({ kind: v.literal('placement'), channel: v.picklist(['production', 'staging']), serial: v.pipe(v.number(), v.integer(), v.minValue(0)),
|
|
22
|
+
cells: v.pipe(v.array(v.object({ instance: placedId, slug: placedId, cell: v.tuple([placedSpot, placedSpot]), hash: v.exactOptional(placedHash) })), v.maxLength(49)) });
|
|
23
|
+
/** The file on R2: the body as signed, and its signature in hex (as the release file's, `releaseRows.ts`). */
|
|
24
|
+
export const SignedPlacementSchema: v.GenericSchema<{ readonly body: string; readonly signature: string }> = v.object({ body: v.string(), signature: v.string() });
|
|
25
|
+
/** The API's placement key (SA33a, `~/.config/wildshard/placement-signing-key.pub.pem`), SPKI DER in hex: the box's PLACEMENT_PUBLIC_KEY. */
|
|
26
|
+
export const PLACEMENT_PUBLIC_KEY = '302a300506032b65700321004afd39342aac6a4de6066cb72e9df54cbd3d4eb522e5e6e175a17954ab98f25e';
|
|
27
|
+
/** A channel's placement file beside its release file: `…/releases/staging.json` → `…/releases/staging-placements.json`. Null for
|
|
28
|
+
* any other address, and for preview, whose page bakes staging's cells at deploy instead (SA35). */
|
|
29
|
+
export function placementsURL(release: string): string | null {
|
|
30
|
+
let url: URL;
|
|
31
|
+
try { url = new URL(release); } catch { return null; }
|
|
32
|
+
const channel = /^\/releases\/(staging|production)\.json$/u.exec(url.pathname)?.[1];
|
|
33
|
+
if (channel === undefined || url.search !== '' || url.hash !== '') return null;
|
|
34
|
+
url.pathname = `/releases/${channel}-placements.json`;
|
|
35
|
+
return url.href;
|
|
36
|
+
}
|
|
@@ -5,13 +5,14 @@ import { pageStateOf } from '../shardfile/runtimeState';
|
|
|
5
5
|
/** A boss row's two durable flags: beaten (its record's `defeated`) and paid (its record's `rewardTaken`). */
|
|
6
6
|
export interface BossRowFlagNames { readonly defeated: string; readonly paid: string }
|
|
7
7
|
/** The shard flags a boss record reads and writes. */
|
|
8
|
-
export interface BossRowFlags { has: (flag: string) => boolean; set: (flag: string) => void }
|
|
8
|
+
export interface BossRowFlags { has: (flag: string) => boolean; set: (flag: string, on?: boolean) => void }
|
|
9
9
|
|
|
10
10
|
/** A boss row's record kept on the shard's own flags (no save of its own): `saved` to start from, `persist` to write. */
|
|
11
11
|
export function bossFlagRecord(flags: BossRowFlags, names: BossRowFlagNames): { saved: BossSaved; persist: (value: BossSaved) => void } {
|
|
12
12
|
const defeated = flags.has(names.defeated);
|
|
13
13
|
return { saved: { defeated, rewardTaken: flags.has(names.paid), kills: defeated ? 1 : 0 },
|
|
14
|
-
|
|
14
|
+
// SC10: a record goes back to not beaten only when a served world's boss stands again (`returnBeaten`), and both flags clear with it
|
|
15
|
+
persist: (value) => { if (!value.defeated) { flags.set(names.defeated, false); flags.set(names.paid, false); return; } flags.set(names.defeated); if (value.rewardTaken) flags.set(names.paid); } };
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const finite = v.pipe(v.number(), v.finite());
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* missing target in the table's own order.
|
|
6
6
|
*
|
|
7
7
|
* A target is served when it is a file under `mounts/`, a `cook.json` mount row over a file the product holds, a product
|
|
8
|
-
* file at `/shardfiles/<slug>/<path>`, or an engine file: the caller says which URLs its host serves itself.
|
|
8
|
+
* file at `/shardfiles/<slug>/<path>`, or an engine file: the caller says which URLs its host serves itself. A `phone` row's
|
|
9
|
+
* target is also served when its source is (SHARD-SIZE S12d): the cook makes that phone file from the source, as a shard that
|
|
10
|
+
* dropped its hand-made phone set (Sky Reach rev 2 on) expects. */
|
|
9
11
|
|
|
10
12
|
/** Read access to one product: the paths it holds and the bytes of one of them. */
|
|
11
13
|
export interface Ktx2TableProduct {
|
|
@@ -34,13 +36,30 @@ export function ktx2TableTargets(table: unknown): readonly string[] {
|
|
|
34
36
|
return targets;
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
/** Each `phone` row's target and the source the cook makes it from when the product lacks it (`phoneTier`, S12d): a row whose
|
|
40
|
+
* source and target are the same kind of file (GLB or KTX2). */
|
|
41
|
+
export function phoneRowSources(table: unknown): ReadonlyMap<string, string> {
|
|
42
|
+
const rows = new Map<string, string>(), kind = (url: string): string | undefined => /\.(glb|ktx2)$/u.exec(url)?.[1];
|
|
43
|
+
const walk = (value: unknown): void => {
|
|
44
|
+
if (Array.isArray(value)) { for (const child of value) walk(child); return; }
|
|
45
|
+
if (!isRow(value)) return;
|
|
46
|
+
for (const [key, child] of Object.entries(value)) {
|
|
47
|
+
if (key === 'phone' && isRow(child)) {
|
|
48
|
+
for (const [source, target] of Object.entries(child)) if (typeof target === 'string' && kind(target) !== undefined && kind(source) === kind(target) && !rows.has(target)) rows.set(target, source);
|
|
49
|
+
} else walk(child);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
walk(table);
|
|
53
|
+
return rows;
|
|
54
|
+
}
|
|
55
|
+
|
|
37
56
|
/** The table's targets nothing serves, each once, first missing first. */
|
|
38
57
|
export function missingKtx2Targets(product: Ktx2TableProduct, engineFile: (url: string) => boolean = () => false): { readonly total: number; readonly missing: readonly string[] } {
|
|
39
58
|
const paths = new Set(product.paths());
|
|
40
59
|
const discovery = [...paths].find(path => DISCOVERY.test(path));
|
|
41
60
|
if (discovery === undefined) return { total: 0, missing: [] };
|
|
42
61
|
const document = parse(product.read(discovery), discovery);
|
|
43
|
-
const
|
|
62
|
+
const table = isRow(document) && isRow(document['native']) ? document['native']['ktx2'] : undefined, targets = ktx2TableTargets(table);
|
|
44
63
|
if (targets.length === 0) return { total: 0, missing: [] };
|
|
45
64
|
const mounted = new Set<string>();
|
|
46
65
|
if (paths.has('cook.json')) {
|
|
@@ -51,7 +70,8 @@ export function missingKtx2Targets(product: Ktx2TableProduct, engineFile: (url:
|
|
|
51
70
|
const home = `/shardfiles/${DISCOVERY.exec(discovery)?.[1] ?? ''}/`;
|
|
52
71
|
const served = (url: string): boolean => paths.has(`mounts${url}`) || mounted.has(url)
|
|
53
72
|
|| (url.startsWith(home) && paths.has(url.slice(home.length))) || engineFile(url);
|
|
54
|
-
|
|
73
|
+
const cooked = phoneRowSources(table), made = (url: string): boolean => { const source = cooked.get(url); return source !== undefined && served(source); };
|
|
74
|
+
return { total: targets.length, missing: [...new Set(targets.filter(url => !served(url) && !made(url)))] };
|
|
55
75
|
}
|
|
56
76
|
|
|
57
77
|
/** Refuse a product whose KTX2 table names a file nothing serves. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { outputBlobPath } from '@wildshard/format/outputAddress';
|
|
2
|
-
import { packReads } from './packReads';
|
|
2
|
+
import { packOrLoose, packReads } from './packReads';
|
|
3
3
|
import type { OutputIndex } from '@wildshard/format/outputIndex';
|
|
4
4
|
import { assembleOutputTransport } from '@wildshard/format/outputFields';
|
|
5
5
|
import { isJsonDataWithFileSchemas } from '@wildshard/format/json';
|
|
6
|
-
import { builtValidationReceipt,
|
|
6
|
+
import { builtValidationReceipt, builtShardfileResidency, validationSourceBytes, validationSourceBytesPaced, type ValidationReceipt } from '@wildshard/format/validationReceipt';
|
|
7
7
|
import { diagnosticNow } from '@wildshard/engine/core/clock';
|
|
8
8
|
import { parseOutputLineageIndex } from '@wildshard/format/stateLineage';
|
|
9
9
|
import type { Shardfile } from '@wildshard/format/shardSchema';
|
|
@@ -167,7 +167,7 @@ async function readBuiltOutput(index:OutputIndex,reader:OutputDescriptorReader,b
|
|
|
167
167
|
for(const value of values){if(value.status==='rejected')throw value.reason;sections.set(...value.value);}
|
|
168
168
|
const source=assembleOutputTransport(index,sections);
|
|
169
169
|
if(!isBuiltClientSource(source,reader))throw new Error('Built output needs its first-party reader');
|
|
170
|
-
const residentBytes=
|
|
170
|
+
const residentBytes=builtShardfileResidency(index.build.sourceHash);
|
|
171
171
|
buildValidated.add(source);descriptors.set(source.files,{index,sections,cached:false,indexHash:built.indexHash,built:true,...(residentBytes===undefined?{}:{residentBytes})});
|
|
172
172
|
return source;
|
|
173
173
|
}
|
|
@@ -236,8 +236,12 @@ export async function resolveOutputDescriptor(input: unknown, reader: OutputDesc
|
|
|
236
236
|
reader.cacheHit?.(section.path, section.hash, bytes.length);
|
|
237
237
|
} else if (bytes === null || bytes === undefined) {
|
|
238
238
|
if (reader.offline) throw new IncompleteOutputCacheError();
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
// PZ7: a pack that is not published (or fails) falls back to the section's own read
|
|
240
|
+
if (inPack && packed !== undefined) {
|
|
241
|
+
let fromPack = true;
|
|
242
|
+
bytes = await packOrLoose(() => packed.read(section.hash), () => { fromPack = false; return reader.read(section.path, section.bytes); });
|
|
243
|
+
if (fromPack) reader.packedHit?.(section.path, section.hash);
|
|
244
|
+
} else bytes = await reader.read(section.path, section.bytes);
|
|
241
245
|
if (bytes.length !== section.bytes || await reader.hash(bytes) !== section.hash) throw new Error('Shardfile section hash or size mismatch');
|
|
242
246
|
if (reader.backgroundStore !== undefined) {
|
|
243
247
|
// A scheduled write is not durable cache proof. Complete offline
|
|
@@ -7,6 +7,28 @@ const sharedPacks = new WeakMap<object, Map<string, SharedPack>>();
|
|
|
7
7
|
/** MF7: the packs a finished boot let go (`hash:bytes`), and every owner table that may hold each one */
|
|
8
8
|
const releasedPacks = new Set<string>();
|
|
9
9
|
const holders = new Map<string, WeakRef<Map<string, Promise<Uint8Array>>>[]>();
|
|
10
|
+
/** PAGE-SIZE PZ7: packs whose read failed (dropped from the CDN, or not reachable): every later member of one reads its
|
|
11
|
+
* loose blob at once, so a dropped pack costs one failed request per page, not one per member. */
|
|
12
|
+
const missingPacks = new Set<string>();
|
|
13
|
+
interface PackName { readonly hash: string; readonly bytes: number }
|
|
14
|
+
const packKey = (pack: PackName): string => `${pack.hash}:${pack.bytes}`;
|
|
15
|
+
const aborted = (error: unknown): boolean => error instanceof Error && error.name === 'AbortError';
|
|
16
|
+
/** a pack that came back wrong (other bytes, a partial or oversized response) is refused, never read around: the
|
|
17
|
+
* corruption guards stand, and a repaired read may retry it. Only a pack that is gone (404, network) reads loose (PZ7). */
|
|
18
|
+
const refused = (error: unknown): boolean => error instanceof Error && /mismatch|whole response|exceeds/u.test(error.message);
|
|
19
|
+
/** whether a failed pack read means the pack is gone (PZ7): not an abort, not a refusal of its bytes */
|
|
20
|
+
export function packGone(error: unknown): boolean { return !aborted(error) && !refused(error); }
|
|
21
|
+
/** whether a read of `pack` failed earlier in this page (PZ7): read its members loose */
|
|
22
|
+
export function packMissing(pack: PackName): boolean { return missingPacks.has(packKey(pack)); }
|
|
23
|
+
/** remember a pack that is gone (PZ7): its read failed for a reason other than an abort or a refusal of its bytes */
|
|
24
|
+
export function markPackMissing(pack: PackName, error: unknown): void { if (packGone(error)) missingPacks.add(packKey(pack)); }
|
|
25
|
+
/** PZ7: a member from its pack, or from its loose blob when the pack is gone; an abort or a refused pack still throws */
|
|
26
|
+
export async function packOrLoose(read: () => Promise<Uint8Array>, loose: () => Promise<Uint8Array>): Promise<Uint8Array> {
|
|
27
|
+
let bytes: Uint8Array;
|
|
28
|
+
try { bytes = await read(); }
|
|
29
|
+
catch (error: unknown) { if (!packGone(error)) throw error; return loose(); }
|
|
30
|
+
return bytes;
|
|
31
|
+
}
|
|
10
32
|
|
|
11
33
|
/** One verified whole GET per immutable index inventory, shared across admission
|
|
12
34
|
* and later demand waves. Failed attempts leave no retained rejection. The weak
|
|
@@ -16,7 +38,8 @@ export function readPackWhole(owner: object, pack: Pack,
|
|
|
16
38
|
if (pack.bytes < 1 || pack.bytes > 4_194_304) return Promise.reject(new Error('Shardfile pack size exceeds 4 MiB'));
|
|
17
39
|
let whole = wholePacks.get(owner);
|
|
18
40
|
if (whole === undefined) { whole = new Map(); wholePacks.set(owner, whole); }
|
|
19
|
-
const key =
|
|
41
|
+
const key = packKey(pack), previous = whole.get(key);
|
|
42
|
+
if (missingPacks.has(key)) return Promise.reject(new Error('Shardfile pack is missing'));
|
|
20
43
|
if (previous !== undefined) return previous;
|
|
21
44
|
let shared = sharedPacks.get(identity);
|
|
22
45
|
if (shared === undefined) { shared = new Map(); sharedPacks.set(identity, shared); }
|
|
@@ -32,7 +55,9 @@ export function readPackWhole(owner: object, pack: Pack,
|
|
|
32
55
|
if (known?.pending !== undefined) { held.set(key, known.pending); forget(known.pending); return known.pending; }
|
|
33
56
|
if (present !== undefined) { const borrowed = Promise.resolve(present); if (keep) { held.set(key, borrowed); forget(borrowed); } return borrowed; }
|
|
34
57
|
const bytes = (async () => {
|
|
35
|
-
|
|
58
|
+
let wire: Uint8Array;
|
|
59
|
+
try { wire = await read(pack.path, pack.bytes, pack.entries); }
|
|
60
|
+
catch (error: unknown) { markPackMissing(pack, error); throw error; }
|
|
36
61
|
if (wire.length !== pack.bytes || await hash(wire) !== pack.hash) throw new Error('Shardfile pack hash or size mismatch');
|
|
37
62
|
return wire;
|
|
38
63
|
})();
|
|
@@ -82,7 +107,7 @@ export function packReads(packs: OutputIndex['packs'], members: ReadonlySet<stri
|
|
|
82
107
|
}
|
|
83
108
|
}
|
|
84
109
|
return {
|
|
85
|
-
has: member => where.
|
|
110
|
+
has: member => { const at = where.get(member); return at !== undefined && !missingPacks.has(packKey(at.pack)); },
|
|
86
111
|
read: async member => {
|
|
87
112
|
const at = where.get(member);
|
|
88
113
|
if (at === undefined) throw new Error('Not a packed member');
|
|
@@ -14,6 +14,15 @@ const ServerPackSchema: v.GenericSchema<ServerPack> = v.strictObject({...partEnt
|
|
|
14
14
|
const ServerPackBookSchema: v.GenericSchema<ServerPackBook> = v.strictObject({book: v.literal('server'), build: v.string(), shards: v.record(v.string(), ServerPackSchema), grid: v.exactOptional(ServerPackSchema)});
|
|
15
15
|
export const serverPackBookPath = (build: string): string => `assets/spawn/server-${build}.json`;
|
|
16
16
|
export const readServerPackBook = (input: unknown): ServerPackBook => v.parse(ServerPackBookSchema, input);
|
|
17
|
+
/** One shard's pack, as the cook writes it beside its parts (`assets/spawn/server-<slug>-<hash16>.json`). */
|
|
18
|
+
export const readServerPack = (input: unknown): ServerPack => v.parse(ServerPackSchema, input);
|
|
19
|
+
/** J83, MS2.4: the cook's index of one shard's bytes (its shardfile hash) for one build, written last, so a shard is cooked when it exists. */
|
|
20
|
+
export const cookIndexPath = (build: string, hash: string): string => `index/${build}/${hash}.json`;
|
|
21
|
+
/** SA47: what a server reads of a cook index: whose it is, and where its server pack is (an index from before C2 names none). */
|
|
22
|
+
export interface CookedServerIndex {readonly build: string; readonly slug: string; readonly hash: string; readonly serverPack?: {readonly index: string}}
|
|
23
|
+
const CookedServerIndexSchema: v.GenericSchema<CookedServerIndex> = v.object({build: v.string(), slug: v.string(), hash: v.string(),
|
|
24
|
+
serverPack: v.exactOptional(v.object({index: v.pipe(v.string(), v.regex(/^\/assets\/spawn\/server-[a-z0-9_-]+-[a-f0-9]{16}\.json$/u))}))});
|
|
25
|
+
export const readCookedServerIndex = (input: unknown): CookedServerIndex => v.parse(CookedServerIndexSchema, input);
|
|
17
26
|
/** The part of a pack that holds a file. */
|
|
18
27
|
export const serverPackPart = (pack: ServerPack, path: string): ServerPackPart | undefined => [pack, ...pack.more ?? []].find(part => part.files.some(file => file[0] === path));
|
|
19
28
|
/** One file's bytes inside its part's decoded body. */
|
|
@@ -76,6 +76,8 @@ export function installTrampleTrail(host: SimHost, map: TrampleField, rows: { id
|
|
|
76
76
|
own.push(dt, at, rows.radius, rows.strength);
|
|
77
77
|
}
|
|
78
78
|
if (window !== null) map.update(dt, window);
|
|
79
|
+
// SC10 (J328): a long-lived world forgets the trails of those who left
|
|
80
|
+
if (others.size >= host.players.size) for (const id of others.keys()) if (!host.players.has(id)) others.delete(id);
|
|
79
81
|
}, { snapshot: () => others.size === 0 ? trail.snapshot() : { ...trail.snapshot(), others: Object.fromEntries([...others].map(([id, own]) => [id, own.last()])) },
|
|
80
82
|
restore: saved => {
|
|
81
83
|
trail.restore(saved); others.clear();
|
|
@@ -116,7 +116,7 @@ import { AudioRoutingSchema } from '@wildshard/format/audioRouting';
|
|
|
116
116
|
import { AudioDataSchema } from '@wildshard/format/audio';
|
|
117
117
|
import { LedgerFactSchema, LedgerRulesSchema } from '@wildshard/format/ledger';
|
|
118
118
|
import { DirectorSchema } from '@wildshard/format/director';
|
|
119
|
-
import {
|
|
119
|
+
import { DirectorDocumentSchema } from '@wildshard/format/directorDocument';
|
|
120
120
|
import { DirectorStagesSchema } from '@wildshard/format/directorStages';
|
|
121
121
|
import { LogicalStateSchema, MigrationsSchema } from '@wildshard/format/migrations';
|
|
122
122
|
import { TraversalSchema } from '@wildshard/format/traversal';
|
|
@@ -355,7 +355,7 @@ const wireRoots: Readonly<Record<string, GenericSchema>> = {
|
|
|
355
355
|
'ledger.LedgerFact': LedgerFactSchema,
|
|
356
356
|
'ledger.LedgerRules': LedgerRulesSchema,
|
|
357
357
|
'director.Director': DirectorSchema,
|
|
358
|
-
'directorProduct.DirectorProduct':
|
|
358
|
+
'directorProduct.DirectorProduct': DirectorDocumentSchema,
|
|
359
359
|
'directorStages.DirectorStages': DirectorStagesSchema,
|
|
360
360
|
'migrations.LogicalState': LogicalStateSchema,
|
|
361
361
|
'migrations.Migrations': MigrationsSchema,
|
package/src/tsconfig.json
CHANGED
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"target": "es2024",
|
|
4
|
-
"strict": true,
|
|
5
|
-
"noUncheckedIndexedAccess": true,
|
|
6
|
-
"exactOptionalPropertyTypes": true,
|
|
7
|
-
"noImplicitOverride": true,
|
|
8
|
-
"noImplicitReturns": true,
|
|
9
|
-
"noFallthroughCasesInSwitch": true,
|
|
10
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
11
|
-
"noUnusedLocals": true,
|
|
12
|
-
"noUnusedParameters": true,
|
|
13
|
-
"allowUnreachableCode": false,
|
|
14
|
-
"allowUnusedLabels": false,
|
|
15
|
-
"useUnknownInCatchVariables": true,
|
|
16
|
-
"verbatimModuleSyntax": true,
|
|
17
|
-
"erasableSyntaxOnly": true,
|
|
18
|
-
"isolatedModules": true,
|
|
19
|
-
"allowImportingTsExtensions": true,
|
|
20
|
-
"resolveJsonModule": true,
|
|
21
|
-
"forceConsistentCasingInFileNames": true,
|
|
22
|
-
"skipLibCheck": true,
|
|
23
|
-
"module": "nodenext",
|
|
24
|
-
"moduleResolution": "nodenext",
|
|
25
|
-
"lib": ["es2024"],
|
|
26
|
-
"types": ["node"],
|
|
27
|
-
"noEmit": true
|
|
28
|
-
},
|
|
2
|
+
"extends": "../kit/tsconfig.json",
|
|
29
3
|
"include": [
|
|
30
4
|
"cli",
|
|
31
5
|
"test/helpers",
|
package/lint/host-reviews.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema": "wildshard.host-reviews/1",
|
|
3
|
-
"entries": {
|
|
4
|
-
"src/client/engine/world/painterly.ts#*": {
|
|
5
|
-
"sourceHash": "1a3811e00a1c5d7930c77a856307fa91707265a4711b62a32dab4331591c57be",
|
|
6
|
-
"evidence": "G456 H1 frozen-body exception: content owner Nalati. Retained edges: nalati-grasslands-legacy/look/terrainPainter.ts, look/creatureMaterial.ts, world/glbPaint.ts -> painterlyMaterial/painterlyKnobs; game/client/grid/regionLight.ts -> shared uniform state. Not a second-user claim; content bodies remain charged to their owning shard.",
|
|
7
|
-
"verdicts": {
|
|
8
|
-
"twoRealUsers": "fail",
|
|
9
|
-
"noShardNouns": "fail",
|
|
10
|
-
"deletionTest": "fail"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema": 1,
|
|
3
|
-
"shards": {
|
|
4
|
-
"far-reach": [],
|
|
5
|
-
"sunscar-dunes": [],
|
|
6
|
-
"pine-hollow": [
|
|
7
|
-
{ "path": "src/client/game/quest/chapterDirector.ts", "name": "installChapterLead", "reason": "The remaining lead presentation reads the existing AS channels and presents its view.", "decision": "G570" }
|
|
8
|
-
],
|
|
9
|
-
"driftwood-isle": [],
|
|
10
|
-
"nalati-grasslands": [],
|
|
11
|
-
"nine-dragon-stack": []
|
|
12
|
-
}
|
|
13
|
-
}
|