castle-web-cli 0.4.232 → 0.4.234
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/dist/agent-failures.d.ts +8 -0
- package/dist/agent-failures.js +19 -2
- package/dist/agent-prompts.d.ts +1 -1
- package/dist/agent-prompts.js +10 -3
- package/dist/agent.d.ts +64 -3
- package/dist/agent.js +170 -81
- package/dist/api.d.ts +11 -0
- package/dist/api.js +43 -0
- package/dist/bundle.d.ts +64 -0
- package/dist/bundle.js +558 -2
- package/dist/castle-host/host.d.ts +18 -2
- package/dist/castle-host/host.js +844 -39
- package/dist/castleJson.d.ts +23 -2
- package/dist/castleJson.js +46 -2
- package/dist/check.d.ts +3 -1
- package/dist/check.js +20 -3
- package/dist/chunkLoader.d.ts +3 -0
- package/dist/chunkLoader.js +111 -0
- package/dist/devParty.d.ts +26 -0
- package/dist/devParty.js +231 -0
- package/dist/devSaveStorage.js +4 -0
- package/dist/devSessionStorage.js +50 -2
- package/dist/devSocial.d.ts +24 -0
- package/dist/devSocial.js +70 -0
- package/dist/ide.d.ts +2 -0
- package/dist/ide.js +119 -15
- package/dist/importPinMismatch.d.ts +22 -0
- package/dist/importPinMismatch.js +77 -0
- package/dist/importRegression.js +3 -15
- package/dist/imports.d.ts +10 -3
- package/dist/imports.js +88 -20
- package/dist/index.js +11 -4
- package/dist/init.js +1 -1
- package/dist/platformDoc.js +22 -0
- package/dist/routerFences.d.ts +5 -0
- package/dist/routerFences.js +12 -2
- package/dist/save-deck.d.ts +25 -1
- package/dist/save-deck.js +178 -9
- package/dist/serve.js +32 -11
- package/dist/shell/assets/{index-D2tWM896.js → index-DulbYIJm.js} +97 -97
- package/dist/shell/assets/index-MVLfNYd9.css +1 -0
- package/dist/shell/index.html +2 -2
- package/dist/taskSteer.d.ts +13 -0
- package/dist/taskSteer.js +22 -2
- package/dist/vitePlugins.d.ts +2 -1
- package/dist/vitePlugins.js +13 -0
- package/kits/base/castle.json +1 -1
- package/kits/base/package-lock.json +1 -1
- package/kits/base/sdk/README.md +339 -5
- package/kits/base/sdk/avatar.d.ts +6 -2
- package/kits/base/sdk/avatar.js +12 -4
- package/kits/base/sdk/castle.d.ts +7 -3
- package/kits/base/sdk/castle.js +2 -0
- package/kits/base/sdk/commands.d.ts +176 -1
- package/kits/base/sdk/commands.js +3 -0
- package/kits/base/sdk/display.d.ts +3 -0
- package/kits/base/sdk/display.js +9 -3
- package/kits/base/sdk/hub.d.ts +37 -6
- package/kits/base/sdk/hub.js +63 -4
- package/kits/base/sdk/multiplayer.d.ts +7 -1
- package/kits/base/sdk/multiplayer.js +148 -32
- package/kits/base/sdk/multiplayerProtocol.d.ts +2 -0
- package/kits/base/sdk/party.d.ts +23 -0
- package/kits/base/sdk/party.js +91 -0
- package/kits/base/sdk/reconnectBudget.d.ts +23 -0
- package/kits/base/sdk/reconnectBudget.js +96 -0
- package/kits/base/sdk/save.d.ts +38 -1
- package/kits/base/sdk/save.js +81 -7
- package/kits/base/sdk/server/hub.d.ts +117 -0
- package/kits/base/sdk/server/hub.js +119 -2
- package/kits/base/sdk/server/platformHandle.d.ts +43 -1
- package/kits/base/sdk/server/storage.d.ts +17 -0
- package/kits/base/sdk/server/storage.js +65 -3
- package/kits/base/sdk/server/wrapper.d.ts +43 -6
- package/kits/base/sdk/server/wrapper.js +93 -9
- package/kits/base/sdk/social.d.ts +9 -0
- package/kits/base/sdk/social.js +5 -0
- package/kits/hub-game/CLAUDE.md +451 -13
- package/kits/hub-game/README.md +63 -0
- package/kits/hub-game/blueprints/avatar-10.scene +28 -0
- package/kits/hub-game/blueprints/avatar-11.scene +28 -0
- package/kits/hub-game/blueprints/avatar-12.scene +28 -0
- package/kits/hub-game/blueprints/avatar-13.scene +28 -0
- package/kits/hub-game/blueprints/avatar-14.scene +28 -0
- package/kits/hub-game/blueprints/avatar-15.scene +28 -0
- package/kits/hub-game/blueprints/avatar-4.scene +28 -0
- package/kits/hub-game/blueprints/avatar-5.scene +28 -0
- package/kits/hub-game/blueprints/avatar-6.scene +28 -0
- package/kits/hub-game/blueprints/avatar-7.scene +28 -0
- package/kits/hub-game/blueprints/avatar-8.scene +28 -0
- package/kits/hub-game/blueprints/avatar-9.scene +28 -0
- package/kits/hub-game/castle.json +5 -5
- package/kits/hub-game/code/client/act.js +312 -0
- package/kits/hub-game/code/client/actionLayout.js +147 -0
- package/kits/hub-game/code/client/actionOverflow.js +556 -0
- package/kits/hub-game/code/client/actorBudget.js +47 -0
- package/kits/hub-game/code/client/arrivalCamera.js +50 -0
- package/kits/hub-game/code/client/askSlot.js +117 -0
- package/kits/hub-game/code/client/attention.js +11 -2
- package/kits/hub-game/code/client/avatar.js +311 -35
- package/kits/hub-game/code/client/avatarCap.js +228 -0
- package/kits/hub-game/code/client/avatarColors.js +70 -0
- package/kits/hub-game/code/client/avatarFaces.js +21 -0
- package/kits/hub-game/code/client/avatarShare.js +253 -0
- package/kits/hub-game/code/client/backVisibility.js +13 -0
- package/kits/hub-game/code/client/ballot.js +472 -0
- package/kits/hub-game/code/client/build.js +38 -0
- package/kits/hub-game/code/client/chat.js +41 -5
- package/kits/hub-game/code/client/chatModeration.js +5 -0
- package/kits/hub-game/code/client/chrome.js +2144 -160
- package/kits/hub-game/code/client/companion.js +716 -0
- package/kits/hub-game/code/client/companionDress.js +99 -0
- package/kits/hub-game/code/client/crowdNames.js +241 -0
- package/kits/hub-game/code/client/decor.js +515 -0
- package/kits/hub-game/code/client/defaultEnvironment.js +194 -0
- package/kits/hub-game/code/client/doorErrors.js +39 -0
- package/kits/hub-game/code/client/earned.js +131 -0
- package/kits/hub-game/code/client/emoteBubble.js +75 -0
- package/kits/hub-game/code/client/fall.js +18 -0
- package/kits/hub-game/code/client/farAvatars.js +233 -0
- package/kits/hub-game/code/client/firstJoin.js +9 -2
- package/kits/hub-game/code/client/fpsTelemetry.js +50 -0
- package/kits/hub-game/code/client/frameBatch.js +5 -0
- package/kits/hub-game/code/client/grab.js +368 -29
- package/kits/hub-game/code/client/hookLayer.js +385 -20
- package/kits/hub-game/code/client/hudCopy.js +51 -0
- package/kits/hub-game/code/client/hudRate.js +20 -0
- package/kits/hub-game/code/client/idle.js +177 -24
- package/kits/hub-game/code/client/interestCap.js +81 -0
- package/kits/hub-game/code/client/invites.js +231 -0
- package/kits/hub-game/code/client/joinError.js +9 -0
- package/kits/hub-game/code/client/keys.js +36 -0
- package/kits/hub-game/code/client/labelsNear.js +234 -0
- package/kits/hub-game/code/client/landscapeLayout.js +17 -0
- package/kits/hub-game/code/client/layoutCache.js +264 -0
- package/kits/hub-game/code/client/loadTelemetry.js +20 -0
- package/kits/hub-game/code/client/loadingCover.js +148 -0
- package/kits/hub-game/code/client/loadingEntry.js +8 -0
- package/kits/hub-game/code/client/menuIcons.js +34 -0
- package/kits/hub-game/code/client/menuRows.js +43 -0
- package/kits/hub-game/code/client/modelReady.js +7 -0
- package/kits/hub-game/code/client/pack.js +6 -2
- package/kits/hub-game/code/client/packFormat.js +3 -3
- package/kits/hub-game/code/client/padCueArrival.js +23 -0
- package/kits/hub-game/code/client/padCues.js +112 -0
- package/kits/hub-game/code/client/padOccupancy.js +88 -0
- package/kits/hub-game/code/client/padReadability.js +26 -0
- package/kits/hub-game/code/client/padRings.js +69 -0
- package/kits/hub-game/code/client/pushVisit.js +14 -0
- package/kits/hub-game/code/client/quality.js +205 -0
- package/kits/hub-game/code/client/qualityEntry.js +55 -0
- package/kits/hub-game/code/client/rehello.js +167 -0
- package/kits/hub-game/code/client/safeLayout.js +338 -0
- package/kits/hub-game/code/client/safeStyle.js +42 -0
- package/kits/hub-game/code/client/say.js +12 -3
- package/kits/hub-game/code/client/shot.js +146 -0
- package/kits/hub-game/code/client/shotFit.js +56 -0
- package/kits/hub-game/code/client/signIn.js +28 -0
- package/kits/hub-game/code/client/sound.js +63 -8
- package/kits/hub-game/code/client/soundscape.js +1151 -0
- package/kits/hub-game/code/client/soundscapeActions.js +99 -0
- package/kits/hub-game/code/client/soundscapeAmbience.js +453 -0
- package/kits/hub-game/code/client/soundscapeBaked.js +143 -0
- package/kits/hub-game/code/client/soundscapeBusker.js +217 -0
- package/kits/hub-game/code/client/soundscapeCourt.js +200 -0
- package/kits/hub-game/code/client/soundscapeCrowd.js +331 -0
- package/kits/hub-game/code/client/soundscapeCues.js +362 -0
- package/kits/hub-game/code/client/soundscapeMap.js +181 -0
- package/kits/hub-game/code/client/soundscapeMarket.js +176 -0
- package/kits/hub-game/code/client/soundscapeMusic.js +126 -0
- package/kits/hub-game/code/client/soundscapeMusicEngine.js +460 -0
- package/kits/hub-game/code/client/soundscapeSimlish.js +737 -0
- package/kits/hub-game/code/client/soundscapeSongs.js +127 -0
- package/kits/hub-game/code/client/soundscapeSongsRound3.js +63 -0
- package/kits/hub-game/code/client/soundscapeSynthesis.js +168 -0
- package/kits/hub-game/code/client/soundscapeUi.js +211 -0
- package/kits/hub-game/code/client/soundscapeVoice.js +1209 -0
- package/kits/hub-game/code/client/soundscapeWaves.js +206 -0
- package/kits/hub-game/code/client/spin.js +101 -0
- package/kits/hub-game/code/client/state.js +162 -1
- package/kits/hub-game/code/client/stuck.js +259 -0
- package/kits/hub-game/code/client/talk.js +714 -59
- package/kits/hub-game/code/client/tiers.js +543 -52
- package/kits/hub-game/code/client/toastBand.js +37 -0
- package/kits/hub-game/code/client/together.js +39 -2
- package/kits/hub-game/code/client/visibility.js +43 -0
- package/kits/hub-game/code/client/weakestLookBake.js +92 -0
- package/kits/hub-game/code/client/weakestTier.js +295 -0
- package/kits/hub-game/code/client/wear.js +461 -170
- package/kits/hub-game/code/client/worldLabels.js +241 -0
- package/kits/hub-game/code/client/yours.js +200 -0
- package/kits/hub-game/code/companionSpec.js +45 -0
- package/kits/hub-game/code/npcDisplayText.js +55 -0
- package/kits/hub-game/code/privateText.js +7 -0
- package/kits/hub-game/code/server/act.js +124 -0
- package/kits/hub-game/code/server/actions.js +138 -0
- package/kits/hub-game/code/server/actors.js +11 -2
- package/kits/hub-game/code/server/analytics.js +83 -0
- package/kits/hub-game/code/server/anonymousEntry.js +49 -0
- package/kits/hub-game/code/server/arrivalPose.js +36 -0
- package/kits/hub-game/code/server/ask.js +155 -0
- package/kits/hub-game/code/server/ballot.js +539 -0
- package/kits/hub-game/code/server/cells.js +100 -0
- package/kits/hub-game/code/server/companion.js +107 -0
- package/kits/hub-game/code/server/cues.js +70 -0
- package/kits/hub-game/code/server/decor.js +269 -0
- package/kits/hub-game/code/server/doorAnalytics.js +52 -0
- package/kits/hub-game/code/server/earned.js +478 -0
- package/kits/hub-game/code/server/frameBatch.js +183 -0
- package/kits/hub-game/code/server/friendBests.js +166 -0
- package/kits/hub-game/code/server/friendsAmong.js +272 -0
- package/kits/hub-game/code/server/history.js +7 -0
- package/kits/hub-game/code/server/hub.js +2510 -95
- package/kits/hub-game/code/server/idle.js +60 -12
- package/kits/hub-game/code/server/index.js +28 -6
- package/kits/hub-game/code/server/invites.js +19 -0
- package/kits/hub-game/code/server/labels.js +36 -2
- package/kits/hub-game/code/server/loadAbandon.js +106 -0
- package/kits/hub-game/code/server/manifest.js +586 -7
- package/kits/hub-game/code/server/menu.js +161 -0
- package/kits/hub-game/code/server/npcs.js +1025 -113
- package/kits/hub-game/code/server/observe.js +408 -0
- package/kits/hub-game/code/server/padOccupancy.js +85 -0
- package/kits/hub-game/code/server/party.js +2 -2
- package/kits/hub-game/code/server/players.js +30 -0
- package/kits/hub-game/code/server/resumePose.js +152 -0
- package/kits/hub-game/code/server/say.js +1 -1
- package/kits/hub-game/code/server/shot.js +110 -0
- package/kits/hub-game/code/server/standing.js +123 -0
- package/kits/hub-game/code/server/storageLimit.js +187 -0
- package/kits/hub-game/code/server/vis.js +175 -0
- package/kits/hub-game/code/server/wear.js +12 -0
- package/kits/hub-game/code/server/yours.js +59 -0
- package/kits/hub-game/code/shared/act.js +35 -0
- package/kits/hub-game/code/shared/cues.js +9 -0
- package/kits/hub-game/code/shared/danceIdle.js +28 -0
- package/kits/hub-game/code/shared/decor.js +41 -0
- package/kits/hub-game/code/shared/loadStages.js +12 -0
- package/kits/hub-game/code/shared/quality.js +74 -0
- package/kits/hub-game/code/shared/say.js +2 -0
- package/kits/hub-game/code/shared/shot.js +53 -0
- package/kits/hub-game/code/shared/spin.js +57 -0
- package/kits/hub-game/code/systems/hub.js +1753 -202
- package/kits/hub-game/docs/analytics.md +279 -0
- package/kits/hub-game/docs/content-pack.md +1 -1
- package/kits/hub-game/docs/contract.md +3475 -77
- package/kits/hub-game/docs/home-pieces.md +71 -0
- package/kits/hub-game/docs/observed-progress.md +252 -0
- package/kits/hub-game/main.jsx +2 -0
- package/kits/hub-game/models/avatar-10.pxmodel +28 -0
- package/kits/hub-game/models/avatar-11.pxmodel +28 -0
- package/kits/hub-game/models/avatar-12.pxmodel +27 -0
- package/kits/hub-game/models/avatar-13.pxmodel +24 -0
- package/kits/hub-game/models/avatar-14.pxmodel +29 -0
- package/kits/hub-game/models/avatar-15.pxmodel +24 -0
- package/kits/hub-game/models/avatar-4.pxmodel +29 -0
- package/kits/hub-game/models/avatar-5.pxmodel +27 -0
- package/kits/hub-game/models/avatar-6.pxmodel +26 -0
- package/kits/hub-game/models/avatar-7.pxmodel +25 -0
- package/kits/hub-game/models/avatar-8.pxmodel +24 -0
- package/kits/hub-game/models/avatar-9.pxmodel +30 -0
- package/kits/hub-game/models/earned/badge-round.pxmodel +100 -0
- package/kits/hub-game/models/earned/badge-shield.pxmodel +117 -0
- package/kits/hub-game/models/earned/badge-star.pxmodel +87 -0
- package/kits/hub-game/models/earned/belt-plain.pxmodel +72 -0
- package/kits/hub-game/models/earned/held-ball.pxmodel +43 -0
- package/kits/hub-game/models/earned/held-lantern.pxmodel +85 -0
- package/kits/hub-game/models/earned/held-net.pxmodel +57 -0
- package/kits/hub-game/models/earned/held-trophy.pxmodel +109 -0
- package/kits/hub-game/models/earned/pin-round.pxmodel +62 -0
- package/kits/hub-game/models/earned/sash-plain.pxmodel +66 -0
- package/kits/hub-game/models/earned/square/belt-plain.pxmodel +104 -0
- package/kits/hub-game/models/earned/square/sash-plain.pxmodel +98 -0
- package/kits/hub-game/models/hats/bat-clip.pxmodel +206 -0
- package/kits/hub-game/models/hats/beekeeper.pxmodel +149 -0
- package/kits/hub-game/models/hats/cap.pxmodel +162 -0
- package/kits/hub-game/models/hats/captain.pxmodel +178 -0
- package/kits/hub-game/models/hats/crooked-top.pxmodel +172 -0
- package/kits/hub-game/models/hats/flower-crown.pxmodel +451 -0
- package/kits/hub-game/models/hats/foam-crown.pxmodel +179 -0
- package/kits/hub-game/models/hats/lantern.pxmodel +230 -0
- package/kits/hub-game/models/hats/laurel.pxmodel +533 -0
- package/kits/hub-game/models/hats/lighthouse.pxmodel +96 -0
- package/kits/hub-game/models/hats/sailor.pxmodel +141 -0
- package/kits/hub-game/models/hats/souwester.pxmodel +131 -0
- package/kits/hub-game/models/hats/straw.pxmodel +139 -0
- package/kits/hub-game/models/hats/sunflower.pxmodel +406 -0
- package/kits/hub-game/models/hats/sweatband.pxmodel +112 -0
- package/kits/hub-game/models/hats/witch.pxmodel +147 -0
- package/kits/hub-game/package-lock.json +10 -1
- package/kits/hub-game/package.json +6 -2
- package/kits/hub-game/play/player.js +142 -0
- package/kits/hub-game/play/registry.js +47 -0
- package/kits/hub-game/play.jsx +37 -0
- package/kits/hub-game/scripts/check.mjs +117 -16
- package/kits/hub-game/scripts/companion-follower-wire.json +1 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless-draw.json +132 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless.json +293 -0
- package/kits/hub-game/scripts/fixtures/engine-models-stub.mjs +26 -0
- package/kits/hub-game/scripts/fixtures/fake-dom.mjs +123 -0
- package/kits/hub-game/scripts/fixtures/interest-legacy.json +385 -0
- package/kits/hub-game/scripts/fixtures/npc-notes-v1.77.jsonl +4 -0
- package/kits/hub-game/scripts/fixtures/vis-shared-wire.json +1 -0
- package/kits/hub-game/scripts/gen-avatars.mjs +933 -16
- package/kits/hub-game/scripts/gen-earned.mjs +285 -0
- package/kits/hub-game/scripts/gen-hats.mjs +827 -0
- package/kits/hub-game/scripts/grab.before-orbit.mjs +400 -0
- package/kits/hub-game/scripts/pose-storage-fixture.mjs +46 -0
- package/kits/hub-game/scripts/soundscape-wave-analysis.mjs +125 -0
- package/kits/hub-game/scripts/test-act-client.mjs +186 -0
- package/kits/hub-game/scripts/test-act.mjs +171 -0
- package/kits/hub-game/scripts/test-action-layout.mjs +80 -0
- package/kits/hub-game/scripts/test-action-observers.mjs +46 -0
- package/kits/hub-game/scripts/test-actions-client.mjs +853 -0
- package/kits/hub-game/scripts/test-actions.mjs +298 -0
- package/kits/hub-game/scripts/test-actor-budget.mjs +44 -0
- package/kits/hub-game/scripts/test-actors.mjs +38 -23
- package/kits/hub-game/scripts/test-analytics.mjs +76 -0
- package/kits/hub-game/scripts/test-anonymous-entry.mjs +28 -0
- package/kits/hub-game/scripts/test-arrival-pose-server.mjs +196 -0
- package/kits/hub-game/scripts/test-arrival-pose.mjs +24 -0
- package/kits/hub-game/scripts/test-ask-client.mjs +358 -0
- package/kits/hub-game/scripts/test-ask-slot.mjs +85 -0
- package/kits/hub-game/scripts/test-ask.mjs +269 -0
- package/kits/hub-game/scripts/test-attention.mjs +10 -1
- package/kits/hub-game/scripts/test-avatar-cap.mjs +379 -0
- package/kits/hub-game/scripts/test-avatar-colors.mjs +72 -0
- package/kits/hub-game/scripts/test-avatar-models.mjs +181 -0
- package/kits/hub-game/scripts/test-avatar-share.mjs +318 -0
- package/kits/hub-game/scripts/test-avatar-wire.mjs +792 -0
- package/kits/hub-game/scripts/test-avatar.mjs +584 -7
- package/kits/hub-game/scripts/test-back-visibility.mjs +82 -0
- package/kits/hub-game/scripts/test-ballot.mjs +1008 -0
- package/kits/hub-game/scripts/test-ban-join.mjs +121 -13
- package/kits/hub-game/scripts/test-build.mjs +49 -0
- package/kits/hub-game/scripts/test-cells.mjs +71 -0
- package/kits/hub-game/scripts/test-chat.mjs +863 -0
- package/kits/hub-game/scripts/test-classic.mjs +2 -0
- package/kits/hub-game/scripts/test-companion-chat.mjs +216 -0
- package/kits/hub-game/scripts/test-companion-client.mjs +1167 -0
- package/kits/hub-game/scripts/test-companion.mjs +259 -0
- package/kits/hub-game/scripts/test-control-layout-dom.mjs +120 -0
- package/kits/hub-game/scripts/test-crowd-names.mjs +205 -0
- package/kits/hub-game/scripts/test-decor-client.mjs +344 -0
- package/kits/hub-game/scripts/test-decor.mjs +464 -0
- package/kits/hub-game/scripts/test-default-environment-root.mjs +95 -0
- package/kits/hub-game/scripts/test-default-environment.mjs +267 -0
- package/kits/hub-game/scripts/test-door-analytics.mjs +58 -0
- package/kits/hub-game/scripts/test-door-jump.mjs +100 -0
- package/kits/hub-game/scripts/test-earned-client.mjs +459 -0
- package/kits/hub-game/scripts/test-earned.mjs +1224 -0
- package/kits/hub-game/scripts/test-emote-bubble.mjs +110 -0
- package/kits/hub-game/scripts/test-far-avatars.mjs +340 -0
- package/kits/hub-game/scripts/test-fps-telemetry.mjs +112 -0
- package/kits/hub-game/scripts/test-frame-batch.mjs +252 -0
- package/kits/hub-game/scripts/test-fresh-friends.mjs +118 -0
- package/kits/hub-game/scripts/test-friend-bests.mjs +435 -0
- package/kits/hub-game/scripts/test-grab-orbit.mjs +961 -0
- package/kits/hub-game/scripts/test-grab.mjs +7 -0
- package/kits/hub-game/scripts/test-hats.mjs +422 -168
- package/kits/hub-game/scripts/test-high-only.mjs +170 -0
- package/kits/hub-game/scripts/test-hub-leaving.mjs +203 -0
- package/kits/hub-game/scripts/test-hub-ops.mjs +758 -2
- package/kits/hub-game/scripts/test-hub-trip.mjs +1594 -12
- package/kits/hub-game/scripts/test-hud-clear.mjs +484 -57
- package/kits/hub-game/scripts/test-hud-defects-dom.mjs +100 -0
- package/kits/hub-game/scripts/test-hud-rate.mjs +224 -0
- package/kits/hub-game/scripts/test-hud-safe-visibility-dom.mjs +83 -0
- package/kits/hub-game/scripts/test-idle.mjs +427 -1
- package/kits/hub-game/scripts/test-interest-cap.mjs +36 -0
- package/kits/hub-game/scripts/test-interest-cells.mjs +513 -0
- package/kits/hub-game/scripts/test-interest-client.mjs +118 -0
- package/kits/hub-game/scripts/test-interest.mjs +15 -0
- package/kits/hub-game/scripts/test-invites-client.mjs +430 -0
- package/kits/hub-game/scripts/test-invites.mjs +109 -0
- package/kits/hub-game/scripts/test-keys.mjs +46 -1
- package/kits/hub-game/scripts/test-labels.mjs +664 -0
- package/kits/hub-game/scripts/test-landscape-layout.mjs +194 -0
- package/kits/hub-game/scripts/test-list-scroll-dom.mjs +49 -0
- package/kits/hub-game/scripts/test-load-abandon.mjs +246 -0
- package/kits/hub-game/scripts/test-loading-cover.mjs +162 -0
- package/kits/hub-game/scripts/test-manifest.mjs +472 -0
- package/kits/hub-game/scripts/test-menu-client.mjs +585 -0
- package/kits/hub-game/scripts/test-menu.mjs +319 -0
- package/kits/hub-game/scripts/test-npcs.mjs +2528 -13
- package/kits/hub-game/scripts/test-object-entry.mjs +76 -0
- package/kits/hub-game/scripts/test-observed.mjs +745 -0
- package/kits/hub-game/scripts/test-pack.mjs +7 -0
- package/kits/hub-game/scripts/test-pad-cues.mjs +304 -0
- package/kits/hub-game/scripts/test-pad-occupancy.mjs +177 -0
- package/kits/hub-game/scripts/test-picker.mjs +541 -0
- package/kits/hub-game/scripts/test-placement-cache.mjs +690 -0
- package/kits/hub-game/scripts/test-progress-reset.mjs +559 -0
- package/kits/hub-game/scripts/test-push-visit.mjs +26 -0
- package/kits/hub-game/scripts/test-quality.mjs +385 -0
- package/kits/hub-game/scripts/test-rehello.mjs +1733 -0
- package/kits/hub-game/scripts/test-relations-among.mjs +222 -0
- package/kits/hub-game/scripts/test-relations-refresh.mjs +188 -0
- package/kits/hub-game/scripts/test-resume-action-order.mjs +598 -0
- package/kits/hub-game/scripts/test-resume-held.mjs +239 -0
- package/kits/hub-game/scripts/test-resume-pose.mjs +142 -0
- package/kits/hub-game/scripts/test-safe-events-dom.mjs +116 -0
- package/kits/hub-game/scripts/test-safe-layout.mjs +330 -0
- package/kits/hub-game/scripts/test-say.mjs +1 -1
- package/kits/hub-game/scripts/test-shot.mjs +901 -0
- package/kits/hub-game/scripts/test-signin-client.mjs +45 -0
- package/kits/hub-game/scripts/test-soundscape.mjs +5437 -0
- package/kits/hub-game/scripts/test-spin.mjs +314 -0
- package/kits/hub-game/scripts/test-standing.mjs +449 -0
- package/kits/hub-game/scripts/test-storage-limit.mjs +333 -0
- package/kits/hub-game/scripts/test-stuck.mjs +1904 -0
- package/kits/hub-game/scripts/test-talk-overlay-dom.mjs +130 -0
- package/kits/hub-game/scripts/test-tier-cells.mjs +706 -0
- package/kits/hub-game/scripts/test-tiers-render.mjs +412 -0
- package/kits/hub-game/scripts/test-tiers.mjs +476 -2
- package/kits/hub-game/scripts/test-toast-band.mjs +61 -0
- package/kits/hub-game/scripts/test-try-on.mjs +22 -22
- package/kits/hub-game/scripts/test-vis.mjs +770 -0
- package/kits/hub-game/scripts/test-visibility.mjs +134 -0
- package/kits/hub-game/scripts/test-weakest-tier.mjs +924 -0
- package/kits/hub-game/scripts/test-world-labels.mjs +367 -0
- package/kits/hub-game/scripts/test-yours-chrome.mjs +210 -0
- package/kits/hub-game/scripts/test-yours.mjs +403 -0
- package/kits/multiplayer-3d/CLAUDE.md +50 -0
- package/kits/multiplayer-3d/castle.json +5 -5
- package/kits/multiplayer-3d/code/client/avatars.js +7 -0
- package/kits/multiplayer-3d/code/client/gait.js +65 -0
- package/kits/multiplayer-3d/code/client/joinFailure.js +27 -0
- package/kits/multiplayer-3d/code/client/nameTags.js +59 -4
- package/kits/multiplayer-3d/code/client/resumeGate.js +139 -0
- package/kits/multiplayer-3d/code/options.js +5 -0
- package/kits/multiplayer-3d/code/server/ownership.js +10 -2
- package/kits/multiplayer-3d/code/server/sceneBodies.js +12 -0
- package/kits/multiplayer-3d/code/server/world.js +7 -0
- package/kits/multiplayer-3d/code/systems/multiplayer.js +443 -34
- package/kits/multiplayer-3d/package-lock.json +8 -1
- package/kits/multiplayer-3d/package.json +3 -1
- package/kits/multiplayer-3d/scripts/fixtures/README.md +11 -0
- package/kits/multiplayer-3d/scripts/fixtures/ownership-legacy.json +2 -0
- package/kits/multiplayer-3d/scripts/ownership-harness.mjs +102 -0
- package/kits/multiplayer-3d/scripts/ownership-loader.mjs +46 -0
- package/kits/multiplayer-3d/scripts/ownership-worker.mjs +15 -0
- package/kits/multiplayer-3d/scripts/record-ownership-session.mjs +98 -0
- package/kits/multiplayer-3d/scripts/test-eligible-claims.mjs +167 -0
- package/kits/multiplayer-3d/scripts/test-join-watchdog.mjs +436 -0
- package/kits/multiplayer-3d/scripts/test-own-name-tag.mjs +247 -0
- package/kits/multiplayer-3d/scripts/test-resume-gate.mjs +624 -0
- package/kits/physics-2d/CLAUDE.md +19 -1
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/engine/frozenActors.js +233 -0
- package/kits/physics-2d/engine/scene.js +337 -3
- package/kits/physics-2d/engine/skyKey.js +129 -0
- package/kits/physics-2d/engine/stillClock.js +106 -0
- package/kits/physics-2d/engine/updateBudget.js +21 -0
- package/kits/physics-2d/eslint.config.js +1 -1
- package/kits/physics-2d/play/behaviors/AnalogStick.js +198 -0
- package/kits/physics-2d/play/behaviors/Camera.js +40 -0
- package/kits/physics-2d/play/behaviors/Collider.js +122 -0
- package/kits/physics-2d/play/behaviors/Draggable.js +115 -0
- package/kits/physics-2d/play/behaviors/Goal.js +46 -0
- package/kits/physics-2d/play/behaviors/Joints.js +126 -0
- package/kits/physics-2d/play/behaviors/Layout.js +71 -0
- package/kits/physics-2d/play/behaviors/RigidBody.js +57 -0
- package/kits/physics-2d/play/behaviors/Slingshot.js +142 -0
- package/kits/physics-2d/play/behaviors/SoundPlayer.js +263 -0
- package/kits/physics-2d/play/behaviors/Sprite.js +406 -0
- package/kits/physics-2d/play/behaviors/Style.js +209 -0
- package/kits/physics-2d/play/behaviors/Text.js +85 -0
- package/kits/physics-2d/play/behaviors/Video.js +93 -0
- package/kits/physics-2d/scripts/test-skip-unchanged.mjs +326 -1
- package/kits/physics-3d/CLAUDE.md +42 -529
- package/kits/physics-3d/behaviors/Body.jsx +3 -0
- package/kits/physics-3d/behaviors/Model.jsx +3 -0
- package/kits/physics-3d/behaviors/Player.jsx +661 -87
- package/kits/physics-3d/behaviors/Shape.jsx +3 -0
- package/kits/physics-3d/behaviors/Solid.jsx +3 -0
- package/kits/physics-3d/behaviors/Transform.jsx +3 -0
- package/kits/physics-3d/castle.json +3 -3
- package/kits/physics-3d/docs/engine-camera.md +542 -0
- package/kits/physics-3d/docs/engine-frame-cap.md +136 -0
- package/kits/physics-3d/docs/engine-load.md +149 -0
- package/kits/physics-3d/docs/engine-look.md +114 -0
- package/kits/physics-3d/docs/engine-shadows.md +372 -0
- package/kits/physics-3d/docs/engine-skip-work.md +187 -0
- package/kits/physics-3d/docs/engine-sky.md +198 -0
- package/kits/physics-3d/docs/engine-static-actors.md +226 -0
- package/kits/physics-3d/docs/engine-view.md +37 -0
- package/kits/physics-3d/docs/pxmodel-format.md +9 -1
- package/kits/physics-3d/engine3d/PlayOnly3D.jsx +5 -1
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +19 -277
- package/kits/physics-3d/engine3d/actornode.js +87 -0
- package/kits/physics-3d/engine3d/animationBudget.js +23 -0
- package/kits/physics-3d/engine3d/branches.js +3 -13
- package/kits/physics-3d/engine3d/cage.js +2 -7
- package/kits/physics-3d/engine3d/cageops.js +2 -17
- package/kits/physics-3d/engine3d/dataBehaviors.js +12 -0
- package/kits/physics-3d/engine3d/editorWorld.js +6 -0
- package/kits/physics-3d/engine3d/emptynodes.js +232 -0
- package/kits/physics-3d/engine3d/framecap.js +99 -0
- package/kits/physics-3d/engine3d/frozenphysics.js +140 -0
- package/kits/physics-3d/engine3d/frozenstatics.js +273 -0
- package/kits/physics-3d/engine3d/gait.js +126 -0
- package/kits/physics-3d/engine3d/initialModelFiles.js +18 -0
- package/kits/physics-3d/engine3d/kithooks.js +47 -0
- package/kits/physics-3d/engine3d/look.js +514 -48
- package/kits/physics-3d/engine3d/lookbake.js +208 -0
- package/kits/physics-3d/engine3d/materialpresets.js +2 -0
- package/kits/physics-3d/engine3d/modelFiles.js +3 -17
- package/kits/physics-3d/engine3d/modelMath.js +49 -0
- package/kits/physics-3d/engine3d/modelready.js +16 -0
- package/kits/physics-3d/engine3d/motion.js +39 -10
- package/kits/physics-3d/engine3d/nearshadows.js +106 -21
- package/kits/physics-3d/engine3d/optimize.js +9 -5
- package/kits/physics-3d/engine3d/orbitinput.js +522 -10
- package/kits/physics-3d/engine3d/orbitlens.js +48 -0
- package/kits/physics-3d/engine3d/ownmodel.js +213 -0
- package/kits/physics-3d/engine3d/partgeometry.js +1 -16
- package/kits/physics-3d/engine3d/paths.js +1 -9
- package/kits/physics-3d/engine3d/playTimings.js +50 -0
- package/kits/physics-3d/engine3d/playerRun.js +372 -0
- package/kits/physics-3d/engine3d/pxmodel.js +42 -11
- package/kits/physics-3d/engine3d/rapier.js +27 -0
- package/kits/physics-3d/engine3d/scatter.js +1 -11
- package/kits/physics-3d/engine3d/shadowfade.js +890 -0
- package/kits/physics-3d/engine3d/sky.js +547 -0
- package/kits/physics-3d/engine3d/skylife.js +306 -0
- package/kits/physics-3d/engine3d/squarefirst.js +177 -0
- package/kits/physics-3d/engine3d/stillshadows.js +399 -0
- package/kits/physics-3d/engine3d/sweep.js +1 -25
- package/kits/physics-3d/engine3d/unchanged.js +11 -0
- package/kits/physics-3d/engine3d/viewrange.js +52 -0
- package/kits/physics-3d/engine3d/world3d.js +1253 -76
- package/kits/physics-3d/eslint.config.js +2 -1
- package/kits/physics-3d/main.jsx +10 -2
- package/kits/physics-3d/package-lock.json +7 -0
- package/kits/physics-3d/package.json +5 -1
- package/kits/physics-3d/play/behaviors/Body.js +31 -0
- package/kits/physics-3d/play/behaviors/Door.js +37 -0
- package/kits/physics-3d/play/behaviors/Lookable.js +16 -0
- package/kits/physics-3d/play/behaviors/Model.js +23 -0
- package/kits/physics-3d/play/behaviors/Pickup.js +46 -0
- package/kits/physics-3d/play/behaviors/Player.js +1204 -0
- package/kits/physics-3d/play/behaviors/Shape.js +47 -0
- package/kits/physics-3d/play/behaviors/Solid.js +16 -0
- package/kits/physics-3d/play/behaviors/Transform.js +29 -0
- package/kits/physics-3d/pnpm-lock.yaml +8 -0
- package/kits/physics-3d/scripts/bench-shadow-fade.mjs +37 -0
- package/kits/physics-3d/scripts/build-rapier-gz.mjs +56 -0
- package/kits/physics-3d/scripts/frozen-statics-fixture.mjs +141 -0
- package/kits/physics-3d/scripts/look-baseline.mjs +155 -0
- package/kits/physics-3d/scripts/test-camera-follow.mjs +5 -1
- package/kits/physics-3d/scripts/test-camera-orbit.mjs +2613 -82
- package/kits/physics-3d/scripts/test-drop-empty-parts.mjs +2 -2
- package/kits/physics-3d/scripts/test-empty-gait-hints.mjs +89 -0
- package/kits/physics-3d/scripts/test-frame-cap-bob.mjs +438 -0
- package/kits/physics-3d/scripts/test-frame-cap.mjs +452 -0
- package/kits/physics-3d/scripts/test-frozen-nested.mjs +49 -0
- package/kits/physics-3d/scripts/test-frozen-statics-legacy-physics2d.mjs +123 -0
- package/kits/physics-3d/scripts/test-frozen-statics.mjs +434 -0
- package/kits/physics-3d/scripts/test-gait.mjs +387 -0
- package/kits/physics-3d/scripts/test-look-bake.mjs +1056 -0
- package/kits/physics-3d/scripts/test-model-parse-cache.mjs +92 -0
- package/kits/physics-3d/scripts/test-near-shadows.mjs +5 -2
- package/kits/physics-3d/scripts/test-orbit-shadow-fade.mjs +2001 -0
- package/kits/physics-3d/scripts/test-orbit-shift-lock.mjs +582 -0
- package/kits/physics-3d/scripts/test-orbit-shot.mjs +657 -0
- package/kits/physics-3d/scripts/test-orbit-view.mjs +230 -0
- package/kits/physics-3d/scripts/test-rapier-gz.mjs +106 -0
- package/kits/physics-3d/scripts/test-skip-empty-nodes.mjs +845 -0
- package/kits/physics-3d/scripts/test-sky.mjs +2470 -0
- package/kits/physics-3d/scripts/test-square-first.mjs +921 -0
- package/kits/physics-3d/scripts/test-static-actors.mjs +10 -1
- package/kits/physics-3d/scripts/test-static-physics.mjs +4 -1
- package/kits/physics-3d/scripts/test-static-scenery.mjs +2174 -0
- package/kits/physics-3d/scripts/test-steady-hover.mjs +7 -2
- package/kits/physics-3d/scripts/test-still-shadows.mjs +477 -0
- package/kits/physics-3d/scripts/test-view-range.mjs +260 -0
- package/kits/physics-3d/systems/physics3d.js +419 -9
- package/kits/real-time/castle.json +2 -2
- package/kits/real-time/code/client/connection.js +33 -10
- package/kits/real-time/code/client/gameHooks.js +2 -0
- package/kits/real-time/code/client/joinOverlay.js +9 -4
- package/kits/real-time/code/server/gameHooks.js +7 -0
- package/kits/real-time/code/server/session.js +102 -22
- package/kits/real-time/package-lock.json +1 -1
- package/package.json +2 -2
- package/dist/shell/assets/index-Cf61cNfT.css +0 -1
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
// manifest is null when there are errors; otherwise every place has every
|
|
8
8
|
// field filled with its default.
|
|
9
9
|
|
|
10
|
+
import { readUnlocks } from './earned.js';
|
|
11
|
+
import { readQuality } from '../shared/quality.js';
|
|
12
|
+
import { readDecor } from './decor.js';
|
|
13
|
+
|
|
14
|
+
// Manifest/wire major stays 1; latest optional contract additions are v1.128.
|
|
10
15
|
export const CONTRACT_VERSION = 1;
|
|
11
16
|
|
|
12
17
|
export const CONTROLLERS = ['walk'];
|
|
@@ -22,6 +27,7 @@ export const PLACE_ID = /^[a-z][a-z0-9-]{0,23}$/;
|
|
|
22
27
|
export const MAIN_PLACE = 'main';
|
|
23
28
|
// How many other players each client of a place is sent (`nearestPlayers`).
|
|
24
29
|
export const NEAREST_PLAYERS = 30;
|
|
30
|
+
export const NEAREST_PLAYERS_CELLS = 48;
|
|
25
31
|
export const NEAREST_PLAYERS_CAP = 100;
|
|
26
32
|
// Grabbing and throwing (v1.3, §6): what `grab: true` means, and the bounds of
|
|
27
33
|
// each field. The fastest throw stays well under multiplayer-3d's limit on an
|
|
@@ -51,7 +57,16 @@ const SOUND_PATH = /^[A-Za-z0-9_@-][A-Za-z0-9_./@-]{0,199}$/;
|
|
|
51
57
|
// place without it is read and sent exactly as before.
|
|
52
58
|
const HUD_KEYS = ['clear'];
|
|
53
59
|
|
|
60
|
+
// v1.68 `ballot`: a tappable choice card (`ballot.js`). The deck's fixed
|
|
61
|
+
// lines are the only words a player can send through it, declared here so
|
|
62
|
+
// the server can refuse any other id and the client words them itself.
|
|
63
|
+
export const BALLOT_LINE_ID = /^[a-z0-9-]{1,24}$/;
|
|
64
|
+
export const BALLOT_MAX_LINES = 32;
|
|
65
|
+
export const BALLOT_LINE_MAX = 40;
|
|
66
|
+
export const BALLOT_ABOUT = ['face', 'self'];
|
|
67
|
+
|
|
54
68
|
const PLACE_KEYS = [
|
|
69
|
+
'push',
|
|
55
70
|
'title',
|
|
56
71
|
'scene',
|
|
57
72
|
'minPlayers',
|
|
@@ -68,13 +83,54 @@ const PLACE_KEYS = [
|
|
|
68
83
|
'grab',
|
|
69
84
|
'idle',
|
|
70
85
|
'hud',
|
|
86
|
+
'decor',
|
|
87
|
+
'actions',
|
|
88
|
+
'anonymousEntry',
|
|
89
|
+
'invite',
|
|
90
|
+
'companion',
|
|
91
|
+
'ask',
|
|
92
|
+
'menu',
|
|
93
|
+
'ballot',
|
|
94
|
+
'resume',
|
|
95
|
+
'resumeVisibility',
|
|
96
|
+
'resumePose',
|
|
97
|
+
'resumeArrivalPose',
|
|
98
|
+
'houseResume',
|
|
99
|
+
'freshFriends',
|
|
100
|
+
'under13Choices',
|
|
101
|
+
'talkLog',
|
|
102
|
+
'visibility',
|
|
103
|
+
'analytics',
|
|
104
|
+
'analyticsV111',
|
|
105
|
+
'fpsTelemetry',
|
|
106
|
+
'loadTelemetry',
|
|
107
|
+
|
|
108
|
+
'analyticsRounds',
|
|
71
109
|
];
|
|
72
110
|
// `tiers` is the deck's, not a place's: the client's picture on a slow device
|
|
73
111
|
// (v1.21, `code/client/tiers.js`). The server reads nothing of it.
|
|
74
112
|
// `cues` is the deck's too (v1.23): a town that tells its players more about
|
|
75
113
|
// the friends and party they came with. Both halves read it, and a deck
|
|
76
114
|
// without it is sent and draws exactly what it did.
|
|
77
|
-
|
|
115
|
+
// `stuck` is the deck's as well (v1.33): a town offers a player who walks and
|
|
116
|
+
// gets nowhere the way back to its arrival. Both halves read it; the manifest
|
|
117
|
+
// carries the key only when it is true, so a deck without it reads as before.
|
|
118
|
+
// `labels` is the deck's and the client's alone, like `tiers` (v1.43): `"near"`
|
|
119
|
+
// keeps a town's labels near the player and apart (`code/client/labelsNear.js`).
|
|
120
|
+
// The server reads nothing of it and the manifest does not carry it.
|
|
121
|
+
// `soundscape` is the deck's (`code/client/soundscape.js` synthesises it):
|
|
122
|
+
// the sounds the kit makes itself -- NPC babble, footsteps -- and a sound
|
|
123
|
+
// control. `true` keeps babble and street steps; only new object fields ask
|
|
124
|
+
// for zone ambience, music, surface maps and UI cues (v1.49).
|
|
125
|
+
// Only the explicit cues part (v1.50) is read by the server. The manifest
|
|
126
|
+
// carries soundscape only when on, so a deck without it reads as before.
|
|
127
|
+
export const SOUNDSCAPE_KEYS = ['babble', 'steps', 'zones', 'ambience', 'ui', 'cues'];
|
|
128
|
+
export const SOUNDSCAPE_BEDS = ['square', 'meadow', 'night', 'harbour', 'crowd', 'market'];
|
|
129
|
+
export const SOUNDSCAPE_SURFACES = ['grass', 'street', 'wood', 'stone', 'sand', 'cobble'];
|
|
130
|
+
// `unlocks` is the deck's (v1.53): the earned items its places may give
|
|
131
|
+
// (`earned.js`). The manifest carries it only when declared, so a deck
|
|
132
|
+
// without it reads as before.
|
|
133
|
+
const TOP_KEYS = ['firstVisit', 'act', 'bringFriend', 'frameBatch', 'defaultEnvironment', 'weakestTier', 'highOnly', 'weakestLookBake', 'pongTimeoutMs', 'contract', 'places', 'interest', 'tiers', 'quality', 'companionIdle', 'lowActorBudget', 'lowActorDistance', 'mergeFarAvatars', 'playOnlyEntry', 'loadTimings', 'loadingCover', 'cues', 'playCards', 'stuck', 'yourGames', 'avatarColors', 'labels', 'safeInsets', 'soundscape', 'unlocks', 'house', 'weeklyCup', ...PLACE_KEYS];
|
|
78
134
|
|
|
79
135
|
const DEFAULT_SCENE = 'scenes/main.scene';
|
|
80
136
|
|
|
@@ -84,6 +140,9 @@ export function readManifest(castleJson, sceneExists = () => true) {
|
|
|
84
140
|
if (!isObject(hub)) {
|
|
85
141
|
return { errors: ['castle.json has no `hub` block: a hub-game deck declares one.'], manifest: null };
|
|
86
142
|
}
|
|
143
|
+
if (Object.hasOwn(hub, 'frameBatch') && hub.frameBatch !== true) {
|
|
144
|
+
errors.push('hub.frameBatch must be true or absent.');
|
|
145
|
+
}
|
|
87
146
|
if (hub.contract !== CONTRACT_VERSION) {
|
|
88
147
|
errors.push(
|
|
89
148
|
Number.isInteger(hub.contract) && hub.contract > CONTRACT_VERSION
|
|
@@ -92,20 +151,102 @@ export function readManifest(castleJson, sceneExists = () => true) {
|
|
|
92
151
|
);
|
|
93
152
|
}
|
|
94
153
|
unknownKeys(hub, TOP_KEYS, 'hub', errors);
|
|
154
|
+
if (hub.firstVisit !== undefined) {
|
|
155
|
+
const value = hub.firstVisit;
|
|
156
|
+
if (!isObject(value)) {errors.push('hub.firstVisit must be { live: [...] }.');}
|
|
157
|
+
else {
|
|
158
|
+
unknownKeys(value, ['live'], 'hub.firstVisit', errors);
|
|
159
|
+
if (!Array.isArray(value.live) || !value.live.length || value.live.length > 3 ||
|
|
160
|
+
value.live.some((v) => !['home', 'door', 'npc'].includes(v)) || new Set(value.live).size !== value.live.length) {
|
|
161
|
+
errors.push('hub.firstVisit.live must contain one to three unique variants: home, door, npc.');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (Object.hasOwn(hub, 'bringFriend') && (hub.bringFriend !== true || hub.invite !== true)) {
|
|
166
|
+
errors.push('hub.bringFriend must be true or absent and requires hub.invite: true.');
|
|
167
|
+
}
|
|
168
|
+
if (hub.pongTimeoutMs !== undefined && (!Number.isInteger(hub.pongTimeoutMs) || hub.pongTimeoutMs < 0 || hub.pongTimeoutMs > 2_147_483_647)) {
|
|
169
|
+
errors.push('hub.pongTimeoutMs must be an integer from 0 through 2147483647.');
|
|
170
|
+
}
|
|
171
|
+
// Rendering and diagnostics flags are client-only, like the tier keys.
|
|
172
|
+
for (const key of ['defaultEnvironment', 'weakestTier', 'highOnly', 'weakestLookBake', 'mergeFarAvatars', 'playOnlyEntry', 'loadTimings']) {
|
|
173
|
+
if (hub[key] !== undefined && typeof hub[key] !== 'boolean') {
|
|
174
|
+
errors.push(`hub.${key} must be true or false.`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (hub.lowActorDistance !== undefined && typeof hub.lowActorDistance !== 'boolean') {
|
|
178
|
+
errors.push('hub.lowActorDistance must be true or false.');
|
|
179
|
+
}
|
|
180
|
+
if (hub.lowActorBudget !== undefined && typeof hub.lowActorBudget !== 'boolean') {
|
|
181
|
+
errors.push('hub.lowActorBudget must be true or false.');
|
|
182
|
+
}
|
|
183
|
+
if (hub.companionIdle !== undefined && typeof hub.companionIdle !== 'boolean') {
|
|
184
|
+
errors.push('hub.companionIdle must be true or false.');
|
|
185
|
+
}
|
|
186
|
+
if (hub.safeInsets !== undefined && typeof hub.safeInsets !== 'boolean') {
|
|
187
|
+
errors.push('hub.safeInsets must be true or false.');
|
|
188
|
+
}
|
|
95
189
|
if (hub.tiers !== undefined && typeof hub.tiers !== 'boolean') {
|
|
96
190
|
errors.push('hub.tiers must be true or false.');
|
|
97
191
|
}
|
|
192
|
+
if (hub.highOnly !== undefined && hub.tiers !== true) {
|
|
193
|
+
errors.push('hub.highOnly requires hub.tiers: true.');
|
|
194
|
+
}
|
|
195
|
+
const quality = readQuality(hub.quality, hub.tiers, errors);
|
|
98
196
|
if (hub.cues !== undefined && typeof hub.cues !== 'boolean') {
|
|
99
197
|
errors.push('hub.cues must be true or false.');
|
|
100
198
|
}
|
|
199
|
+
if (hub.loadingCover !== undefined && typeof hub.loadingCover !== 'boolean') {
|
|
200
|
+
errors.push('hub.loadingCover must be true or false.');
|
|
201
|
+
}
|
|
202
|
+
if (hub.playCards !== undefined && typeof hub.playCards !== 'boolean') {
|
|
203
|
+
errors.push('hub.playCards must be true or false.');
|
|
204
|
+
}
|
|
205
|
+
if (hub.yourGames !== undefined && typeof hub.yourGames !== 'boolean') {
|
|
206
|
+
errors.push('hub.yourGames must be true or false.');
|
|
207
|
+
}
|
|
208
|
+
if (hub.avatarColors !== undefined && typeof hub.avatarColors !== 'boolean') {
|
|
209
|
+
errors.push('hub.avatarColors must be true or false.');
|
|
210
|
+
}
|
|
211
|
+
if (hub.stuck !== undefined && typeof hub.stuck !== 'boolean') {
|
|
212
|
+
errors.push('hub.stuck must be true or false.');
|
|
213
|
+
}
|
|
214
|
+
if (hub.weeklyCup !== undefined && typeof hub.weeklyCup !== 'boolean') {
|
|
215
|
+
errors.push('hub.weeklyCup must be true or false.');
|
|
216
|
+
}
|
|
217
|
+
if (hub.labels !== undefined && hub.labels !== 'near') {
|
|
218
|
+
errors.push('hub.labels must be "near" (or left out).');
|
|
219
|
+
}
|
|
220
|
+
if (hub.interest !== undefined && hub.interest !== 'cells') {
|
|
221
|
+
errors.push('hub.interest must be "cells" (or left out).');
|
|
222
|
+
}
|
|
223
|
+
let house = null;
|
|
224
|
+
if (hub.house !== undefined) {
|
|
225
|
+
if (!isObject(hub.house)) {
|
|
226
|
+
errors.push('hub.house must be an object of { devOwner: "first" }.');
|
|
227
|
+
} else {
|
|
228
|
+
unknownKeys(hub.house, ['devOwner'], 'hub.house', errors);
|
|
229
|
+
if (hub.house.devOwner !== 'first') {
|
|
230
|
+
errors.push('hub.house.devOwner must be "first".');
|
|
231
|
+
} else {
|
|
232
|
+
house = { devOwner: 'first' };
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (hub.act !== undefined && typeof hub.act !== 'boolean') {errors.push('hub.act must be true or false.');}
|
|
237
|
+
const soundscape = readSoundscape(hub.soundscape, errors);
|
|
238
|
+
const unlocks = readUnlocks(hub.unlocks, errors);
|
|
101
239
|
const defaultScene =
|
|
102
240
|
typeof castleJson?.editor?.defaultPlayFile === 'string' ? castleJson.editor.defaultPlayFile : DEFAULT_SCENE;
|
|
103
241
|
const serverMax = Number.isInteger(castleJson?.server?.maxPlayers) ? castleJson.server.maxPlayers : MAX_PLAYERS_CAP;
|
|
104
242
|
const destinations = Array.isArray(castleJson?.server?.destinations) ? castleJson.server.destinations : [];
|
|
105
243
|
const bundle = castleJson?.characterBundle ?? null;
|
|
244
|
+
validateChildAsks(bundle, errors);
|
|
106
245
|
|
|
107
246
|
const places = {};
|
|
108
|
-
places[MAIN_PLACE] = readPlace(hub, 'hub', defaultScene, serverMax, sceneExists, errors, destinations, bundle);
|
|
247
|
+
places[MAIN_PLACE] = readPlace(hub, 'hub', defaultScene, serverMax, sceneExists, errors, destinations, bundle, hub.interest);
|
|
248
|
+
// v1.68: whether any place declares the choice card (only the key is read).
|
|
249
|
+
let ballot = Boolean(places[MAIN_PLACE].ballot);
|
|
109
250
|
if (hub.places !== undefined) {
|
|
110
251
|
if (!isObject(hub.places)) {
|
|
111
252
|
errors.push('hub.places must be an object of place id -> place.');
|
|
@@ -121,14 +262,131 @@ export function readManifest(castleJson, sceneExists = () => true) {
|
|
|
121
262
|
continue;
|
|
122
263
|
}
|
|
123
264
|
unknownKeys(block, PLACE_KEYS, where, errors);
|
|
124
|
-
places[id] = readPlace(block, where, null, serverMax, sceneExists, errors, destinations, bundle);
|
|
265
|
+
places[id] = readPlace(block, where, null, serverMax, sceneExists, errors, destinations, bundle, hub.interest);
|
|
266
|
+
ballot ||= Boolean(places[id].ballot);
|
|
125
267
|
}
|
|
126
268
|
}
|
|
127
269
|
}
|
|
128
|
-
|
|
270
|
+
if (hub.act === true) {
|
|
271
|
+
for (const place of Object.values(places)) {
|
|
272
|
+
place.act = true;
|
|
273
|
+
place.grab ??= { ...GRAB_DEFAULTS };
|
|
274
|
+
place.idle = { emotes: false, sounds: [], ...place.idle, seats: true };
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return errors.length ? { errors, manifest: null } : { errors, manifest: { contract: CONTRACT_VERSION, ...(quality ? { quality } : {}), ...(hub.act === true ? { act: true } : {}), cues: hub.cues === true, ...(hub.yourGames === true ? { yourGames: true } : {}), ...(hub.avatarColors === true ? { avatarColors: true } : {}), ...(hub.stuck === true ? { stuck: true } : {}), ...(hub.weeklyCup === true ? { weeklyCup: true } : {}), ...(soundscape ? { soundscape } : {}), ...(unlocks ? { unlocks } : {}), ...(house ? { house } : {}), ...(ballot ? { ballot: true } : {}), places } };
|
|
129
278
|
}
|
|
130
279
|
|
|
131
|
-
|
|
280
|
+
// `hub.soundscape`: its parts where it is on, null where it is left out or
|
|
281
|
+
// false. New fields are never filled into a boolean deck's manifest.
|
|
282
|
+
function readSoundscape(value, errors) {
|
|
283
|
+
if (value === undefined || value === false) {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
if (value === true) {
|
|
287
|
+
return { babble: true, steps: true };
|
|
288
|
+
}
|
|
289
|
+
if (!isObject(value)) {
|
|
290
|
+
errors.push('hub.soundscape must be true, false or an object of { babble, steps, zones, ambience, ui, cues }.');
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
unknownKeys(value, SOUNDSCAPE_KEYS, 'hub.soundscape', errors);
|
|
294
|
+
if (value.babble !== undefined && typeof value.babble !== 'boolean') {
|
|
295
|
+
errors.push('hub.soundscape.babble must be true or false.');
|
|
296
|
+
}
|
|
297
|
+
const out = { babble: value.babble !== false, steps: value.steps !== false };
|
|
298
|
+
if (value.cues !== undefined) {
|
|
299
|
+
if (typeof value.cues !== 'boolean') {
|
|
300
|
+
errors.push('hub.soundscape.cues must be true or false.');
|
|
301
|
+
} else {
|
|
302
|
+
out.cues = value.cues;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (value.ui !== undefined) {
|
|
306
|
+
if (typeof value.ui !== 'boolean') {
|
|
307
|
+
errors.push('hub.soundscape.ui must be true or false.');
|
|
308
|
+
} else {
|
|
309
|
+
out.ui = value.ui;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const component = (name, where) => {
|
|
313
|
+
if (typeof name !== 'string' || !/^[A-Za-z][A-Za-z0-9_]*$/.test(name)) {
|
|
314
|
+
errors.push(`${where} must be a component name.`);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
const named = (name, names, where) => {
|
|
318
|
+
if (!names.includes(name)) {
|
|
319
|
+
errors.push(`${where} must be one of ${names.join(', ')}.`);
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
const map = (entries, names, where, components = false) => {
|
|
323
|
+
if (!isObject(entries)) {
|
|
324
|
+
errors.push(`${where} must be an object.`);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
for (const [id, name] of Object.entries(entries)) {
|
|
328
|
+
if (!id.trim()) {
|
|
329
|
+
errors.push(`${where} needs a non-empty actor id.`);
|
|
330
|
+
}
|
|
331
|
+
if (components) {
|
|
332
|
+
component(id, `${where}.${id}`);
|
|
333
|
+
}
|
|
334
|
+
named(name, names, `${where}.${id}`);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
if (value.zones !== undefined) {
|
|
338
|
+
component(value.zones, 'hub.soundscape.zones');
|
|
339
|
+
out.zones = value.zones;
|
|
340
|
+
}
|
|
341
|
+
if (value.steps !== undefined && typeof value.steps !== 'boolean') {
|
|
342
|
+
if (!isObject(value.steps)) {
|
|
343
|
+
errors.push('hub.soundscape.steps must be true or false or an object.');
|
|
344
|
+
} else {
|
|
345
|
+
const steps = value.steps;
|
|
346
|
+
unknownKeys(steps, ['default', 'zones', 'paths'], 'hub.soundscape.steps', errors);
|
|
347
|
+
if (steps.default !== undefined) {
|
|
348
|
+
named(steps.default, SOUNDSCAPE_SURFACES, 'hub.soundscape.steps.default');
|
|
349
|
+
}
|
|
350
|
+
if (steps.zones !== undefined) {
|
|
351
|
+
map(steps.zones, SOUNDSCAPE_SURFACES, 'hub.soundscape.steps.zones');
|
|
352
|
+
if (value.zones === undefined) {
|
|
353
|
+
errors.push('hub.soundscape.steps.zones needs hub.soundscape.zones.');
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (steps.paths !== undefined) {
|
|
357
|
+
component(steps.paths, 'hub.soundscape.steps.paths');
|
|
358
|
+
}
|
|
359
|
+
out.steps = { ...steps };
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (value.ambience !== undefined) {
|
|
363
|
+
if (!isObject(value.ambience)) {
|
|
364
|
+
errors.push('hub.soundscape.ambience must be an object.');
|
|
365
|
+
} else {
|
|
366
|
+
const ambience = value.ambience;
|
|
367
|
+
unknownKeys(ambience, ['beds', 'default', 'spots', 'music'], 'hub.soundscape.ambience', errors);
|
|
368
|
+
if (ambience.default !== undefined) {
|
|
369
|
+
named(ambience.default, SOUNDSCAPE_BEDS, 'hub.soundscape.ambience.default');
|
|
370
|
+
}
|
|
371
|
+
if (ambience.beds !== undefined) {
|
|
372
|
+
map(ambience.beds, SOUNDSCAPE_BEDS, 'hub.soundscape.ambience.beds');
|
|
373
|
+
if (value.zones === undefined) {
|
|
374
|
+
errors.push('hub.soundscape.ambience.beds needs hub.soundscape.zones.');
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (ambience.spots !== undefined) {
|
|
378
|
+
map(ambience.spots, SOUNDSCAPE_BEDS, 'hub.soundscape.ambience.spots', true);
|
|
379
|
+
}
|
|
380
|
+
if (ambience.music !== undefined && typeof ambience.music !== 'boolean') {
|
|
381
|
+
errors.push('hub.soundscape.ambience.music must be true or false.');
|
|
382
|
+
}
|
|
383
|
+
out.ambience = { ...ambience };
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
return out;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
function readPlace(block, where, defaultScene, serverMax, sceneExists, errors, destinations, bundle, interest) {
|
|
132
390
|
const place = {};
|
|
133
391
|
|
|
134
392
|
place.title = typeof block.title === 'string' ? block.title.trim() : '';
|
|
@@ -153,6 +411,12 @@ function readPlace(block, where, defaultScene, serverMax, sceneExists, errors, d
|
|
|
153
411
|
}
|
|
154
412
|
|
|
155
413
|
place.lateJoin = block.lateJoin ?? false;
|
|
414
|
+
if (block.push !== undefined) {
|
|
415
|
+
if (!block.push || typeof block.push !== 'object' || Array.isArray(block.push) ||
|
|
416
|
+
Object.keys(block.push).join(',') !== 'version' || block.push.version !== 1) {
|
|
417
|
+
errors.push(`${where}.push must be { version: 1 } or absent.`);
|
|
418
|
+
} else {place.push = { version: 1 };}
|
|
419
|
+
}
|
|
156
420
|
if (typeof place.lateJoin !== 'boolean') {
|
|
157
421
|
errors.push(`${where}.lateJoin must be true or false.`);
|
|
158
422
|
}
|
|
@@ -169,12 +433,16 @@ function readPlace(block, where, defaultScene, serverMax, sceneExists, errors, d
|
|
|
169
433
|
|
|
170
434
|
place.nearestPlayers = intIn(
|
|
171
435
|
block.nearestPlayers,
|
|
172
|
-
NEAREST_PLAYERS,
|
|
436
|
+
interest === 'cells' ? NEAREST_PLAYERS_CELLS : NEAREST_PLAYERS,
|
|
173
437
|
1,
|
|
174
438
|
NEAREST_PLAYERS_CAP,
|
|
175
439
|
`${where}.nearestPlayers`,
|
|
176
440
|
errors,
|
|
177
441
|
);
|
|
442
|
+
if (interest === 'cells') {
|
|
443
|
+
place.interest = interest;
|
|
444
|
+
place.nearestPlayersFallback = block.nearestPlayers ?? NEAREST_PLAYERS;
|
|
445
|
+
}
|
|
178
446
|
place.arrival = readArrival(block.arrival, `${where}.arrival`, errors);
|
|
179
447
|
place.result = block.result === undefined ? null : readResult(block.result, `${where}.result`, errors);
|
|
180
448
|
// A game has a longest visit; a place with no result (a town) has none
|
|
@@ -207,9 +475,262 @@ function readPlace(block, where, defaultScene, serverMax, sceneExists, errors, d
|
|
|
207
475
|
if (hud) {
|
|
208
476
|
place.hud = hud;
|
|
209
477
|
}
|
|
478
|
+
const decor = readDecor(block.decor, `${where}.decor`, errors);
|
|
479
|
+
if (decor) {
|
|
480
|
+
place.decor = decor;
|
|
481
|
+
}
|
|
482
|
+
if (Object.hasOwn(block, 'analytics')) {
|
|
483
|
+
if (block.analytics !== true || where !== 'hub') {errors.push(`${where}.analytics is main-place only and must be true or absent.`);}
|
|
484
|
+
else {place.analytics = true;}
|
|
485
|
+
}
|
|
486
|
+
if (Object.hasOwn(block, 'fpsTelemetry')) {
|
|
487
|
+
const fps = block.fpsTelemetry;
|
|
488
|
+
if (where !== 'hub' || block.analytics !== true || !isObject(fps) ||
|
|
489
|
+
Object.keys(fps).some((key) => !['buildSha', 'scene'].includes(key)) ||
|
|
490
|
+
typeof fps.buildSha !== 'string' || !/^[0-9a-f]{40}$/.test(fps.buildSha) || typeof fps.scene !== 'string' || !/^[a-zA-Z0-9_./-]{1,160}$/.test(fps.scene) || fps.scene !== place.scene) {
|
|
491
|
+
errors.push(`${where}.fpsTelemetry requires analytics, a full buildSha and the main scene.`);
|
|
492
|
+
} else {place.fpsTelemetry = { buildSha: fps.buildSha, scene: fps.scene };}
|
|
493
|
+
}
|
|
494
|
+
if (Object.hasOwn(block, 'analyticsRounds')) {
|
|
495
|
+
if (block.analyticsRounds !== 'authored') {errors.push(`${where}.analyticsRounds must be authored or absent.`);}
|
|
496
|
+
else {place.analyticsRounds = 'authored';}
|
|
497
|
+
}
|
|
498
|
+
if (Object.hasOwn(block, 'analyticsV111')) {
|
|
499
|
+
if (block.analyticsV111 !== true || where !== 'hub') {errors.push(`${where}.analyticsV111 is main-place only and must be true or absent.`);}
|
|
500
|
+
else if (block.analytics !== true) {errors.push(`${where}.analyticsV111 requires analytics: true.`);}
|
|
501
|
+
else {place.analyticsV111 = true;}
|
|
502
|
+
}
|
|
503
|
+
if (Object.hasOwn(block, 'loadTelemetry')) {
|
|
504
|
+
if (block.loadTelemetry !== true || where !== 'hub') {errors.push(`${where}.loadTelemetry is main-place only and must be true or absent.`);}
|
|
505
|
+
else if (block.analytics !== true || block.analyticsV111 !== true) {errors.push(`${where}.loadTelemetry requires analytics: true and analyticsV111: true.`);}
|
|
506
|
+
else {place.loadTelemetry = true;}
|
|
507
|
+
}
|
|
508
|
+
if (Object.hasOwn(block, 'visibility')) {
|
|
509
|
+
if (block.visibility !== true) {
|
|
510
|
+
errors.push(`${where}.visibility must be true or absent.`);
|
|
511
|
+
} else {
|
|
512
|
+
place.visibility = true;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
if (Object.hasOwn(block, 'anonymousEntry')) {
|
|
516
|
+
if (block.anonymousEntry !== true) {
|
|
517
|
+
errors.push(`${where}.anonymousEntry must be true or absent.`);
|
|
518
|
+
} else {
|
|
519
|
+
place.anonymousEntry = true;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
if (Object.hasOwn(block, 'actions')) {
|
|
523
|
+
if (block.actions !== true) {
|
|
524
|
+
errors.push(`${where}.actions must be true or absent.`);
|
|
525
|
+
} else {
|
|
526
|
+
place.actions = true;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (Object.hasOwn(block, 'invite')) {
|
|
530
|
+
if (block.invite !== true) {errors.push(`${where}.invite must be true or absent.`);}
|
|
531
|
+
else {place.invite = true;}
|
|
532
|
+
}
|
|
533
|
+
if (Object.hasOwn(block, 'companion')) {
|
|
534
|
+
if (block.companion === true) {
|
|
535
|
+
place.companion = true;
|
|
536
|
+
} else if (isObject(block.companion)) {
|
|
537
|
+
const value = block.companion, chat = value.chat;
|
|
538
|
+
unknownKeys(value, ['chat'], `${where}.companion`, errors);
|
|
539
|
+
if (!isObject(chat)) {
|
|
540
|
+
errors.push(`${where}.companion.chat must be an object.`);
|
|
541
|
+
} else {
|
|
542
|
+
unknownKeys(chat, ['character', 'name'], `${where}.companion.chat`, errors);
|
|
543
|
+
// The character API accepts non-empty ids up to 100 characters / 128 bytes.
|
|
544
|
+
if (
|
|
545
|
+
typeof chat.character !== 'string' || !chat.character.trim() || chat.character.length > 100 || chat.character.includes('\0') ||
|
|
546
|
+
/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/.test(chat.character) ||
|
|
547
|
+
new TextEncoder().encode(chat.character).length > 128 ||
|
|
548
|
+
!Array.isArray(bundle?.characters) || !bundle.characters.some((c) => c?.id === chat.character)
|
|
549
|
+
) {
|
|
550
|
+
errors.push(`${where}.companion.chat.character must name a character id in characterBundle (1..100 characters, at most 128 bytes).`);
|
|
551
|
+
}
|
|
552
|
+
if (typeof chat.name !== 'string' || !chat.name.trim() || Array.from(chat.name).length > 24 || /[\u0000-\u001f\u007f-\u009f]/.test(chat.name)) {
|
|
553
|
+
errors.push(`${where}.companion.chat.name must be 1..24 characters without control characters.`);
|
|
554
|
+
}
|
|
555
|
+
place.companion = true;
|
|
556
|
+
place.companionChat = { character: chat.character, name: chat.name };
|
|
557
|
+
}
|
|
558
|
+
if (!place.npcs) {
|
|
559
|
+
errors.push(`${where}.companion.chat needs npcs configured with a mind slot.`);
|
|
560
|
+
}
|
|
561
|
+
} else {
|
|
562
|
+
errors.push(`${where}.companion must be true, an object with chat, or absent.`);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
// v1.72: a game that handles a player's return within a round asks to have
|
|
566
|
+
// them arrived again (`hello`, `greetLate`). Carried only when true.
|
|
567
|
+
if (Object.hasOwn(block, 'resume')) {
|
|
568
|
+
const keep = isObject(block.resume) && block.resume.keep === true;
|
|
569
|
+
if (block.resume !== true && !keep) {
|
|
570
|
+
errors.push(`${where}.resume must be true or absent, or { keep: true }.`);
|
|
571
|
+
} else if (!place.result) {
|
|
572
|
+
errors.push(`${where}.resume is only for a place with a result.`);
|
|
573
|
+
} else {
|
|
574
|
+
place.resume = true;
|
|
575
|
+
if (keep) {
|
|
576
|
+
unknownKeys(block.resume, ['keep'], `${where}.resume`, errors);
|
|
577
|
+
place.resumeKeep = true;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
// Private visibility is retained only by the bounded 60-second result-place
|
|
582
|
+
// keep mode. It remains server-only and adds no public place or wire field.
|
|
583
|
+
if (Object.hasOwn(block, 'resumeVisibility')) {
|
|
584
|
+
if (block.resumeVisibility !== true) {
|
|
585
|
+
errors.push(`${where}.resumeVisibility must be true or absent.`);
|
|
586
|
+
} else if (place.resumeKeep !== true) {
|
|
587
|
+
errors.push(`${where}.resumeVisibility requires resume: { keep: true }.`);
|
|
588
|
+
} else {
|
|
589
|
+
place.resumeVisibility = true;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
// v1.98: town pose retention never changes result-place resume semantics.
|
|
593
|
+
if (Object.hasOwn(block, 'resumePose')) {
|
|
594
|
+
if (block.resumePose !== true) {
|
|
595
|
+
errors.push(`${where}.resumePose must be true or absent.`);
|
|
596
|
+
} else if (place.result) {
|
|
597
|
+
errors.push(`${where}.resumePose is only for a place without a result.`);
|
|
598
|
+
} else {
|
|
599
|
+
place.resumePose = true;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
// v1.115: owner-house transport opt-in; Ghost alone grants the owner binding.
|
|
603
|
+
if (Object.hasOwn(block, 'houseResume')) {
|
|
604
|
+
if (block.houseResume !== true) {
|
|
605
|
+
errors.push(`${where}.houseResume must be true or absent.`);
|
|
606
|
+
} else if (place.result) {
|
|
607
|
+
errors.push(`${where}.houseResume is only for a place without a result.`);
|
|
608
|
+
} else {
|
|
609
|
+
place.houseResume = true;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
// v1.99: private relationship freshness is per place and server-only.
|
|
613
|
+
if (Object.hasOwn(block, 'freshFriends')) {
|
|
614
|
+
if (block.freshFriends !== true) {
|
|
615
|
+
errors.push(`${where}.freshFriends must be true or absent.`);
|
|
616
|
+
} else {
|
|
617
|
+
place.freshFriends = true;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
// v1.101: the trusted age stamp only changes opted-in NPC conversations.
|
|
621
|
+
if (Object.hasOwn(block, 'talkLog')) {
|
|
622
|
+
if (block.talkLog !== true) {
|
|
623
|
+
errors.push(`${where}.talkLog must be true or absent.`);
|
|
624
|
+
} else {
|
|
625
|
+
place.talkLog = true;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
if (Object.hasOwn(block, 'under13Choices')) {
|
|
630
|
+
if (block.under13Choices !== true) {
|
|
631
|
+
errors.push(`${where}.under13Choices must be true or absent.`);
|
|
632
|
+
} else {
|
|
633
|
+
place.under13Choices = true;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
if (Object.hasOwn(block, 'ask')) {
|
|
637
|
+
if (block.ask !== true) {
|
|
638
|
+
errors.push(`${where}.ask must be true or absent.`);
|
|
639
|
+
} else {
|
|
640
|
+
place.ask = true;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if (Object.hasOwn(block, 'menu')) {
|
|
644
|
+
if (block.menu !== true) {
|
|
645
|
+
errors.push(`${where}.menu must be true or absent.`);
|
|
646
|
+
} else {
|
|
647
|
+
place.menu = true;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
// v1.68: the choice card, likewise carried only by a place that declares it.
|
|
651
|
+
if (block.ballot !== undefined) {
|
|
652
|
+
const ballot = readBallot(block.ballot, `${where}.ballot`, errors);
|
|
653
|
+
if (ballot) {
|
|
654
|
+
place.ballot = ballot;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
// v1.117: keep only pose; ordinary leave/arrive own the visit lifecycle.
|
|
658
|
+
if (Object.hasOwn(block, 'resumeArrivalPose')) {
|
|
659
|
+
if (block.resumeArrivalPose !== true) {
|
|
660
|
+
errors.push(`${where}.resumeArrivalPose must be true or absent.`);
|
|
661
|
+
} else if (place.resumeKeep || place.resumePose || place.houseResume) {
|
|
662
|
+
errors.push(`${where}.resumeArrivalPose cannot combine with retained-visit modes.`);
|
|
663
|
+
} else if (place.result && place.resume !== true) {
|
|
664
|
+
errors.push(`${where}.resumeArrivalPose requires resume: true on a result place.`);
|
|
665
|
+
} else {
|
|
666
|
+
place.resumeArrivalPose = true;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
210
669
|
return place;
|
|
211
670
|
}
|
|
212
671
|
|
|
672
|
+
// Words of the deck's own on the card: trimmed, 1-`max` characters, one line
|
|
673
|
+
// (no control characters). The text, or null.
|
|
674
|
+
export function cardText(value, max) {
|
|
675
|
+
if (typeof value !== 'string') {
|
|
676
|
+
return null;
|
|
677
|
+
}
|
|
678
|
+
const text = value.trim();
|
|
679
|
+
if (!text || text.length > max || [...text].some((c) => c.charCodeAt(0) < 32 || c.charCodeAt(0) === 127)) {
|
|
680
|
+
return null;
|
|
681
|
+
}
|
|
682
|
+
return text;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// `ballot`: absent or false is none; true is the card with no lines (faces
|
|
686
|
+
// and options only); an object lists the deck's fixed lines, each
|
|
687
|
+
// `{ id, text, about }`, `about` "face" (said about a player whose face is
|
|
688
|
+
// tapped first) or "self".
|
|
689
|
+
function readBallot(value, where, errors) {
|
|
690
|
+
if (value === undefined || value === false) {
|
|
691
|
+
return null;
|
|
692
|
+
}
|
|
693
|
+
if (value === true) {
|
|
694
|
+
return { lines: [] };
|
|
695
|
+
}
|
|
696
|
+
if (!isObject(value)) {
|
|
697
|
+
errors.push(`${where} must be true, false or an object.`);
|
|
698
|
+
return null;
|
|
699
|
+
}
|
|
700
|
+
unknownKeys(value, ['lines'], where, errors);
|
|
701
|
+
if (value.lines === undefined) {
|
|
702
|
+
return { lines: [] };
|
|
703
|
+
}
|
|
704
|
+
if (!Array.isArray(value.lines) || value.lines.length > BALLOT_MAX_LINES) {
|
|
705
|
+
errors.push(`${where}.lines must be a list of at most ${BALLOT_MAX_LINES} lines.`);
|
|
706
|
+
return null;
|
|
707
|
+
}
|
|
708
|
+
const lines = [];
|
|
709
|
+
const seen = new Set();
|
|
710
|
+
value.lines.forEach((line, i) => {
|
|
711
|
+
const at = `${where}.lines[${i}]`;
|
|
712
|
+
if (!isObject(line)) {
|
|
713
|
+
errors.push(`${at} must be an object { id, text, about }.`);
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
unknownKeys(line, ['id', 'text', 'about'], at, errors);
|
|
717
|
+
const text = cardText(line.text, BALLOT_LINE_MAX);
|
|
718
|
+
if (typeof line.id !== 'string' || !BALLOT_LINE_ID.test(line.id)) {
|
|
719
|
+
errors.push(`${at}.id must be [a-z0-9-], 1-24 characters.`);
|
|
720
|
+
} else if (seen.has(line.id)) {
|
|
721
|
+
errors.push(`${at}.id "${line.id}" is listed twice.`);
|
|
722
|
+
} else if (text === null) {
|
|
723
|
+
errors.push(`${at}.text must be 1-${BALLOT_LINE_MAX} characters on one line.`);
|
|
724
|
+
} else if (!BALLOT_ABOUT.includes(line.about)) {
|
|
725
|
+
errors.push(`${at}.about must be "face" or "self".`);
|
|
726
|
+
} else {
|
|
727
|
+
seen.add(line.id);
|
|
728
|
+
lines.push({ id: line.id, text, about: line.about });
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
return { lines };
|
|
732
|
+
}
|
|
733
|
+
|
|
213
734
|
// `hud`: absent is none; an object turns each option on by name. `clear:
|
|
214
735
|
// false` (and an empty object) is the same as leaving it out.
|
|
215
736
|
function readHud(value, where, errors) {
|
|
@@ -328,6 +849,42 @@ export function isSoundPath(path) {
|
|
|
328
849
|
);
|
|
329
850
|
}
|
|
330
851
|
|
|
852
|
+
// Shared by manifest parsing, scene checks and body setup. One slot is the
|
|
853
|
+
// original contract and is never added to the stored manifest or the wire.
|
|
854
|
+
export function readNpcTurnsAtOnce(value, fallback = 1, where = 'HubNpc.turnsAtOnce', errors = []) {
|
|
855
|
+
if (value === undefined) {
|
|
856
|
+
return fallback;
|
|
857
|
+
}
|
|
858
|
+
if (!Number.isInteger(value) || value < 1 || value > 3) {
|
|
859
|
+
errors.push(`${where} must be an integer from 1 to 3.`);
|
|
860
|
+
return fallback;
|
|
861
|
+
}
|
|
862
|
+
return value;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
// v1.142: optional published chips; ghost remains the publish authority.
|
|
866
|
+
function validateChildAsks(bundle, errors) {
|
|
867
|
+
for (const [index, character] of (Array.isArray(bundle?.characters) ? bundle.characters : []).entries()) {
|
|
868
|
+
if (character?.childAsks === undefined) {continue;}
|
|
869
|
+
const where = `characterBundle.characters[${index}].childAsks`;
|
|
870
|
+
const asks = character.childAsks;
|
|
871
|
+
if (!Array.isArray(asks) || asks.length < 3 || asks.length > 4) {
|
|
872
|
+
errors.push(`${where} must have 3-4 choices.`);
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
const ids = new Set();
|
|
876
|
+
for (const ask of asks) {
|
|
877
|
+
if (!isObject(ask) || typeof ask.id !== 'string' || !ask.id.trim() || ids.has(ask.id)
|
|
878
|
+
|| typeof ask.label !== 'string' || !ask.label.trim() || ask.label.length > 40
|
|
879
|
+
|| typeof ask.prompt !== 'string' || !ask.prompt.trim() || ask.prompt.length > 300) {
|
|
880
|
+
errors.push(`${where} needs unique non-empty ids, labels of 1-40 characters and prompts of 1-300 characters.`);
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
ids.add(ask.id);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
331
888
|
// Where a place's NPC minds live (§13): the place itself (every layer talks
|
|
332
889
|
// to ghost's one place mind), optionally a destination route whose world an
|
|
333
890
|
// older SDK joins instead, and how much conversation each character takes.
|
|
@@ -336,7 +893,7 @@ function readNpcs(value, destinations, bundle, where, errors) {
|
|
|
336
893
|
errors.push(`${where} must be an object.`);
|
|
337
894
|
return null;
|
|
338
895
|
}
|
|
339
|
-
unknownKeys(value, ['route', 'slot', 'turnsPerMinute', 'disclosure', 'followSec'], where, errors);
|
|
896
|
+
unknownKeys(value, ['route', 'slot', 'turnsPerMinute', 'turnsAtOnce', 'disclosure', 'followSec'], where, errors);
|
|
340
897
|
const npcs = { route: null, slot: 'main', turnsPerMinute: 6, disclosure: 'participants', followSec: 120 };
|
|
341
898
|
// A route is optional: without one the minds are the place's (ghost's place
|
|
342
899
|
// mind, reached from every layer); with one, an SDK that cannot address the
|
|
@@ -366,6 +923,10 @@ function readNpcs(value, destinations, bundle, where, errors) {
|
|
|
366
923
|
}
|
|
367
924
|
}
|
|
368
925
|
npcs.turnsPerMinute = intIn(value.turnsPerMinute, 6, 1, 30, `${where}.turnsPerMinute`, errors);
|
|
926
|
+
const turnsAtOnce = readNpcTurnsAtOnce(value.turnsAtOnce, 1, `${where}.turnsAtOnce`, errors);
|
|
927
|
+
if (turnsAtOnce > 1) {
|
|
928
|
+
npcs.turnsAtOnce = turnsAtOnce;
|
|
929
|
+
}
|
|
369
930
|
npcs.followSec = intIn(value.followSec, 120, 10, 600, `${where}.followSec`, errors);
|
|
370
931
|
if (value.disclosure !== undefined) {
|
|
371
932
|
// Read for decks that set it, and no longer acted on (v1.17): a player's
|
|
@@ -556,11 +1117,17 @@ export function checkResult(place, value) {
|
|
|
556
1117
|
// draws from, and nothing it does not need.
|
|
557
1118
|
export function publicPlace(id, place) {
|
|
558
1119
|
return {
|
|
1120
|
+
...(place.push?.version === 1 ? { push: { version: 1 } } : {}),
|
|
559
1121
|
contract: CONTRACT_VERSION,
|
|
560
1122
|
id,
|
|
1123
|
+
...(place.act === true ? { act: true } : {}),
|
|
561
1124
|
title: place.title,
|
|
562
1125
|
scene: place.scene,
|
|
563
1126
|
controller: place.controller,
|
|
1127
|
+
...(place.fpsTelemetry ? { fpsTelemetry: { ...place.fpsTelemetry } } : {}),
|
|
1128
|
+
// v1.138: only an opted-in town tells its browsers to report load stages.
|
|
1129
|
+
...(place.loadTelemetry === true ? { loadTelemetry: true } : {}),
|
|
1130
|
+
...(place.interest ? { interest: place.interest, nearestPlayers: place.nearestPlayers } : {}),
|
|
564
1131
|
maxDurationSec: place.maxDurationSec,
|
|
565
1132
|
// v1.3: the hub chrome offers Grab only where this is set; a place
|
|
566
1133
|
// without it is sent exactly what it was.
|
|
@@ -569,6 +1136,18 @@ export function publicPlace(id, place) {
|
|
|
569
1136
|
...(place.idle ? { idle: { emotes: place.idle.emotes, seats: place.idle.seats, sounds: [...place.idle.sounds] } } : {}),
|
|
570
1137
|
// v1.26: likewise the HUD's layout.
|
|
571
1138
|
...(place.hud ? { hud: { ...place.hud } } : {}),
|
|
1139
|
+
...(place.decor ? { decor: place.decor } : {}),
|
|
1140
|
+
...(place.visibility === true ? { visibility: true } : {}),
|
|
1141
|
+
...(place.actions === true ? { actions: true } : {}),
|
|
1142
|
+
...(place.anonymousEntry === true ? { anonymousEntry: true } : {}),
|
|
1143
|
+
...(place.invite === true ? { invite: true } : {}),
|
|
1144
|
+
...(place.companion === true ? { companion: true } : {}),
|
|
1145
|
+
...(place.companionChat ? { companionChat: { name: place.companionChat.name } } : {}),
|
|
1146
|
+
...(place.resume === true ? { resume: true } : {}),
|
|
1147
|
+
...(place.ask === true ? { ask: true } : {}),
|
|
1148
|
+
...(place.menu === true ? { menu: true } : {}),
|
|
1149
|
+
// v1.68: likewise the choice card's lines, worded by the client from ids.
|
|
1150
|
+
...(place.ballot ? { ballot: { lines: place.ballot.lines.map((line) => ({ ...line })) } } : {}),
|
|
572
1151
|
result: place.result
|
|
573
1152
|
? { score: place.result.score ? { unit: place.result.score.unit, better: place.result.score.better } : null }
|
|
574
1153
|
: null,
|