castle-web-cli 0.4.230 → 0.4.232
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/castle-host/host.js +81 -0
- package/dist/devSaveStorage.d.ts +36 -0
- package/dist/devSaveStorage.js +469 -0
- package/dist/devSessionChild.js +22 -12
- package/dist/devSessionServer.js +8 -2
- package/dist/devSessionStorage.d.ts +9 -0
- package/dist/devSessionStorage.js +66 -1
- package/dist/init.js +1 -1
- package/dist/serve.js +5 -1
- package/dist/serverBundle.js +5 -3
- package/kits/base/castle.json +1 -1
- package/kits/base/sdk/README.md +148 -1
- package/kits/base/sdk/castle.d.ts +4 -0
- package/kits/base/sdk/castle.js +2 -0
- package/kits/base/sdk/commands.d.ts +15 -0
- package/kits/base/sdk/multiplayer.js +52 -4
- package/kits/base/sdk/save.d.ts +197 -0
- package/kits/base/sdk/save.js +525 -0
- package/kits/base/sdk/saveCoordinator.d.ts +39 -0
- package/kits/base/sdk/saveCoordinator.js +252 -0
- package/kits/base/sdk/server/storage.d.ts +3 -2
- package/kits/base/sdk/server/storage.js +25 -5
- package/kits/base/sdk/server/wrapper.d.ts +4 -0
- package/kits/base/sdk/server/wrapper.js +2 -0
- package/kits/base/sdk/store.d.ts +3 -2
- package/kits/base/sdk/store.js +5 -0
- package/kits/hub-game/CLAUDE.md +29 -4
- package/kits/hub-game/code/client/avatar.js +39 -0
- package/kits/hub-game/code/client/chat.js +12 -0
- package/kits/hub-game/code/client/chrome.js +237 -13
- package/kits/hub-game/code/client/grab.js +166 -7
- package/kits/hub-game/code/client/hats.js +26 -0
- package/kits/hub-game/code/client/hookLayer.js +36 -3
- package/kits/hub-game/code/client/hudClear.js +126 -0
- package/kits/hub-game/code/client/state.js +35 -1
- package/kits/hub-game/code/client/talk.js +10 -36
- package/kits/hub-game/code/client/tiers.js +505 -0
- package/kits/hub-game/code/client/together.js +144 -4
- package/kits/hub-game/code/client/wear.js +96 -14
- package/kits/hub-game/code/server/actors.js +5 -0
- package/kits/hub-game/code/server/grab.js +299 -13
- package/kits/hub-game/code/server/hub.js +162 -7
- package/kits/hub-game/code/server/manifest.js +80 -8
- package/kits/hub-game/code/server/npcs.js +21 -33
- package/kits/hub-game/code/server/party.js +75 -6
- package/kits/hub-game/code/server/say.js +8 -2
- package/kits/hub-game/code/server/wear.js +116 -11
- package/kits/hub-game/code/systems/hub.js +386 -21
- package/kits/hub-game/docs/contract.md +285 -19
- package/kits/hub-game/package.json +1 -1
- package/kits/hub-game/scripts/test-chat.mjs +32 -0
- package/kits/hub-game/scripts/test-grab-client.mjs +511 -0
- package/kits/hub-game/scripts/test-grab.mjs +857 -3
- package/kits/hub-game/scripts/test-hats.mjs +229 -0
- package/kits/hub-game/scripts/test-hub-trip.mjs +721 -0
- package/kits/hub-game/scripts/test-hud-clear.mjs +676 -0
- package/kits/hub-game/scripts/test-manifest.mjs +122 -1
- package/kits/hub-game/scripts/test-npcs.mjs +34 -24
- package/kits/hub-game/scripts/test-party.mjs +108 -4
- package/kits/hub-game/scripts/test-say.mjs +59 -2
- package/kits/hub-game/scripts/test-tiers.mjs +854 -0
- package/kits/hub-game/scripts/test-together.mjs +33 -1
- package/kits/hub-game/scripts/test-try-on.mjs +940 -0
- package/kits/physics-2d/CLAUDE.md +2 -0
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/engine/scene.js +127 -0
- package/kits/physics-2d/package.json +1 -1
- package/kits/physics-2d/scripts/test-skip-unchanged.mjs +298 -0
- package/kits/physics-3d/CLAUDE.md +531 -0
- package/kits/physics-3d/behaviors/Player.jsx +437 -3
- package/kits/physics-3d/castle.json +3 -3
- package/kits/physics-3d/docs/pxmodel-format.md +4 -0
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +33 -1
- package/kits/physics-3d/engine3d/actornode.js +253 -0
- package/kits/physics-3d/engine3d/nearshadows.js +600 -0
- package/kits/physics-3d/engine3d/optimize.js +49 -0
- package/kits/physics-3d/engine3d/orbitinput.js +277 -0
- package/kits/physics-3d/engine3d/unchanged.js +153 -0
- package/kits/physics-3d/engine3d/world3d.js +525 -11
- package/kits/physics-3d/package.json +1 -1
- package/kits/physics-3d/scripts/Player.before-orbit.mjs +310 -0
- package/kits/physics-3d/scripts/Scene3DPlayer.before-orbit.jsx +337 -0
- package/kits/physics-3d/scripts/test-camera-follow.mjs +543 -0
- package/kits/physics-3d/scripts/test-camera-orbit.mjs +2105 -0
- package/kits/physics-3d/scripts/test-drop-empty-parts.mjs +787 -0
- package/kits/physics-3d/scripts/test-near-shadows.mjs +1073 -0
- package/kits/physics-3d/scripts/test-static-actors.mjs +667 -0
- package/kits/physics-3d/scripts/test-static-passes.mjs +459 -0
- package/kits/physics-3d/scripts/test-static-physics.mjs +128 -0
- package/kits/physics-3d/scripts/test-steady-hover.mjs +633 -0
- package/kits/physics-3d/systems/physics3d.js +273 -9
- package/package.json +1 -1
|
@@ -123,7 +123,27 @@ let n = 0;
|
|
|
123
123
|
n += 1;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// Join puts a player
|
|
126
|
+
// Join never puts a player on a door's pad, nor at its edge (a pad takes
|
|
127
|
+
// whoever stands on it into its game), even beside a friend standing on one.
|
|
128
|
+
{
|
|
129
|
+
const b = boot();
|
|
130
|
+
put(b, 'p2', -25.5, 0);
|
|
131
|
+
b.h.message(b.session, { playerId: 'p1' }, { k: 'hub-goto', player: 'p2' });
|
|
132
|
+
// To p2's right (x + 1.6) is on the Foot Race pad: the other side.
|
|
133
|
+
assert.ok(Math.abs(at(b, 'p1').x - -27.1) < 1e-9, `off the pad: ${JSON.stringify(at(b, 'p1'))}`);
|
|
134
|
+
// Just off the pad's edge (x -24): they are not on it, so neither is the joiner.
|
|
135
|
+
const c = boot();
|
|
136
|
+
put(c, 'p2', -24.2, 0);
|
|
137
|
+
c.h.message(c.session, { playerId: 'p1' }, { k: 'hub-goto', player: 'p2' });
|
|
138
|
+
assert.ok(Math.abs(at(c, 'p1').x - -25.8) < 1e-9, `off the pad: ${JSON.stringify(at(c, 'p1'))}`);
|
|
139
|
+
put(b, 'p2', -22, 0);
|
|
140
|
+
b.h.message(b.session, { playerId: 'p3' }, { k: 'hub-goto', player: 'p2' });
|
|
141
|
+
// On the pad themselves (v1.19): just off its edge, facing them, never on it.
|
|
142
|
+
assert.ok(Math.abs(at(b, 'p3').x - -18.8) < 1e-9 && Math.abs(at(b, 'p3').z) < 1e-9, `off their pad: ${JSON.stringify(at(b, 'p3'))}`);
|
|
143
|
+
assert.ok(Math.abs(b.world.players.get('p3').facing - -Math.PI / 2) < 1e-9, 'facing them');
|
|
144
|
+
n += 1;
|
|
145
|
+
}
|
|
146
|
+
|
|
127
147
|
{
|
|
128
148
|
const b = boot();
|
|
129
149
|
put(b, 'p2', 10, 10);
|
|
@@ -168,6 +188,18 @@ let n = 0;
|
|
|
168
188
|
n += 1;
|
|
169
189
|
}
|
|
170
190
|
|
|
191
|
+
// Whoever stays is told who went through which door.
|
|
192
|
+
{
|
|
193
|
+
const b = boot();
|
|
194
|
+
b.ctx().go('race', ['p1']);
|
|
195
|
+
const went = b.sent.filter(([, msg]) => msg.k === 'hub-went');
|
|
196
|
+
assert.deepEqual(went, [
|
|
197
|
+
['p2', { k: 'hub-went', players: ['p1'], door: 'race' }],
|
|
198
|
+
['p3', { k: 'hub-went', players: ['p1'], door: 'race' }],
|
|
199
|
+
]);
|
|
200
|
+
n += 1;
|
|
201
|
+
}
|
|
202
|
+
|
|
171
203
|
// A game answers neither.
|
|
172
204
|
{
|
|
173
205
|
const b = boot({ sessionId: 'dev:hub.race.abc123' });
|