castle-web-cli 0.4.239 → 0.4.240
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.js +5 -1
- package/dist/api.d.ts +20 -0
- package/dist/api.js +57 -0
- package/dist/bundle.d.ts +38 -1
- package/dist/bundle.js +309 -13
- package/dist/castle-host/host.js +163 -11
- package/dist/castleJson.d.ts +10 -0
- package/dist/castleJson.js +46 -2
- package/dist/check.js +5 -2
- package/dist/devSessionServer.js +4 -1
- package/dist/devSessionStorage.d.ts +1 -0
- package/dist/devSessionStorage.js +32 -7
- package/dist/importOrder.d.ts +2 -0
- package/dist/importOrder.js +29 -0
- package/dist/index.js +6 -3
- package/dist/init.js +24 -2
- package/dist/platformDoc.js +2 -1
- package/dist/playPagePolicy.js +5 -1
- package/dist/resetLeaderboards.d.ts +8 -1
- package/dist/resetLeaderboards.js +43 -8
- package/dist/save-deck.d.ts +32 -2
- package/dist/save-deck.js +240 -39
- package/kits/base/CLAUDE.md +1 -1
- package/kits/base/castle.json +1 -1
- package/kits/base/sdk/README.md +174 -6
- package/kits/base/sdk/analytics.d.ts +8 -0
- package/kits/base/sdk/analytics.js +92 -0
- package/kits/base/sdk/castle.d.ts +5 -1
- package/kits/base/sdk/castle.js +2 -0
- package/kits/base/sdk/commands.d.ts +48 -0
- package/kits/base/sdk/commands.js +1 -0
- package/kits/base/sdk/debugConsole.d.ts +17 -0
- package/kits/base/sdk/debugConsole.js +154 -0
- package/kits/base/sdk/experiments.js +24 -1
- package/kits/base/sdk/hostRetry.d.ts +7 -0
- package/kits/base/sdk/hostRetry.js +57 -0
- package/kits/base/sdk/hub.d.ts +20 -2
- package/kits/base/sdk/hub.js +99 -13
- package/kits/base/sdk/multiplayer.d.ts +2 -0
- package/kits/base/sdk/multiplayer.js +168 -26
- package/kits/base/sdk/reconnectBudget.d.ts +6 -0
- package/kits/base/sdk/reconnectBudget.js +41 -1
- package/kits/base/sdk/runtime.js +36 -19
- package/kits/base/sdk/server/hub.d.ts +19 -0
- package/kits/base/sdk/server/hub.js +12 -0
- package/kits/base/sdk/server/platformHandle.d.ts +1 -0
- package/kits/base/sdk/server/wrapper.d.ts +1 -1
- package/kits/base/sdk/server/wrapper.js +26 -1
- package/kits/base/sdk/transport.d.ts +2 -1
- package/kits/base/sdk/transport.js +35 -0
- package/kits/hub-game/CLAUDE.md +66 -19
- package/kits/hub-game/code/client/act.js +9 -6
- package/kits/hub-game/code/client/actCore.js +26 -6
- package/kits/hub-game/code/client/actGateLog.js +36 -0
- package/kits/hub-game/code/client/actionOverflow.js +29 -8
- package/kits/hub-game/code/client/actionRailSurface.js +186 -0
- package/kits/hub-game/code/client/actionRailTree.js +173 -0
- package/kits/hub-game/code/client/askSurface.js +85 -0
- package/kits/hub-game/code/client/askTree.js +51 -0
- package/kits/hub-game/code/client/attention.js +31 -6
- package/kits/hub-game/code/client/ballot.js +42 -5
- package/kits/hub-game/code/client/ballotSurface.js +115 -0
- package/kits/hub-game/code/client/ballotTree.js +180 -0
- package/kits/hub-game/code/client/catchingUp.js +19 -0
- package/kits/hub-game/code/client/celebrate.js +66 -0
- package/kits/hub-game/code/client/chrome.js +473 -53
- package/kits/hub-game/code/client/companion.js +93 -23
- package/kits/hub-game/code/client/companionDress.js +1 -1
- package/kits/hub-game/code/client/cornerSurface.js +106 -0
- package/kits/hub-game/code/client/cornerTree.js +83 -0
- package/kits/hub-game/code/client/decor.js +20 -11
- package/kits/hub-game/code/client/deviceStorage.js +121 -0
- package/kits/hub-game/code/client/disguise.js +23 -0
- package/kits/hub-game/code/client/disguiseDraw.js +87 -0
- package/kits/hub-game/code/client/dockSurface.js +206 -0
- package/kits/hub-game/code/client/dockTree.js +232 -0
- package/kits/hub-game/code/client/earned.js +29 -0
- package/kits/hub-game/code/client/emoteSurface.js +188 -0
- package/kits/hub-game/code/client/emoteTree.js +264 -0
- package/kits/hub-game/code/client/farAvatars.js +4 -3
- package/kits/hub-game/code/client/fpsTelemetry.js +3 -1
- package/kits/hub-game/code/client/grab.js +121 -50
- package/kits/hub-game/code/client/holdShow.js +19 -0
- package/kits/hub-game/code/client/hookLayer.js +96 -12
- package/kits/hub-game/code/client/hubControls.js +7 -1
- package/kits/hub-game/code/client/hudSurface.js +11 -3
- package/kits/hub-game/code/client/hudTree.js +7 -4
- package/kits/hub-game/code/client/idle.js +21 -3
- package/kits/hub-game/code/client/invites.js +24 -3
- package/kits/hub-game/code/client/keys.js +15 -0
- package/kits/hub-game/code/client/labelsNear.js +8 -1
- package/kits/hub-game/code/client/layoutCache.js +57 -8
- package/kits/hub-game/code/client/loadingCover.js +53 -4
- package/kits/hub-game/code/client/menuIcons.js +15 -0
- package/kits/hub-game/code/client/menuSurface.js +102 -0
- package/kits/hub-game/code/client/menuTree.js +135 -0
- package/kits/hub-game/code/client/modelLook.js +41 -0
- package/kits/hub-game/code/client/pickerSurface.js +152 -0
- package/kits/hub-game/code/client/pickerTree.js +163 -0
- package/kits/hub-game/code/client/pushVisit.js +4 -2
- package/kits/hub-game/code/client/quality.js +188 -29
- package/kits/hub-game/code/client/qualityEntry.js +10 -1
- package/kits/hub-game/code/client/quickChatSurface.js +222 -0
- package/kits/hub-game/code/client/quickChatTree.js +201 -0
- package/kits/hub-game/code/client/rehello.js +75 -0
- package/kits/hub-game/code/client/renderVisibility.js +17 -0
- package/kits/hub-game/code/client/replay.js +118 -0
- package/kits/hub-game/code/client/role.js +3 -0
- package/kits/hub-game/code/client/safeLayout.js +441 -56
- package/kits/hub-game/code/client/safeStyle.js +13 -10
- package/kits/hub-game/code/client/say.js +2 -0
- package/kits/hub-game/code/client/soundSurface.js +77 -0
- package/kits/hub-game/code/client/soundTree.js +74 -0
- package/kits/hub-game/code/client/soundscape.js +12 -9
- package/kits/hub-game/code/client/soundscapeCues.js +1 -1
- package/kits/hub-game/code/client/state.js +67 -1
- package/kits/hub-game/code/client/stuckSurface.js +76 -0
- package/kits/hub-game/code/client/stuckTree.js +67 -0
- package/kits/hub-game/code/client/talk.js +42 -12
- package/kits/hub-game/code/client/talkTree.js +4 -2
- package/kits/hub-game/code/client/textAskSurface.js +147 -0
- package/kits/hub-game/code/client/textAskTree.js +67 -0
- package/kits/hub-game/code/client/tiers.js +252 -27
- package/kits/hub-game/code/client/together.js +4 -1
- package/kits/hub-game/code/client/uiDom.js +86 -8
- package/kits/hub-game/code/client/uiTree.js +33 -4
- package/kits/hub-game/code/client/vehicle.js +72 -51
- package/kits/hub-game/code/client/weakestTier.js +75 -31
- package/kits/hub-game/code/client/wear.js +159 -5
- package/kits/hub-game/code/client/worldLabels.js +205 -25
- package/kits/hub-game/code/companionSpec.js +4 -2
- package/kits/hub-game/code/server/act.js +3 -0
- package/kits/hub-game/code/server/actGate.js +83 -0
- package/kits/hub-game/code/server/actions.js +71 -15
- package/kits/hub-game/code/server/actors.js +20 -5
- package/kits/hub-game/code/server/analytics.js +35 -3
- package/kits/hub-game/code/server/ask.js +39 -3
- package/kits/hub-game/code/server/ballot.js +167 -4
- package/kits/hub-game/code/server/celebrate.js +64 -0
- package/kits/hub-game/code/server/companion.js +17 -2
- package/kits/hub-game/code/server/decor.js +11 -2
- package/kits/hub-game/code/server/disguise.js +63 -0
- package/kits/hub-game/code/server/earned.js +6 -2
- package/kits/hub-game/code/server/friendBests.js +13 -4
- package/kits/hub-game/code/server/friendsAmong.js +67 -8
- package/kits/hub-game/code/server/grab.js +12 -2
- package/kits/hub-game/code/server/heldOffers.js +142 -0
- package/kits/hub-game/code/server/holdShow.js +98 -0
- package/kits/hub-game/code/server/hub.js +851 -45
- package/kits/hub-game/code/server/idle.js +110 -9
- package/kits/hub-game/code/server/index.js +9 -0
- package/kits/hub-game/code/server/labels.js +13 -3
- package/kits/hub-game/code/server/manifest.js +94 -6
- package/kits/hub-game/code/server/menu.js +26 -3
- package/kits/hub-game/code/server/npcs.js +55 -9
- package/kits/hub-game/code/server/observe.js +67 -6
- package/kits/hub-game/code/server/players.js +8 -1
- package/kits/hub-game/code/server/replay.js +135 -0
- package/kits/hub-game/code/server/storageLimit.js +4 -1
- package/kits/hub-game/code/server/townDay.js +74 -0
- package/kits/hub-game/code/server/vehicle.js +3 -0
- package/kits/hub-game/code/server/vis.js +26 -4
- package/kits/hub-game/code/server/wallet.js +677 -0
- package/kits/hub-game/code/server/wear.js +13 -3
- package/kits/hub-game/code/server/writerLease.js +191 -0
- package/kits/hub-game/code/shared/act.js +1 -1
- package/kits/hub-game/code/shared/expression.js +6 -0
- package/kits/hub-game/code/shared/replay.js +37 -0
- package/kits/hub-game/code/systems/hub.js +427 -54
- package/kits/hub-game/docs/analytics.md +16 -2
- package/kits/hub-game/docs/contract.md +942 -99
- package/kits/hub-game/docs/home-pieces.md +5 -6
- package/kits/hub-game/docs/observed-progress.md +49 -1
- package/kits/hub-game/docs/vehicle-preset.md +23 -0
- package/kits/hub-game/index.html +1 -0
- package/kits/hub-game/models/hats/baker-cap.pxmodel +3 -3
- package/kits/hub-game/models/hats/bat-clip.pxmodel +3 -3
- package/kits/hub-game/models/hats/beekeeper.pxmodel +3 -3
- package/kits/hub-game/models/hats/cap.pxmodel +3 -3
- package/kits/hub-game/models/hats/captain.pxmodel +3 -3
- package/kits/hub-game/models/hats/chef-toque.pxmodel +3 -3
- package/kits/hub-game/models/hats/crooked-top.pxmodel +3 -3
- package/kits/hub-game/models/hats/delivery-cap.pxmodel +3 -3
- package/kits/hub-game/models/hats/fire-helmet.pxmodel +3 -3
- package/kits/hub-game/models/hats/flower-crown.pxmodel +3 -3
- package/kits/hub-game/models/hats/foam-crown.pxmodel +3 -3
- package/kits/hub-game/models/hats/hard-hat.pxmodel +3 -3
- package/kits/hub-game/models/hats/lantern.pxmodel +3 -3
- package/kits/hub-game/models/hats/laurel.pxmodel +3 -3
- package/kits/hub-game/models/hats/lighthouse.pxmodel +3 -3
- package/kits/hub-game/models/hats/nurse-cap.pxmodel +3 -3
- package/kits/hub-game/models/hats/police-cap.pxmodel +3 -3
- package/kits/hub-game/models/hats/sailor.pxmodel +3 -3
- package/kits/hub-game/models/hats/souwester.pxmodel +3 -3
- package/kits/hub-game/models/hats/straw.pxmodel +3 -3
- package/kits/hub-game/models/hats/sunflower.pxmodel +3 -3
- package/kits/hub-game/models/hats/sweatband.pxmodel +3 -3
- package/kits/hub-game/models/hats/teacher-beret.pxmodel +3 -3
- package/kits/hub-game/models/hats/witch.pxmodel +3 -3
- package/kits/hub-game/models/hold-show/daisy.pxmodel +231 -0
- package/kits/hub-game/models/hold-show/moonflower.pxmodel +171 -0
- package/kits/hub-game/models/hold-show/rose.pxmodel +191 -0
- package/kits/hub-game/models/hold-show/square/daisy.pxmodel +233 -0
- package/kits/hub-game/models/hold-show/square/moonflower.pxmodel +173 -0
- package/kits/hub-game/models/hold-show/square/rose.pxmodel +193 -0
- package/kits/hub-game/models/hold-show/square/sunflower.pxmodel +313 -0
- package/kits/hub-game/models/hold-show/square/tulip.pxmodel +133 -0
- package/kits/hub-game/models/hold-show/sunflower.pxmodel +311 -0
- package/kits/hub-game/models/hold-show/tulip.pxmodel +131 -0
- package/kits/hub-game/package-lock.json +3 -3
- package/kits/hub-game/package.json +4 -3
- package/kits/hub-game/scripts/fixtures/engine-models-stub.mjs +1 -0
- package/kits/hub-game/scripts/fixtures/hud-surface.json +12 -12
- package/kits/hub-game/scripts/fixtures/talk-surface.json +8 -8
- package/kits/hub-game/scripts/gen-hats.mjs +1 -1
- package/kits/hub-game/scripts/gen-hold-show.mjs +27 -0
- package/kits/hub-game/scripts/pack.mjs +89 -23
- package/kits/hub-game/scripts/test-act-client.mjs +5 -0
- package/kits/hub-game/scripts/test-act-core.mjs +32 -0
- package/kits/hub-game/scripts/test-act-gate.mjs +186 -0
- package/kits/hub-game/scripts/test-action-rail-crowded-dom.mjs +7 -1
- package/kits/hub-game/scripts/test-action-rail-default-dom.mjs +102 -0
- package/kits/hub-game/scripts/test-action-rail-never-silent-dom.mjs +50 -0
- package/kits/hub-game/scripts/test-action-rail-surface.mjs +368 -0
- package/kits/hub-game/scripts/test-action-rail-town-jobs-dom.mjs +118 -0
- package/kits/hub-game/scripts/test-actions-client.mjs +5 -3
- package/kits/hub-game/scripts/test-actions.mjs +24 -0
- package/kits/hub-game/scripts/test-actors.mjs +19 -0
- package/kits/hub-game/scripts/test-again-corner-dom.mjs +59 -0
- package/kits/hub-game/scripts/test-analytics.mjs +79 -0
- package/kits/hub-game/scripts/test-arrival-pose-server.mjs +25 -8
- package/kits/hub-game/scripts/test-ask-client.mjs +9 -0
- package/kits/hub-game/scripts/test-ask-surface.mjs +188 -0
- package/kits/hub-game/scripts/test-attention.mjs +43 -1
- package/kits/hub-game/scripts/test-ballot-sheet-dom.mjs +71 -0
- package/kits/hub-game/scripts/test-ballot-surface.mjs +276 -0
- package/kits/hub-game/scripts/test-ballot.mjs +420 -3
- package/kits/hub-game/scripts/test-ban-join.mjs +1 -1
- package/kits/hub-game/scripts/test-celebrate-client.mjs +62 -0
- package/kits/hub-game/scripts/test-celebrate.mjs +116 -0
- package/kits/hub-game/scripts/test-chat.mjs +73 -0
- package/kits/hub-game/scripts/test-companion-client.mjs +203 -21
- package/kits/hub-game/scripts/test-companion.mjs +110 -3
- package/kits/hub-game/scripts/test-control-layout-dom.mjs +57 -10
- package/kits/hub-game/scripts/test-corner-surface.mjs +268 -0
- package/kits/hub-game/scripts/test-decor-client.mjs +59 -3
- package/kits/hub-game/scripts/test-decor.mjs +27 -0
- package/kits/hub-game/scripts/test-device-class.mjs +4 -1
- package/kits/hub-game/scripts/test-disguise-client.mjs +281 -0
- package/kits/hub-game/scripts/test-disguise.mjs +176 -0
- package/kits/hub-game/scripts/test-dock-surface.mjs +404 -0
- package/kits/hub-game/scripts/test-door-stay-client.mjs +602 -0
- package/kits/hub-game/scripts/test-door-stay.mjs +613 -0
- package/kits/hub-game/scripts/test-earned-client.mjs +119 -0
- package/kits/hub-game/scripts/test-emote-surface.mjs +616 -0
- package/kits/hub-game/scripts/test-fps-telemetry.mjs +39 -4
- package/kits/hub-game/scripts/test-friend-bests.mjs +38 -12
- package/kits/hub-game/scripts/test-ghost-click-dom.mjs +75 -0
- package/kits/hub-game/scripts/test-grab-client.mjs +29 -2
- package/kits/hub-game/scripts/test-grab-orbit.mjs +260 -11
- package/kits/hub-game/scripts/test-grab.mjs +10 -1
- package/kits/hub-game/scripts/test-hats.mjs +28 -0
- package/kits/hub-game/scripts/test-held-offers.mjs +394 -0
- package/kits/hub-game/scripts/test-high-only.mjs +3 -3
- package/kits/hub-game/scripts/test-hold-show-client.mjs +175 -0
- package/kits/hub-game/scripts/test-hold-show.mjs +355 -0
- package/kits/hub-game/scripts/test-hub-controls.mjs +3 -1
- package/kits/hub-game/scripts/test-hub-idle.mjs +348 -0
- package/kits/hub-game/scripts/test-hub-leaving.mjs +21 -0
- package/kits/hub-game/scripts/test-hub-ops.mjs +119 -0
- package/kits/hub-game/scripts/test-hub-trip.mjs +240 -4
- package/kits/hub-game/scripts/test-hud-clear.mjs +83 -0
- package/kits/hub-game/scripts/test-hud-rate.mjs +2 -1
- package/kits/hub-game/scripts/test-idle.mjs +160 -0
- package/kits/hub-game/scripts/test-invites-client.mjs +53 -0
- package/kits/hub-game/scripts/test-labels.mjs +11 -0
- package/kits/hub-game/scripts/test-landscape-layout.mjs +20 -0
- package/kits/hub-game/scripts/test-loading-cover.mjs +67 -1
- package/kits/hub-game/scripts/test-manifest.mjs +27 -0
- package/kits/hub-game/scripts/test-menu-client.mjs +54 -5
- package/kits/hub-game/scripts/test-menu-surface.mjs +236 -0
- package/kits/hub-game/scripts/test-npcs.mjs +128 -0
- package/kits/hub-game/scripts/test-observed.mjs +171 -3
- package/kits/hub-game/scripts/test-pack.mjs +166 -0
- package/kits/hub-game/scripts/test-picker-surface.mjs +321 -0
- package/kits/hub-game/scripts/test-placeat-server.mjs +395 -0
- package/kits/hub-game/scripts/test-placement-cache.mjs +1 -1
- package/kits/hub-game/scripts/test-pointer-clear-dom.mjs +82 -0
- package/kits/hub-game/scripts/test-progress-reset.mjs +184 -6
- package/kits/hub-game/scripts/test-push-visit.mjs +9 -0
- package/kits/hub-game/scripts/test-quality.mjs +312 -9
- package/kits/hub-game/scripts/test-quick-chat-surface.mjs +511 -0
- package/kits/hub-game/scripts/test-rehello.mjs +237 -0
- package/kits/hub-game/scripts/test-rejoin-yaw.mjs +138 -0
- package/kits/hub-game/scripts/test-relations-among.mjs +13 -7
- package/kits/hub-game/scripts/test-relations-refresh.mjs +90 -2
- package/kits/hub-game/scripts/test-replay-client.mjs +110 -0
- package/kits/hub-game/scripts/test-replay.mjs +178 -0
- package/kits/hub-game/scripts/test-resume-held.mjs +13 -0
- package/kits/hub-game/scripts/test-resume-pose-server.mjs +43 -5
- package/kits/hub-game/scripts/test-role-client.mjs +2 -1
- package/kits/hub-game/scripts/test-safe-act.mjs +233 -0
- package/kits/hub-game/scripts/test-safe-caption.mjs +364 -0
- package/kits/hub-game/scripts/test-safe-layout.mjs +79 -0
- package/kits/hub-game/scripts/test-safe-prompt.mjs +163 -0
- package/kits/hub-game/scripts/test-sound-surface.mjs +256 -0
- package/kits/hub-game/scripts/test-soundscape.mjs +85 -2
- package/kits/hub-game/scripts/test-stuck-surface.mjs +174 -0
- package/kits/hub-game/scripts/test-stuck.mjs +31 -0
- package/kits/hub-game/scripts/test-talk-surface.mjs +23 -6
- package/kits/hub-game/scripts/test-talk-walk-dom.mjs +123 -0
- package/kits/hub-game/scripts/test-text-ask-surface.mjs +273 -0
- package/kits/hub-game/scripts/test-tiers.mjs +453 -3
- package/kits/hub-game/scripts/test-toast-no-row-dom.mjs +71 -0
- package/kits/hub-game/scripts/test-together.mjs +11 -0
- package/kits/hub-game/scripts/test-town-day.mjs +90 -0
- package/kits/hub-game/scripts/test-try-on.mjs +39 -0
- package/kits/hub-game/scripts/test-ui-dom-dom.mjs +49 -2
- package/kits/hub-game/scripts/test-ui-tree.mjs +28 -0
- package/kits/hub-game/scripts/test-vehicle-client.mjs +68 -1
- package/kits/hub-game/scripts/test-vis.mjs +145 -0
- package/kits/hub-game/scripts/test-wallet.mjs +650 -0
- package/kits/hub-game/scripts/test-weakest-tier.mjs +135 -1
- package/kits/hub-game/scripts/test-world-labels.mjs +340 -0
- package/kits/hub-game/scripts/test-writer-lease-server.mjs +234 -0
- package/kits/hub-game/scripts/test-writer-lease.mjs +281 -0
- package/kits/hub-game/scripts/writer-storage-fixture.mjs +37 -0
- package/kits/hub-game/tools/hubScene/export.mjs +6 -5
- package/kits/hub-game/tools/hubScene/hubdata.mjs +10 -0
- package/kits/hub-game/tools/hubScene/test/export-fixture.mjs +36 -2
- package/kits/hub-game/tools/hubScene/validate-manifest.mjs +10 -2
- package/kits/multiplayer-3d/castle.json +5 -5
- package/kits/multiplayer-3d/code/client/resumeGate.js +49 -2
- package/kits/multiplayer-3d/code/server/ownership.js +25 -6
- package/kits/multiplayer-3d/code/server/world.js +19 -4
- package/kits/multiplayer-3d/code/systems/multiplayer.js +67 -11
- package/kits/multiplayer-3d/package-lock.json +1 -1
- package/kits/multiplayer-3d/package.json +2 -1
- package/kits/multiplayer-3d/scripts/test-ground-half.mjs +56 -0
- package/kits/multiplayer-3d/scripts/test-join-watchdog.mjs +54 -3
- package/kits/multiplayer-3d/scripts/test-owned-moves.mjs +190 -0
- package/kits/multiplayer-3d/scripts/test-resume-gate.mjs +191 -5
- package/kits/multiplayer-3d/scripts/test-resync-reconnect.mjs +68 -0
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/engine/scene.js +10 -2
- package/kits/physics-3d/CLAUDE.md +14 -0
- package/kits/physics-3d/behaviors/Player.jsx +39 -3
- package/kits/physics-3d/castle.json +3 -3
- package/kits/physics-3d/docs/engine-model-cache.md +109 -0
- package/kits/physics-3d/docs/engine-player.md +76 -0
- package/kits/physics-3d/docs/engine-skip-work.md +16 -0
- package/kits/physics-3d/docs/pxmodel-format.md +5 -1
- package/kits/physics-3d/engine3d/gait.js +16 -8
- package/kits/physics-3d/engine3d/groundsize.js +23 -0
- package/kits/physics-3d/engine3d/kithooks.js +50 -0
- package/kits/physics-3d/engine3d/look.js +110 -17
- package/kits/physics-3d/engine3d/lookbake.js +19 -1
- package/kits/physics-3d/engine3d/materialpresets.js +3 -2
- package/kits/physics-3d/engine3d/modelcache.js +280 -0
- package/kits/physics-3d/engine3d/modelcachedigest.js +37 -0
- package/kits/physics-3d/engine3d/modelcachegate.js +69 -0
- package/kits/physics-3d/engine3d/modelrefs.js +13 -0
- package/kits/physics-3d/engine3d/optimize.js +20 -9
- package/kits/physics-3d/engine3d/playerRun.js +26 -1
- package/kits/physics-3d/engine3d/pxmodel.js +7 -3
- package/kits/physics-3d/engine3d/templatecache.js +722 -0
- package/kits/physics-3d/engine3d/world3d.js +211 -17
- package/kits/physics-3d/package-lock.json +1 -1
- package/kits/physics-3d/package.json +2 -1
- package/kits/physics-3d/play/behaviors/Player.js +43 -3
- package/kits/physics-3d/scripts/render.mjs +56 -8
- package/kits/physics-3d/scripts/template-cache-fixtures.mjs +37 -0
- package/kits/physics-3d/scripts/template-cache-v1-bytes.json +49 -0
- package/kits/physics-3d/scripts/test-gait.mjs +53 -9
- package/kits/physics-3d/scripts/test-ground-half.mjs +120 -0
- package/kits/physics-3d/scripts/test-model-cache.mjs +600 -0
- package/kits/physics-3d/scripts/test-orbit-shadow-fade.mjs +1 -0
- package/kits/physics-3d/scripts/test-sleeping-models.mjs +384 -0
- package/kits/physics-3d/scripts/test-template-cache-minified.mjs +106 -0
- package/kits/physics-3d/scripts/test-template-cache.mjs +519 -0
- package/kits/physics-3d/scripts/test-wall-slide.mjs +272 -0
- package/kits/physics-3d/systems/physics3d.js +51 -2
- package/kits/real-time/castle.json +2 -2
- package/kits/real-time/code/client/connection.js +3 -0
- package/package.json +2 -2
- package/vendor/three/examples/jsm/libs/fflate.module.js +2672 -0
|
@@ -12,6 +12,7 @@ for (let n = 3600; n <= 3700; n++) telemetry.frame(n * 1000 / 60, context);
|
|
|
12
12
|
assert.equal(messages.length, 1);
|
|
13
13
|
assert.equal(messages[0].median, 600); assert.equal(messages[0].p10, 600);
|
|
14
14
|
assert.equal(messages[0].final, false);
|
|
15
|
+
assert.equal(JSON.stringify(messages[0]), JSON.stringify({ k: 'hub-fps', median: 600, p10: 600, ...context, final: false }), 'absent quality preserves message bytes');
|
|
15
16
|
doc.hidden = true; listeners.get('visibilitychange')();
|
|
16
17
|
telemetry.frame(900000, context);
|
|
17
18
|
doc.hidden = false;
|
|
@@ -24,7 +25,8 @@ const calls = [], h = { place: { analytics: true, fpsTelemetry: { scene: context
|
|
|
24
25
|
players: new Map([['p', { arrived: true }]]), session: { hub: { track: (id, event) => { calls.push([id, event]); return true; } } } };
|
|
25
26
|
const session = { players: [{ playerId: 'p' }] }, player = session.players[0];
|
|
26
27
|
assert.equal(fps(h, session, player, messages[0]), true);
|
|
27
|
-
assert.equal(calls[0][1].
|
|
28
|
+
assert.equal(JSON.stringify(calls[0][1]), JSON.stringify({ kind: 26, subject: 2, value: 600 * 4096 + 600, result: 4, flags: 0 }), 'absent quality preserves track args bytes');
|
|
29
|
+
assert.equal(Object.hasOwn(calls[0][1], 'quality'), false);
|
|
28
30
|
assert.equal(fps(h, session, player, messages[0]), false, 'rate limited');
|
|
29
31
|
assert.equal(fps(h, session, player, { ...messages[0], final: true }), true, 'one departure flush');
|
|
30
32
|
assert.equal(fps(h, session, player, { ...messages[0], final: true }), false);
|
|
@@ -32,6 +34,16 @@ h.sim.timeMs += 60000;
|
|
|
32
34
|
for (const override of [{ median: NaN }, { p10: 601 }, { tier: 4 }, { avatars: 256 }, { userId: 'other' }, { scene: 'other' }]) {
|
|
33
35
|
assert.equal(fps(h, session, player, { ...messages[0], ...override }), false);
|
|
34
36
|
}
|
|
37
|
+
for (const quality of [undefined, null, '', 'low', 'high', 0, 1, 2, true, {}, []]) {
|
|
38
|
+
const before = calls.length;
|
|
39
|
+
assert.equal(fps(h, session, player, { ...messages[0], quality }), false, 'invalid quality refuses report');
|
|
40
|
+
assert.equal(calls.length, before);
|
|
41
|
+
}
|
|
42
|
+
for (const [quality, code] of [['hide', 1], ['skip', 2]]) {
|
|
43
|
+
assert.equal(fps(h, session, player, { ...messages[0], quality }), true);
|
|
44
|
+
assert.deepEqual(calls.at(-1)[1], { kind: 26, subject: 2, value: 600 * 4096 + 600, result: 4, flags: 0, quality: code });
|
|
45
|
+
h.sim.timeMs += 60000;
|
|
46
|
+
}
|
|
35
47
|
assert.equal(fps(h, { players: [] }, player, messages[0]), false);
|
|
36
48
|
h.players.get('p').arrived = false;
|
|
37
49
|
assert.equal(fps(h, session, player, messages[0]), false);
|
|
@@ -94,12 +106,13 @@ system.fpsTelemetry.dispose();
|
|
|
94
106
|
|
|
95
107
|
// The active system's render tier survives replacement of the shared debug pointer.
|
|
96
108
|
const tierMethod = source.slice(source.indexOf(' deviceTier(scene, mp, now) {'), source.indexOf('\n interestFrame('));
|
|
97
|
-
const deviceTier = new Function('Hub', 'fpsTelemetryFor', `return function ${tierMethod.trim()}`)(Hub, fpsTelemetryFor
|
|
109
|
+
const deviceTier = new Function('Hub', 'fpsTelemetryFor', 'lowQuality', 'qualityFor', `return function ${tierMethod.trim()}`)(Hub, fpsTelemetryFor,
|
|
110
|
+
() => system.tiers.current() === 'low' ? Hub.deck.quality?.low : null, () => null);
|
|
98
111
|
const previousDebug = globalThis.__hub;
|
|
99
112
|
Hub.deck.tiers = true;
|
|
100
|
-
let observedTier;
|
|
113
|
+
let observedTier, observedQuality;
|
|
101
114
|
system.fpsNet = town.multiplayer.net;
|
|
102
|
-
system.fpsTelemetry = { frame: (_now, next) => { observedTier = next.tier; } };
|
|
115
|
+
system.fpsTelemetry = { frame: (_now, next) => { observedTier = next.tier; observedQuality = next.quality; } };
|
|
103
116
|
try {
|
|
104
117
|
for (const [current, weakest, code] of [['low', false, 1], ['high', false, 2], ['low', true, 3]]) {
|
|
105
118
|
system.tiers = { frame() {}, current: () => current, weakest: () => weakest, handle: { current } };
|
|
@@ -108,5 +121,27 @@ try {
|
|
|
108
121
|
globalThis.__hub = { tier: { current: 'unknown' } };
|
|
109
122
|
measure.call(system, town, town.multiplayer, 400001);
|
|
110
123
|
assert.equal(observedTier, code);
|
|
124
|
+
assert.equal(observedQuality, undefined, 'no hub.quality omits mode');
|
|
125
|
+
}
|
|
126
|
+
for (const quality of ['hide', 'skip']) {
|
|
127
|
+
Hub.deck.quality = { low: { decor: quality } };
|
|
128
|
+
for (const current of ['low', 'high']) {
|
|
129
|
+
system.tiers = { frame() {}, current: () => current, weakest: () => false, handle: { current } };
|
|
130
|
+
deviceTier.call(system, town, town.multiplayer, 500000);
|
|
131
|
+
measure.call(system, town, town.multiplayer, 500001);
|
|
132
|
+
assert.equal(observedQuality, current === 'low' ? quality : undefined, 'uses active scene quality despite debug pointer');
|
|
133
|
+
}
|
|
111
134
|
}
|
|
112
135
|
} finally { globalThis.__hub = previousDebug; }
|
|
136
|
+
|
|
137
|
+
for (const quality of ['hide', 'skip', undefined]) {
|
|
138
|
+
const reports = [];
|
|
139
|
+
const t = makeFpsTelemetry({ send: (message) => reports.push(message), document: null, target: {} });
|
|
140
|
+
t.frame(0, { ...context, quality });
|
|
141
|
+
t.frame(1000, { ...context, quality });
|
|
142
|
+
t.leave(); t.dispose();
|
|
143
|
+
assert.deepEqual(reports, [{ k: 'hub-fps', median: 10, p10: 10, ...context,
|
|
144
|
+
...(quality ? { quality } : {}), final: true }]);
|
|
145
|
+
assert.equal(Object.hasOwn(reports[0], 'quality'), quality !== undefined);
|
|
146
|
+
}
|
|
147
|
+
console.log('FPS quality modes, track encoding, omission and invalid values: passed');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import assert from 'node:assert/strict';
|
|
2
2
|
import { register } from 'node:module';
|
|
3
|
-
import { friendsAmong, forget, resend } from '../code/server/friendsAmong.js';
|
|
3
|
+
import { EARLY_EMPTY_MS, EARLY_WINDOW_MS, friendsAmong, forget, resend } from '../code/server/friendsAmong.js';
|
|
4
4
|
import { friendBests } from '../code/server/friendBests.js';
|
|
5
5
|
|
|
6
6
|
register(`data:text/javascript,${encodeURIComponent(`
|
|
@@ -46,9 +46,16 @@ function harness({ platform = { friendsAmong: async (_id, ids) => ids }, rows =
|
|
|
46
46
|
const identity = (_h, id) => identities.get(id) ?? null;
|
|
47
47
|
h.ctx.friendsAmong = (id, ids) => friendsAmong(h, id, ids, identity);
|
|
48
48
|
const api = friendBests(h, 'test', { better: 'higher' }, identity);
|
|
49
|
-
return { h, api, sent, calls, writes, identity, saved: () => saved };
|
|
49
|
+
return { h, api, sent, calls, writes, identity, identities, saved: () => saved };
|
|
50
50
|
}
|
|
51
51
|
try {
|
|
52
|
+
await test('a player id that comes back as another account never inherits the old membership', async () => {
|
|
53
|
+
const r = harness({ platform: { friendsAmong: async (id, ids) => ids.filter((u) => u === '3') }, rows: [row('3', 9)] });
|
|
54
|
+
assert.equal((await r.api.friendFor('p1'))?.userId, '3');
|
|
55
|
+
r.identities.set('p1', '4');
|
|
56
|
+
assert.equal(await r.api.friendFor('p1'), null);
|
|
57
|
+
assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['3']), []);
|
|
58
|
+
});
|
|
52
59
|
await test('kit API is dormant until used; rejects guests, disconnects and malformed candidates', async () => {
|
|
53
60
|
const r = harness();
|
|
54
61
|
assert.deepEqual(r.sent, []);
|
|
@@ -97,7 +104,16 @@ try {
|
|
|
97
104
|
assert.deepEqual(await c, ['4']);
|
|
98
105
|
assert.equal(count, 2);
|
|
99
106
|
});
|
|
100
|
-
await test('empty
|
|
107
|
+
await test('v1.166: a session\'s first empty answer is kept 5 s, later ones 40 s; the early re-read finds a friend marked meanwhile', async () => {
|
|
108
|
+
const start = now;
|
|
109
|
+
const early = harness({ rows: [row('2', 118)], platform: { friendsAmong: async (_id, ids) => (now - start >= 3000 ? ids : []) } });
|
|
110
|
+
assert.equal(await early.api.friendFor('p1'), null, 'arrival precedes seen marker');
|
|
111
|
+
now = start + EARLY_EMPTY_MS - 1;
|
|
112
|
+
assert.equal(await early.api.friendFor('p1'), null);
|
|
113
|
+
now = start + EARLY_EMPTY_MS;
|
|
114
|
+
assert.deepEqual(await early.api.friendFor('p1'), { userId: '2', username: 'Mira', best: 118 });
|
|
115
|
+
});
|
|
116
|
+
await test('empty answers after the early re-read wait out the first minute, then 40 s; concurrent pending reads never duplicate ops', async () => {
|
|
101
117
|
const start = now;
|
|
102
118
|
const at = [];
|
|
103
119
|
const r = harness({ rows: [row('2', 118)], platform: { friendsAmong: async (_id, ids) => {
|
|
@@ -105,23 +121,27 @@ try {
|
|
|
105
121
|
return now - start >= 20000 ? ids : [];
|
|
106
122
|
} } });
|
|
107
123
|
assert.equal(await r.api.friendFor('p1'), null, 'arrival precedes seen marker');
|
|
108
|
-
now = start +
|
|
109
|
-
assert.equal(await r.api.friendFor('p1'), null);
|
|
124
|
+
now = start + EARLY_EMPTY_MS;
|
|
125
|
+
assert.equal(await r.api.friendFor('p1'), null, 'the one early re-read is still before the marker');
|
|
126
|
+
assert.deepEqual(at, [start, start + EARLY_EMPTY_MS]);
|
|
127
|
+
const redo = start + EARLY_WINDOW_MS;
|
|
110
128
|
now = start + 39999;
|
|
111
129
|
assert.equal(await r.api.friendFor('p1'), null);
|
|
112
|
-
|
|
113
|
-
|
|
130
|
+
now = redo - 1;
|
|
131
|
+
assert.equal(await r.api.friendFor('p1'), null);
|
|
132
|
+
assert.equal(at.length, 2, 'the next read waits a minute from the first');
|
|
133
|
+
now = redo;
|
|
114
134
|
const [a, b] = await Promise.all([r.api.friendFor('p1'), r.api.friendFor('p1')]);
|
|
115
135
|
assert.deepEqual(a, { userId: '2', username: 'Mira', best: 118 });
|
|
116
136
|
assert.deepEqual(b, a);
|
|
117
|
-
assert.deepEqual(at, [start, start +
|
|
137
|
+
assert.deepEqual(at, [start, start + EARLY_EMPTY_MS, redo]);
|
|
118
138
|
now += 599999;
|
|
119
139
|
assert.deepEqual(await r.api.friendFor('p1'), a);
|
|
120
|
-
assert.equal(at.length,
|
|
140
|
+
assert.equal(at.length, 3);
|
|
121
141
|
now++;
|
|
122
142
|
assert.deepEqual(await r.api.friendFor('p1'), a);
|
|
123
|
-
assert.equal(at.length,
|
|
124
|
-
assert.ok(at.slice(
|
|
143
|
+
assert.equal(at.length, 4);
|
|
144
|
+
assert.ok(at.slice(2).every((time, i) => time - at[i + 1] >= 25000));
|
|
125
145
|
|
|
126
146
|
let settle, asks = 0;
|
|
127
147
|
const pending = harness({ platform: { friendsAmong: () => {
|
|
@@ -141,9 +161,15 @@ try {
|
|
|
141
161
|
let calls = 0;
|
|
142
162
|
const r = harness({ platform: { friendsAmong: async () => { calls++; throw Object.assign(new Error(), { code }); } } });
|
|
143
163
|
assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['2']), []);
|
|
144
|
-
now +=
|
|
164
|
+
now += EARLY_EMPTY_MS - 1;
|
|
145
165
|
assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['2']), []);
|
|
146
166
|
assert.equal(calls, 1);
|
|
167
|
+
// v1.166: the session's first refusal is provisional; one re-read, then 40 s.
|
|
168
|
+
now += 1;
|
|
169
|
+
assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['2']), []);
|
|
170
|
+
now += 25000;
|
|
171
|
+
assert.deepEqual(await r.h.ctx.friendsAmong('p1', ['2']), []);
|
|
172
|
+
assert.equal(calls, 2);
|
|
147
173
|
}
|
|
148
174
|
assert.deepEqual(await harness({ platform: {} }).h.ctx.friendsAmong('p1', ['2']), []);
|
|
149
175
|
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// A tap's click only reaches the control its pointerdown went to. In
|
|
2
|
+
// landscape the Character button opens its strip over itself on pointerdown,
|
|
3
|
+
// and the tap's click, hit-tested where the finger lifts, used to land on the
|
|
4
|
+
// tile now under it: the strip picked that character and shut at once. Real
|
|
5
|
+
// chrome in a real browser (the same GPU launcher as the other DOM tests),
|
|
6
|
+
// with synthetic events and a real CDP touch tap.
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
import { build } from 'vite';
|
|
9
|
+
import { chromium } from 'playwright-core';
|
|
10
|
+
import { launchChromium, logRenderer } from '../../../experiments/hub-town/qa/launch.mjs';
|
|
11
|
+
|
|
12
|
+
const bundle = await build({ configFile: false, logLevel: 'silent', build: {
|
|
13
|
+
write: false, lib: { entry: new URL('../code/client/chrome.js', import.meta.url).pathname, name: 'HubChrome', formats: ['iife'] },
|
|
14
|
+
} });
|
|
15
|
+
const browser = await launchChromium(chromium, { executablePath: process.env.CHROME });
|
|
16
|
+
try {
|
|
17
|
+
const context = await browser.newContext({ viewport: { width: 844, height: 390 }, hasTouch: true, isMobile: true });
|
|
18
|
+
const page = await context.newPage();
|
|
19
|
+
await page.setContent('<meta name="viewport" content="width=device-width,initial-scale=1"><style>body{margin:0}</style>');
|
|
20
|
+
await logRenderer(page);
|
|
21
|
+
await page.addScriptTag({ content: (Array.isArray(bundle) ? bundle[0] : bundle).output[0].code });
|
|
22
|
+
const mount = () => page.evaluate(() => {
|
|
23
|
+
globalThis.hubChrome?.dispose();
|
|
24
|
+
globalThis.picked = [];
|
|
25
|
+
globalThis.clicked = [];
|
|
26
|
+
if (!globalThis.watching) {
|
|
27
|
+
globalThis.watching = true;
|
|
28
|
+
window.addEventListener('click', (e) => clicked.push(e.target.closest?.('button')?.getAttribute('aria-label') ?? e.target.textContent), true);
|
|
29
|
+
}
|
|
30
|
+
globalThis.hubChrome = HubChrome.makeChrome({ avatarCount: 24, onBack() {}, onAvatar: (i) => picked.push(i) });
|
|
31
|
+
hubChrome.showPicker(true, 0);
|
|
32
|
+
});
|
|
33
|
+
const state = () => page.evaluate(() => {
|
|
34
|
+
const toggle = [...document.querySelectorAll('button')].find((b) => b.textContent === 'Character');
|
|
35
|
+
const tiles = [...document.querySelectorAll('button[aria-label^="Character"]')].filter((b) => b !== toggle);
|
|
36
|
+
return { picked: [...picked], open: tiles.some((b) => b.offsetParent !== null) };
|
|
37
|
+
});
|
|
38
|
+
// Dispatched as the browser would: pointerdown on one element, click on another.
|
|
39
|
+
const tap = (down, up, detail = 1) => page.evaluate(({ down, up, detail }) => {
|
|
40
|
+
const toggle = [...document.querySelectorAll('button')].find((b) => b.textContent === 'Character');
|
|
41
|
+
const tiles = [...document.querySelectorAll('button[aria-label^="Character"]')].filter((b) => b !== toggle);
|
|
42
|
+
const pick = (name) => (name === 'toggle' ? toggle : tiles[0]);
|
|
43
|
+
if (down) {pick(down).dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, cancelable: true, composed: true, pointerType: 'touch', isPrimary: true }));}
|
|
44
|
+
if (detail === 0) {pick(up).click();}
|
|
45
|
+
else {pick(up).dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, composed: true, detail }));}
|
|
46
|
+
}, { down, up, detail });
|
|
47
|
+
|
|
48
|
+
await mount();
|
|
49
|
+
await tap('toggle', 'tile');
|
|
50
|
+
assert.deepEqual(await state(), { picked: [], open: true }, 'a click off the toggle its pointerdown opened from is dropped');
|
|
51
|
+
|
|
52
|
+
await tap('tile', 'tile');
|
|
53
|
+
assert.deepEqual(await state(), { picked: [0], open: false }, 'a pointerdown and click on the same tile picks it');
|
|
54
|
+
|
|
55
|
+
await mount();
|
|
56
|
+
await tap('toggle', 'tile');
|
|
57
|
+
await tap(null, 'tile', 0);
|
|
58
|
+
assert.deepEqual(await state(), { picked: [0], open: false }, 'a keyboard click (detail 0) still picks');
|
|
59
|
+
|
|
60
|
+
// A real finger: CDP touch at the Character button's centre, on a landscape phone.
|
|
61
|
+
await mount();
|
|
62
|
+
const box = await page.getByRole('button', { name: 'Character', exact: true }).boundingBox();
|
|
63
|
+
const x = box.x + box.width / 2, y = box.y + box.height / 2;
|
|
64
|
+
const cdp = await context.newCDPSession(page);
|
|
65
|
+
await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: [{ x, y }] });
|
|
66
|
+
await cdp.send('Input.dispatchTouchEvent', { type: 'touchEnd', touchPoints: [] });
|
|
67
|
+
await page.waitForTimeout(300);
|
|
68
|
+
const clicked = await page.evaluate(() => clicked);
|
|
69
|
+
const touch = await state();
|
|
70
|
+
console.log(`touch tap on Character at ${Math.round(x)},${Math.round(y)}: its click went to ${JSON.stringify(clicked)}; ${JSON.stringify(touch)}`);
|
|
71
|
+
assert.deepEqual(touch, { picked: [], open: true }, 'a real touch tap opens the strip and picks nothing');
|
|
72
|
+
|
|
73
|
+
await page.evaluate(() => hubChrome.dispose());
|
|
74
|
+
console.log('ghost click DOM tests passed: toggle-to-tile click dropped, same-tile and keyboard clicks pick, real touch tap opens the strip');
|
|
75
|
+
} finally { await browser.close(); }
|
|
@@ -37,7 +37,7 @@ const PILLOW = { kind: 'sphere', radius: 0.3 };
|
|
|
37
37
|
|
|
38
38
|
// One client in a place: the player at the origin facing +z, and loose
|
|
39
39
|
// objects `{ id: { x, z, y?, shape? } }`, all this client's to begin with.
|
|
40
|
-
function rig(grab, objects) {
|
|
40
|
+
function rig(grab, objects, refuse = undefined) {
|
|
41
41
|
hub.place = grab === null ? {} : { grab };
|
|
42
42
|
hub.hidden.clear();
|
|
43
43
|
hub.held.clear();
|
|
@@ -50,7 +50,7 @@ function rig(grab, objects) {
|
|
|
50
50
|
onGrab: (fn) => (press = fn),
|
|
51
51
|
grabPrompt: (text) => prompts.push(text),
|
|
52
52
|
};
|
|
53
|
-
const g = makeGrab(chrome);
|
|
53
|
+
const g = makeGrab(chrome, refuse);
|
|
54
54
|
const actors = new Map();
|
|
55
55
|
const bodies = new Map();
|
|
56
56
|
for (const [id, o] of Object.entries(objects)) {
|
|
@@ -143,6 +143,20 @@ test('without reach or steady: the 1.6 m reach, the 60 degree cone, and ownershi
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
+
test('v1.204: a grab or throw press refused while catching up says why, sends nothing and holds nothing', () => {
|
|
147
|
+
let catching = true; const refusals = [];
|
|
148
|
+
const { step, grabs, sent, g } = rig({ ...GRAB_DEFAULTS }, { a: at(1.5, 0) }, () => { if (!catching) {return false;} refusals.push(1); return true; });
|
|
149
|
+
assert.equal(step(), 'Grab');
|
|
150
|
+
step(16, true);
|
|
151
|
+
assert.deepEqual(grabs(), []); assert.equal(g.holding(), null); assert.equal(refusals.length, 1);
|
|
152
|
+
step(); assert.equal(refusals.length, 1, 'a frame without a press says nothing');
|
|
153
|
+
catching = false; step(16, true);
|
|
154
|
+
assert.deepEqual(grabs(), ['a']); assert.equal(g.holding(), 'a');
|
|
155
|
+
catching = true; const before = sent.length; step(16, true);
|
|
156
|
+
assert.equal(g.holding(), 'a', 'a refused throw keeps the hold'); assert.equal(refusals.length, 2);
|
|
157
|
+
assert.equal(sent.slice(before).some((d) => d.op === 'throw'), false);
|
|
158
|
+
});
|
|
159
|
+
|
|
146
160
|
test('without reach or steady: a big object is offered past 3.5 m centre to centre, as before', () => {
|
|
147
161
|
// A wide box (1.84 m from centre to edge) whose centre is 3.4 m out and
|
|
148
162
|
// 1.8 m up: the v1.22 centre bound applies only to a place that asks.
|
|
@@ -274,6 +288,19 @@ test('steady: the grace ends after 600 ms and the button goes; another object ta
|
|
|
274
288
|
assert.equal(step(STEADY_GRACE_MS + 100), 'Grab');
|
|
275
289
|
});
|
|
276
290
|
|
|
291
|
+
test('v1.204, steady: a press queued before catching up grabs nothing during it', () => {
|
|
292
|
+
// Queue the press while the object is briefly someone else's.
|
|
293
|
+
const queued = rig({ ...GRAB_DEFAULTS, steady: true }, { a: at(1.5, 0) });
|
|
294
|
+
queued.step(); queued.mine.delete('a'); queued.step(16, true);
|
|
295
|
+
hub.catching = 0;
|
|
296
|
+
queued.mine.add('a'); queued.step();
|
|
297
|
+
assert.deepEqual(queued.grabs(), [], 'the queued press is dropped while catching');
|
|
298
|
+
assert.equal(queued.g.holding(), null);
|
|
299
|
+
hub.catching = null;
|
|
300
|
+
queued.step();
|
|
301
|
+
assert.deepEqual(queued.grabs(), [], 'and does not come back after');
|
|
302
|
+
});
|
|
303
|
+
|
|
277
304
|
test('steady: a press in the grace waits for the object to be this client’s again, then grabs it', () => {
|
|
278
305
|
const { step, mine, grabs, sent } = rig({ ...GRAB_DEFAULTS, steady: true }, { a: at(1.5, 0) });
|
|
279
306
|
assert.equal(step(), 'Grab');
|