castle-web-cli 0.4.230 → 0.4.231
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/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 +4 -1
- package/kits/hub-game/code/client/chrome.js +43 -9
- package/kits/hub-game/code/client/grab.js +142 -7
- package/kits/hub-game/code/client/hookLayer.js +7 -1
- package/kits/hub-game/code/client/state.js +13 -1
- package/kits/hub-game/code/client/talk.js +10 -36
- package/kits/hub-game/code/client/tiers.js +480 -0
- package/kits/hub-game/code/client/together.js +78 -3
- package/kits/hub-game/code/server/grab.js +3 -2
- package/kits/hub-game/code/server/hub.js +99 -5
- package/kits/hub-game/code/server/manifest.js +34 -7
- package/kits/hub-game/code/server/npcs.js +21 -33
- package/kits/hub-game/code/server/party.js +64 -6
- package/kits/hub-game/code/systems/hub.js +133 -16
- package/kits/hub-game/docs/contract.md +84 -14
- package/kits/hub-game/package.json +1 -1
- package/kits/hub-game/scripts/test-grab-client.mjs +328 -0
- package/kits/hub-game/scripts/test-hub-trip.mjs +208 -0
- package/kits/hub-game/scripts/test-manifest.mjs +47 -1
- package/kits/hub-game/scripts/test-npcs.mjs +34 -24
- package/kits/hub-game/scripts/test-party.mjs +87 -4
- package/kits/hub-game/scripts/test-tiers.mjs +666 -0
- package/kits/hub-game/scripts/test-together.mjs +33 -1
- package/kits/physics-2d/CLAUDE.md +2 -0
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/engine/scene.js +92 -0
- package/kits/physics-2d/package.json +1 -1
- package/kits/physics-2d/scripts/test-skip-unchanged.mjs +254 -0
- package/kits/physics-3d/CLAUDE.md +279 -0
- package/kits/physics-3d/behaviors/Player.jsx +74 -1
- package/kits/physics-3d/castle.json +3 -3
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +1 -1
- package/kits/physics-3d/engine3d/actornode.js +253 -0
- package/kits/physics-3d/engine3d/nearshadows.js +600 -0
- package/kits/physics-3d/engine3d/unchanged.js +153 -0
- package/kits/physics-3d/engine3d/world3d.js +465 -7
- package/kits/physics-3d/package.json +1 -1
- package/kits/physics-3d/scripts/test-camera-follow.mjs +533 -0
- package/kits/physics-3d/scripts/test-near-shadows.mjs +1073 -0
- package/kits/physics-3d/scripts/test-static-actors.mjs +662 -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/systems/physics3d.js +182 -3
- package/package.json +1 -1
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
// Grabbing and throwing (contract §6), the client's offer (code/client/grab.js)
|
|
2
|
+
// on a fake scene, multiplayer kit and chrome: a place without `grab.reach`
|
|
3
|
+
// or `grab.steady` is offered exactly what it was (the 1.6 m reach, the 60
|
|
4
|
+
// degree cone, an object the moment it is this client's and not a frame
|
|
5
|
+
// longer); v1.22's `reach` lengthens the reach; `steady` keeps the same object
|
|
6
|
+
// on offer through a frame out of the cone or out of this client's hands, holds
|
|
7
|
+
// the button up for its grace and no longer, lets a press in the grace wait
|
|
8
|
+
// for the object to be this client's again, and never sends a grab for an
|
|
9
|
+
// object this client does not own. `npm run check` runs it; it needs nothing
|
|
10
|
+
// installed.
|
|
11
|
+
|
|
12
|
+
import assert from 'node:assert/strict';
|
|
13
|
+
import {
|
|
14
|
+
KEEP_MARGIN_M,
|
|
15
|
+
OFFER_CENTRE_M,
|
|
16
|
+
offerCap,
|
|
17
|
+
PRESS_WAIT_MS,
|
|
18
|
+
STEADY_GRACE_MS,
|
|
19
|
+
makeGrab,
|
|
20
|
+
} from '../code/client/grab.js';
|
|
21
|
+
import { hub } from '../code/client/state.js';
|
|
22
|
+
import { GRAB_REACH } from '../code/server/grab.js';
|
|
23
|
+
import { GRAB_DEFAULTS } from '../code/server/manifest.js';
|
|
24
|
+
|
|
25
|
+
let clock = 1000;
|
|
26
|
+
Object.defineProperty(globalThis, 'performance', {
|
|
27
|
+
value: { now: () => clock },
|
|
28
|
+
configurable: true,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const DEG = Math.PI / 180;
|
|
32
|
+
// A pillow: a sphere 0.3 m from its centre to its edge.
|
|
33
|
+
const PILLOW = { kind: 'sphere', radius: 0.3 };
|
|
34
|
+
|
|
35
|
+
// One client in a place: the player at the origin facing +z, and loose
|
|
36
|
+
// objects `{ id: { x, z, y?, shape? } }`, all this client's to begin with.
|
|
37
|
+
function rig(grab, objects) {
|
|
38
|
+
hub.place = grab === null ? {} : { grab };
|
|
39
|
+
hub.hidden.clear();
|
|
40
|
+
hub.held.clear();
|
|
41
|
+
hub.grabEvents.length = 0;
|
|
42
|
+
const prompts = [];
|
|
43
|
+
const sent = [];
|
|
44
|
+
let press = null;
|
|
45
|
+
const chrome = {
|
|
46
|
+
onGrab: (fn) => (press = fn),
|
|
47
|
+
grabPrompt: (text) => prompts.push(text),
|
|
48
|
+
};
|
|
49
|
+
const g = makeGrab(chrome);
|
|
50
|
+
const actors = new Map();
|
|
51
|
+
const bodies = new Map();
|
|
52
|
+
for (const [id, o] of Object.entries(objects)) {
|
|
53
|
+
const transform = { x: o.x, y: o.y ?? 0.85, z: o.z };
|
|
54
|
+
actors.set(id, {
|
|
55
|
+
components: { Transform: transform, Shape: o.shape ?? PILLOW, Body: { type: 'dynamic' } },
|
|
56
|
+
});
|
|
57
|
+
bodies.set(id, {
|
|
58
|
+
translation: () => ({ x: transform.x, y: transform.y, z: transform.z }),
|
|
59
|
+
isDynamic: () => true,
|
|
60
|
+
setTranslation(p) {
|
|
61
|
+
Object.assign(transform, p);
|
|
62
|
+
},
|
|
63
|
+
setLinvel() {},
|
|
64
|
+
setAngvel() {},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const scene = {
|
|
68
|
+
getActor: (id) => actors.get(id) ?? null,
|
|
69
|
+
physics3d: { ready: () => true, bodyOf: (id) => bodies.get(id) ?? null },
|
|
70
|
+
};
|
|
71
|
+
const mine = new Set(actors.keys());
|
|
72
|
+
const mp = {
|
|
73
|
+
net: { selfId: () => 'me', send: (d) => sent.push(d) },
|
|
74
|
+
own: { mine },
|
|
75
|
+
claimable: () => [...actors].map(([id, a]) => [id, a.components.Transform]),
|
|
76
|
+
};
|
|
77
|
+
const me = { x: 0, y: 0.85, z: 0, rotationY: 0 };
|
|
78
|
+
const local = { components: { Transform: me } };
|
|
79
|
+
// One frame `ms` after the last, with a press in it or not; the button's word.
|
|
80
|
+
const step = (ms = 16, pressed = false, idle = true) => {
|
|
81
|
+
clock += ms;
|
|
82
|
+
if (pressed) {
|
|
83
|
+
press();
|
|
84
|
+
}
|
|
85
|
+
g.frame(scene, mp, local, idle);
|
|
86
|
+
return prompts.at(-1);
|
|
87
|
+
};
|
|
88
|
+
const place = (id, x, z) => {
|
|
89
|
+
const t = actors.get(id).components.Transform;
|
|
90
|
+
t.x = x;
|
|
91
|
+
t.z = z;
|
|
92
|
+
};
|
|
93
|
+
const grabs = () => sent.filter((d) => d.k === 'hub-grab' && d.op === 'grab').map((d) => d.actor);
|
|
94
|
+
return { g, step, me, mine, place, grabs, sent, prompts, actors };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Where an object at `distance` (centre, flat) and `deg` off facing stands.
|
|
98
|
+
function at(distance, deg) {
|
|
99
|
+
return { x: Math.sin(deg * DEG) * distance, z: Math.cos(deg * DEG) * distance };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let n = 0;
|
|
103
|
+
function test(name, fn) {
|
|
104
|
+
try {
|
|
105
|
+
fn();
|
|
106
|
+
} catch (err) {
|
|
107
|
+
console.error(`test-grab-client: ${name}`);
|
|
108
|
+
throw err;
|
|
109
|
+
}
|
|
110
|
+
n += 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
test('without reach or steady: the 1.6 m reach, the 60 degree cone, and ownership each frame, as before', () => {
|
|
114
|
+
const { step, place, mine, me } = rig({ ...GRAB_DEFAULTS }, { a: at(1.85, 0) });
|
|
115
|
+
// Near side 1.55 m: offered; 1.65 m: not.
|
|
116
|
+
assert.equal(step(), 'Grab');
|
|
117
|
+
place('a', 0, 1.95);
|
|
118
|
+
assert.equal(step(), null);
|
|
119
|
+
// 59 degrees off facing: offered; 61: not.
|
|
120
|
+
place('a', at(1.5, 59).x, at(1.5, 59).z);
|
|
121
|
+
assert.equal(step(), 'Grab');
|
|
122
|
+
place('a', at(1.5, 61).x, at(1.5, 61).z);
|
|
123
|
+
assert.equal(step(), null);
|
|
124
|
+
// A frame out of this client's hands takes the button down at once.
|
|
125
|
+
place('a', 0, 1.5);
|
|
126
|
+
assert.equal(step(), 'Grab');
|
|
127
|
+
mine.delete('a');
|
|
128
|
+
assert.equal(step(), null);
|
|
129
|
+
mine.add('a');
|
|
130
|
+
assert.equal(step(), 'Grab');
|
|
131
|
+
// So does a turn out of the cone.
|
|
132
|
+
me.rotationY = 70;
|
|
133
|
+
assert.equal(step(), null);
|
|
134
|
+
// And nothing farther than 1.6 m is offered, however steady the player.
|
|
135
|
+
me.rotationY = 0;
|
|
136
|
+
place('a', 0, 2.4);
|
|
137
|
+
for (let i = 0; i < 5; i += 1) {
|
|
138
|
+
assert.equal(step(), null);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
test('without reach or steady: a big object is offered past 3.5 m centre to centre, as before', () => {
|
|
143
|
+
// A wide box (1.84 m from centre to edge) whose centre is 3.4 m out and
|
|
144
|
+
// 1.8 m up: the v1.22 centre bound applies only to a place that asks.
|
|
145
|
+
const box = { kind: 'box', width: 2.6, height: 1, depth: 2.6 };
|
|
146
|
+
const before = rig({ ...GRAB_DEFAULTS }, { a: { x: 0, z: 3.4, y: 2.65, shape: box } });
|
|
147
|
+
assert.ok(Math.hypot(3.4, 1.8) > OFFER_CENTRE_M);
|
|
148
|
+
assert.equal(before.step(), 'Grab');
|
|
149
|
+
const asked = rig({ ...GRAB_DEFAULTS, reach: 1.6 }, { a: { x: 0, z: 3.4, y: 2.65, shape: box } });
|
|
150
|
+
assert.equal(asked.step(), null);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test('a place without grab draws no button and sends nothing', () => {
|
|
154
|
+
const { step, grabs } = rig(null, { a: at(1, 0) });
|
|
155
|
+
assert.equal(step(0, true), null);
|
|
156
|
+
assert.deepEqual(grabs(), []);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test('a press grabs what is offered, the same with or without steady', () => {
|
|
160
|
+
for (const grab of [{ ...GRAB_DEFAULTS }, { ...GRAB_DEFAULTS, steady: true }]) {
|
|
161
|
+
const { step, grabs, g } = rig(grab, { a: at(1.2, 0), b: at(1.5, 10) });
|
|
162
|
+
assert.equal(step(), 'Grab');
|
|
163
|
+
assert.equal(step(16, true), 'Throw');
|
|
164
|
+
assert.deepEqual(grabs(), ['a']);
|
|
165
|
+
assert.equal(g.holding(), 'a');
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
test('reach: objects are offered farther away, and never past 3 m centre to centre', () => {
|
|
170
|
+
const { step, place } = rig({ ...GRAB_DEFAULTS, reach: 2.2 }, { a: at(2.45, 0) });
|
|
171
|
+
assert.equal(step(), 'Grab');
|
|
172
|
+
place('a', 0, 2.55);
|
|
173
|
+
assert.equal(step(), null);
|
|
174
|
+
// Without steady, the reach has no hysteresis.
|
|
175
|
+
place('a', 0, 2.45);
|
|
176
|
+
assert.equal(step(), 'Grab');
|
|
177
|
+
place('a', 0, 2.55);
|
|
178
|
+
assert.equal(step(), null);
|
|
179
|
+
// At the top of the reach, a wide object whose near side is in reach but
|
|
180
|
+
// whose centre is past the cap (3 m at most, 2.55 m for a walking player) is not offered.
|
|
181
|
+
const box = { kind: 'box', width: 2, height: 1, depth: 2 };
|
|
182
|
+
const far = rig({ ...GRAB_DEFAULTS, reach: 3 }, { a: { x: 0, z: 3.9, shape: box } });
|
|
183
|
+
assert.equal(far.step(), null);
|
|
184
|
+
far.place('a', 0, 2.5);
|
|
185
|
+
assert.equal(far.step(), 'Grab');
|
|
186
|
+
assert.ok(OFFER_CENTRE_M < GRAB_REACH);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test('reach: a faster-moving player is offered less far, so a running grab stays inside the server reach', () => {
|
|
190
|
+
// The server judges a grab from a pose that may trail the player's own;
|
|
191
|
+
// the offer keeps inside 4 m by what they travel in 0.2 s at the speed
|
|
192
|
+
// they move (their body's velocity, jumps included) or are tuned to.
|
|
193
|
+
const lag = 0.2;
|
|
194
|
+
for (const [velocity, tune, base] of [
|
|
195
|
+
[null, null, undefined],
|
|
196
|
+
[{ x: 6, y: 0, z: 0 }, null, undefined],
|
|
197
|
+
[{ x: 18, y: 0, z: 0 }, null, undefined],
|
|
198
|
+
[{ x: 0, y: 20, z: 0 }, { speed: 1, jump: 2.5 }, undefined],
|
|
199
|
+
[null, { speed: 3 }, 36], // an authored 12 m/s preset, tuned three times (Player.speed is already tuned)
|
|
200
|
+
[{ x: 18, y: 0, z: 0 }, null, 6], // a tune just lowered: the body still runs
|
|
201
|
+
]) {
|
|
202
|
+
const cap = offerCap(velocity, tune, base);
|
|
203
|
+
const speed = Math.max(velocity ? Math.hypot(velocity.x, velocity.y, velocity.z) : 0, base ?? 6 * Math.max(1, tune?.speed ?? 1));
|
|
204
|
+
assert.ok(cap >= 0 && cap <= OFFER_CENTRE_M);
|
|
205
|
+
assert.ok(cap === 0 || cap + speed * lag < GRAB_REACH, `${JSON.stringify([velocity, tune, base])}: ${cap}`);
|
|
206
|
+
}
|
|
207
|
+
assert.ok(offerCap({ x: 18, y: 0, z: 0 }) < offerCap(null));
|
|
208
|
+
// The tune is counted once: a walk preset tuned twice as fast (Player.speed 12) still offers.
|
|
209
|
+
assert.ok(offerCap(null, { speed: 2 }, 12) > 0);
|
|
210
|
+
assert.equal(offerCap(null, { speed: 2 }, 12), offerCap(null, { speed: 2 }));
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
test('steady: the same object stays offered through a frame out of the cone or out of this client’s hands', () => {
|
|
214
|
+
const { step, me, mine, place, grabs } = rig(
|
|
215
|
+
{ ...GRAB_DEFAULTS, steady: true, reach: 2.2 },
|
|
216
|
+
{
|
|
217
|
+
a: at(2.2, 0),
|
|
218
|
+
b: at(4, 0),
|
|
219
|
+
},
|
|
220
|
+
);
|
|
221
|
+
assert.equal(step(), 'Grab');
|
|
222
|
+
// Another object comes nearer: the offer stays on the first.
|
|
223
|
+
place('b', 0, 1);
|
|
224
|
+
assert.equal(step(), 'Grab');
|
|
225
|
+
// Out of the 60 degree cone, inside 90: still offered, no grace needed.
|
|
226
|
+
me.rotationY = 75;
|
|
227
|
+
assert.equal(step(), 'Grab');
|
|
228
|
+
// (Through a lost frame another object in reach would take the offer over:
|
|
229
|
+
// the next test. Here there is none.)
|
|
230
|
+
place('b', 0, 4);
|
|
231
|
+
// A step back past the reach, inside its margin: still offered.
|
|
232
|
+
me.rotationY = 0;
|
|
233
|
+
place('a', 0, 2.2 + 0.3 + 0.03); // past the reach, inside its margin and the walking cap
|
|
234
|
+
assert.equal(step(), 'Grab');
|
|
235
|
+
// A frame where the multiplayer kit hands it to someone else.
|
|
236
|
+
mine.delete('a');
|
|
237
|
+
assert.equal(step(), 'Grab');
|
|
238
|
+
mine.add('a');
|
|
239
|
+
assert.equal(step(), 'Grab');
|
|
240
|
+
// A frame turned right away from it.
|
|
241
|
+
me.rotationY = 180;
|
|
242
|
+
assert.equal(step(), 'Grab');
|
|
243
|
+
me.rotationY = 0;
|
|
244
|
+
// The press grabs the kept object, not the nearer one.
|
|
245
|
+
assert.equal(step(16, true), 'Throw');
|
|
246
|
+
assert.deepEqual(grabs(), ['a']);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test('steady: the grace ends after 600 ms and the button goes; another object takes the offer over meanwhile', () => {
|
|
250
|
+
const { step, mine, place } = rig(
|
|
251
|
+
{ ...GRAB_DEFAULTS, steady: true },
|
|
252
|
+
{ a: at(1.5, 0), b: at(5, 0) },
|
|
253
|
+
);
|
|
254
|
+
assert.equal(step(), 'Grab');
|
|
255
|
+
mine.delete('a');
|
|
256
|
+
let t = 0;
|
|
257
|
+
while (t + 100 <= STEADY_GRACE_MS) {
|
|
258
|
+
assert.equal(step(100), 'Grab');
|
|
259
|
+
t += 100;
|
|
260
|
+
}
|
|
261
|
+
assert.equal(step(STEADY_GRACE_MS - t + 1), null);
|
|
262
|
+
assert.equal(step(), null);
|
|
263
|
+
// Back in this client's hands: offered again.
|
|
264
|
+
mine.add('a');
|
|
265
|
+
assert.equal(step(), 'Grab');
|
|
266
|
+
// Out of hands again, and another object comes into reach: it is offered.
|
|
267
|
+
mine.delete('a');
|
|
268
|
+
place('b', 0, 1);
|
|
269
|
+
assert.equal(step(), 'Grab');
|
|
270
|
+
assert.equal(step(STEADY_GRACE_MS + 100), 'Grab');
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
test('steady: a press in the grace waits for the object to be this client’s again, then grabs it', () => {
|
|
274
|
+
const { step, mine, grabs, sent } = rig({ ...GRAB_DEFAULTS, steady: true }, { a: at(1.5, 0) });
|
|
275
|
+
assert.equal(step(), 'Grab');
|
|
276
|
+
mine.delete('a');
|
|
277
|
+
assert.equal(step(16, true), 'Grab');
|
|
278
|
+
assert.equal(step(100), 'Grab');
|
|
279
|
+
assert.deepEqual(sent, []);
|
|
280
|
+
mine.add('a');
|
|
281
|
+
assert.equal(step(100), 'Throw');
|
|
282
|
+
assert.deepEqual(grabs(), ['a']);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
test('steady: a press is dropped when the object never comes back, and no grab is ever sent for one this client does not own', () => {
|
|
286
|
+
const { step, mine, sent } = rig({ ...GRAB_DEFAULTS, steady: true }, { a: at(1.5, 0) });
|
|
287
|
+
assert.equal(step(), 'Grab');
|
|
288
|
+
mine.delete('a');
|
|
289
|
+
assert.equal(step(16, true), 'Grab');
|
|
290
|
+
for (let i = 0; i < 30; i += 1) {
|
|
291
|
+
step(50, i % 3 === 0);
|
|
292
|
+
}
|
|
293
|
+
assert.deepEqual(sent, []);
|
|
294
|
+
assert.equal(step(), null);
|
|
295
|
+
// Back after the press's wait: offered, but the old press does not grab it.
|
|
296
|
+
assert.ok(30 * 50 > PRESS_WAIT_MS + STEADY_GRACE_MS);
|
|
297
|
+
mine.add('a');
|
|
298
|
+
assert.equal(step(), 'Grab');
|
|
299
|
+
assert.equal(step(), 'Grab');
|
|
300
|
+
assert.deepEqual(sent, []);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
test('steady: a hidden or removed object, or a player who cannot act, ends the offer at once', () => {
|
|
304
|
+
const { step, actors } = rig({ ...GRAB_DEFAULTS, steady: true }, { a: at(1.5, 0) });
|
|
305
|
+
assert.equal(step(), 'Grab');
|
|
306
|
+
hub.hidden.add('a');
|
|
307
|
+
assert.equal(step(), null);
|
|
308
|
+
hub.hidden.delete('a');
|
|
309
|
+
assert.equal(step(), 'Grab');
|
|
310
|
+
assert.equal(step(16, false, false), null);
|
|
311
|
+
assert.equal(step(), 'Grab');
|
|
312
|
+
actors.delete('a');
|
|
313
|
+
assert.equal(step(), null);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
test('steady: nothing past the reach and its margin is kept, and nothing is first offered past the reach', () => {
|
|
317
|
+
const { step, place } = rig({ ...GRAB_DEFAULTS, steady: true }, { a: at(2.05, 0) });
|
|
318
|
+
// Near side 1.75 m: past the 1.6 m reach, never offered.
|
|
319
|
+
assert.equal(step(), null);
|
|
320
|
+
place('a', 0, 1.8);
|
|
321
|
+
assert.equal(step(), 'Grab');
|
|
322
|
+
// Past the reach and its margin: the grace runs out.
|
|
323
|
+
place('a', 0, 1.6 + 0.3 + KEEP_MARGIN_M + 0.1);
|
|
324
|
+
assert.equal(step(), 'Grab');
|
|
325
|
+
assert.equal(step(STEADY_GRACE_MS + 1), null);
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
console.log(`test-grab-client: ${n} passed`);
|
|
@@ -378,6 +378,107 @@ await test("a game's end stays armed until the player is in another session", as
|
|
|
378
378
|
assert.equal(system.pendingEnd, null);
|
|
379
379
|
});
|
|
380
380
|
|
|
381
|
+
await test("the town's server replaced under a player who came back through a door: the join the runtime began with is made again", async () => {
|
|
382
|
+
const closedNet = (error = null) => ({ closed: () => true, closeError: () => error });
|
|
383
|
+
const run = ({ target, depth = 0, place = { title: 'Town' }, tickets = [], error = null, root }) => {
|
|
384
|
+
const { system, scene } = setup();
|
|
385
|
+
const switched = [];
|
|
386
|
+
scene.multiplayer = { target, net: null, switchSession: (sc, join, opts) => switched.push([join, opts ?? null]) };
|
|
387
|
+
scene.persistent.hubDepth = depth;
|
|
388
|
+
scene.persistent.hubTickets = tickets;
|
|
389
|
+
if (root) {
|
|
390
|
+
scene.persistent.hubRootJoin = root;
|
|
391
|
+
}
|
|
392
|
+
HubState.hub.place = place;
|
|
393
|
+
system.lastNet = closedNet(error);
|
|
394
|
+
system.watchSession(scene, scene.multiplayer);
|
|
395
|
+
return { system, switched };
|
|
396
|
+
};
|
|
397
|
+
// Back in the town by a hub join (its handoff spent), and the session ends.
|
|
398
|
+
let r = run({ target: { mode: 'hub', handoff: { sessionId: 'town-1' } } });
|
|
399
|
+
assert.deepEqual(r.switched, [[{ mode: 'public' }, null]]);
|
|
400
|
+
assert.equal(r.system.toast.text, 'Reconnecting…');
|
|
401
|
+
assert.equal(r.system.lastNet, null, 'once');
|
|
402
|
+
r = run({ target: { mode: 'hub', handoff: {} }, root: { mode: 'named', key: 'k' } });
|
|
403
|
+
assert.deepEqual(r.switched, [[{ mode: 'named', key: 'k' }, null]]);
|
|
404
|
+
// A join the multiplayer kit makes again by itself: left to it.
|
|
405
|
+
assert.deepEqual(run({ target: { mode: 'public' } }).switched, []);
|
|
406
|
+
// In a game, or barred from the hub: not this.
|
|
407
|
+
assert.deepEqual(run({ target: { mode: 'hub', handoff: {} }, place: { title: 'Foot Race', result: {} } }).switched, []);
|
|
408
|
+
assert.deepEqual(run({ target: { mode: 'hub', handoff: {} }, error: 'CAULDRON_HUB_BANNED' }).switched, []);
|
|
409
|
+
assert.deepEqual(calls.filter((c) => c[0] === 'back'), []);
|
|
410
|
+
// A trip of ours closes the old connection: not an ending.
|
|
411
|
+
const { system, scene } = setup();
|
|
412
|
+
const switched = [];
|
|
413
|
+
scene.multiplayer = { target: { mode: 'hub', handoff: {} }, net: null, switchSession: (...a) => switched.push(a) };
|
|
414
|
+
system.lastNet = closedNet();
|
|
415
|
+
system.trip = { phase: 'covering' };
|
|
416
|
+
system.watchSession(scene, scene.multiplayer);
|
|
417
|
+
assert.deepEqual(switched, []);
|
|
418
|
+
HubState.hub.place = null;
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
await test('a place behind a door whose server is replaced under a player: left by its way back, once', async () => {
|
|
422
|
+
const closedNet = (error = null) => ({ closed: () => true, closeError: () => error });
|
|
423
|
+
const run = ({ depth = 1, place = { title: 'Pebble Cove' }, tickets, error = null }) => {
|
|
424
|
+
const { system, scene } = setup();
|
|
425
|
+
const switched = [];
|
|
426
|
+
scene.multiplayer = { target: { mode: 'hub', handoff: { sessionId: 'cove-1' } }, net: null, switchSession: (sc, join, opts) => switched.push([join, opts ?? null]) };
|
|
427
|
+
scene.persistent.hubDepth = depth;
|
|
428
|
+
scene.persistent.hubTickets = tickets ?? [{ scene: 'scenes/main.scene', title: 'Town', door: 'cove', hub: true, join: { mode: 'public' } }];
|
|
429
|
+
HubState.hub.place = place;
|
|
430
|
+
answers.back = handoff();
|
|
431
|
+
system.lastNet = closedNet(error);
|
|
432
|
+
system.watchSession(scene, scene.multiplayer);
|
|
433
|
+
return { system, scene, switched };
|
|
434
|
+
};
|
|
435
|
+
const backs = () => calls.filter((c) => c[0] === 'back').length;
|
|
436
|
+
|
|
437
|
+
// A place that is not a game, reached through a door: Hub.back, no rejoin.
|
|
438
|
+
let r = run({});
|
|
439
|
+
await flush();
|
|
440
|
+
assert.equal(backs(), 1);
|
|
441
|
+
assert.deepEqual(r.switched, []);
|
|
442
|
+
assert.equal(r.system.toast.text, 'This place was updated. Back to Town…');
|
|
443
|
+
assert.equal(r.system.trip?.target.hubStep, -1, 'the way back is a hub trip');
|
|
444
|
+
assert.equal(HubState.hub.place, null, 'what the dead session drew is gone');
|
|
445
|
+
// While that way back is pending the close is not acted on again, even with
|
|
446
|
+
// the dead connection still there.
|
|
447
|
+
r.system.lastNet = closedNet();
|
|
448
|
+
r.system.watchSession(r.scene, r.scene.multiplayer);
|
|
449
|
+
r.system.watchSession(r.scene, r.scene.multiplayer);
|
|
450
|
+
await flush();
|
|
451
|
+
assert.equal(backs(), 1);
|
|
452
|
+
assert.deepEqual(r.switched, []);
|
|
453
|
+
// After a way back that was refused, the close is not seen again: the
|
|
454
|
+
// multiplayer kit holds no connection, and Back is left to the host's control.
|
|
455
|
+
r.system.trip = null;
|
|
456
|
+
r.system.watchSession(r.scene, r.scene.multiplayer);
|
|
457
|
+
await flush();
|
|
458
|
+
assert.equal(backs(), 1);
|
|
459
|
+
|
|
460
|
+
// No ticket in this runtime (the host's trail holds the trip): still Hub.back.
|
|
461
|
+
r = run({ tickets: [] });
|
|
462
|
+
await flush();
|
|
463
|
+
assert.equal(backs(), 1);
|
|
464
|
+
assert.equal(r.system.toast.text, 'This place was updated. Going back…');
|
|
465
|
+
|
|
466
|
+
// A game behind a door is left as it always was.
|
|
467
|
+
r = run({ place: { title: 'Foot Race', result: {} } });
|
|
468
|
+
await flush();
|
|
469
|
+
assert.equal(backs(), 1);
|
|
470
|
+
assert.equal(r.system.toast.text, 'The game ended');
|
|
471
|
+
assert.deepEqual(r.switched, []);
|
|
472
|
+
|
|
473
|
+
// Barred from the hub: nothing is asked.
|
|
474
|
+
r = run({ error: 'CAULDRON_HUB_BANNED' });
|
|
475
|
+
await flush();
|
|
476
|
+
assert.equal(backs(), 0);
|
|
477
|
+
assert.deepEqual(r.switched, []);
|
|
478
|
+
assert.equal(r.system.trip, null);
|
|
479
|
+
HubState.hub.place = null;
|
|
480
|
+
});
|
|
481
|
+
|
|
381
482
|
await test("a game's end waits out a pending join, settles once it resolves elsewhere, and retries after a failed one", async () => {
|
|
382
483
|
const { system, scene } = setup();
|
|
383
484
|
const backs = [];
|
|
@@ -1234,6 +1335,92 @@ await test('People: a game lists who may be reported, only where the host runs t
|
|
|
1234
1335
|
HubState.hub.whereAt = {};
|
|
1235
1336
|
});
|
|
1236
1337
|
|
|
1338
|
+
await test('a sent chat line says whom it reached', async () => {
|
|
1339
|
+
const { system } = setup();
|
|
1340
|
+
let status = 'sent';
|
|
1341
|
+
system.chat.send = (text, done) => done(status);
|
|
1342
|
+
system.chatReach = ['bo', 'amy'];
|
|
1343
|
+
system.saying({ text: 'hello' });
|
|
1344
|
+
assert.equal(system.toast.text, 'Sent to bo, amy');
|
|
1345
|
+
system.chatReach = ['a', 'b', 'c', 'd', 'e'];
|
|
1346
|
+
system.saying({ text: 'hello' });
|
|
1347
|
+
assert.equal(system.toast.text, 'Sent to a, b, c +2');
|
|
1348
|
+
status = 'none';
|
|
1349
|
+
system.saying({ text: 'hello' });
|
|
1350
|
+
assert.equal(system.toast.text, 'Nobody here can read that. Follow each other to chat.');
|
|
1351
|
+
});
|
|
1352
|
+
|
|
1353
|
+
await test('the invite button beside someone: steady at the edge of range, kept for a friend, says it was sent', async () => {
|
|
1354
|
+
const together = makeTogether();
|
|
1355
|
+
const at = { p2: { x: 2, z: 0 }, p4: { x: 30, z: 0 } };
|
|
1356
|
+
const scene = {
|
|
1357
|
+
multiplayer: {
|
|
1358
|
+
net: { others: () => new Map([['p2', 'bo'], ['p4', 'amy']]), userId: (id) => ({ p2: '102', p4: '104' })[id] ?? null, send() {} },
|
|
1359
|
+
avatars: { actors: new Map([['p2', 'a2'], ['p4', 'a4']]) },
|
|
1360
|
+
},
|
|
1361
|
+
getActor: (id) => ({ components: { Transform: at[id === 'a2' ? 'p2' : 'p4'] } }),
|
|
1362
|
+
};
|
|
1363
|
+
HubState.hub.place = { title: 'Town', result: null };
|
|
1364
|
+
HubState.hub.party = { members: null, away: 0, invite: null, proposal: null };
|
|
1365
|
+
const local = { components: { Transform: { x: 0, y: 1, z: 0 } } };
|
|
1366
|
+
const friends = [{ userId: '104', username: 'amy', here: true }];
|
|
1367
|
+
together.frame(scene.multiplayer, friends, true, 0);
|
|
1368
|
+
const who = (now) => together.beside(scene, local, now)?.playerId ?? null;
|
|
1369
|
+
assert.equal(who(1000), null, 'not at once');
|
|
1370
|
+
assert.equal(who(2600), 'p2', 'after standing by them a moment');
|
|
1371
|
+
// A step back past the near distance and in again: the button does not blink.
|
|
1372
|
+
at.p2.x = 2.6;
|
|
1373
|
+
assert.equal(who(2700), 'p2', 'still about');
|
|
1374
|
+
at.p2.x = 2.1;
|
|
1375
|
+
assert.equal(who(2800), 'p2');
|
|
1376
|
+
assert.equal(who(11000), null, 'not a friend: the offer ends');
|
|
1377
|
+
// Walked right off and back: offered again after a moment.
|
|
1378
|
+
at.p2.x = 9;
|
|
1379
|
+
assert.equal(who(11100), null);
|
|
1380
|
+
at.p2.x = 2;
|
|
1381
|
+
assert.equal(who(11200), null);
|
|
1382
|
+
assert.equal(who(12800), 'p2');
|
|
1383
|
+
// A press: the button says so, then leaves that player alone for a while.
|
|
1384
|
+
together.invited('p2', 12900);
|
|
1385
|
+
assert.deepEqual(together.beside(scene, local, 13000), { d: 2, playerId: 'p2', username: 'bo', sent: true });
|
|
1386
|
+
assert.equal(who(18000), null, 'not offered again straight away');
|
|
1387
|
+
assert.equal(who(44000), null, 'the old offer has run out by then');
|
|
1388
|
+
// A friend's stays for as long as they stand there.
|
|
1389
|
+
at.p2.x = 30;
|
|
1390
|
+
at.p4.x = 1.5;
|
|
1391
|
+
assert.equal(who(50000), null);
|
|
1392
|
+
assert.equal(who(52000), 'p4');
|
|
1393
|
+
assert.equal(who(90000), 'p4', 'a friend beside the player is always offered');
|
|
1394
|
+
// Someone whose offer ran out is not in the way of the next one along.
|
|
1395
|
+
at.p4.x = 30;
|
|
1396
|
+
at.p2.x = 3;
|
|
1397
|
+
assert.equal(who(100000), null);
|
|
1398
|
+
at.p2.x = 2;
|
|
1399
|
+
assert.equal(who(100100), null);
|
|
1400
|
+
assert.equal(who(101700), 'p2');
|
|
1401
|
+
assert.equal(who(111000), null, "bo's offer ends");
|
|
1402
|
+
at.p2.x = 3;
|
|
1403
|
+
at.p4.x = 1;
|
|
1404
|
+
assert.equal(who(111100), null);
|
|
1405
|
+
assert.equal(who(112700), 'p4', 'amy, though bo still stands near');
|
|
1406
|
+
together.invited('p4', 112800);
|
|
1407
|
+
assert.equal(together.beside(scene, local, 113000).sent, true);
|
|
1408
|
+
at.p2.x = 9;
|
|
1409
|
+
assert.equal(who(117000), null);
|
|
1410
|
+
at.p2.x = 2;
|
|
1411
|
+
assert.equal(who(117100), null);
|
|
1412
|
+
assert.equal(who(118700), 'p2', 'bo walked off and back: offered, though amy was just invited');
|
|
1413
|
+
at.p2.x = 30;
|
|
1414
|
+
at.p4.x = 1.5;
|
|
1415
|
+
assert.equal(who(150000), null);
|
|
1416
|
+
assert.equal(who(152000), 'p4');
|
|
1417
|
+
// In the party: nothing to offer.
|
|
1418
|
+
HubState.hub.party = { members: ['p4'], away: 0, invite: null, proposal: null };
|
|
1419
|
+
assert.equal(who(153000), null);
|
|
1420
|
+
HubState.hub.party = { members: null, away: 0, invite: null, proposal: null };
|
|
1421
|
+
HubState.hub.place = null;
|
|
1422
|
+
});
|
|
1423
|
+
|
|
1237
1424
|
await test('start next to a friend: once, on walking in, when a friend is here and the player has not walked off', async () => {
|
|
1238
1425
|
const { system, scene } = setup();
|
|
1239
1426
|
const sent = [];
|
|
@@ -1290,6 +1477,27 @@ await test('start next to a friend: once, on walking in, when a friend is here a
|
|
|
1290
1477
|
assert.deepEqual(system.together.arrivals(), [{ playerId: 'p9', username: 'zed' }]);
|
|
1291
1478
|
assert.deepEqual(system.together.arrivals(), []);
|
|
1292
1479
|
|
|
1480
|
+
// A friend who goes through a door is named to those left behind, with Follow.
|
|
1481
|
+
HubState.hub.doors = [{ id: 'race', title: 'Foot Race', late: true }];
|
|
1482
|
+
system.together.frame(scene.multiplayer, [...friends, { userId: '109', username: 'zed', here: true }], true, 48000);
|
|
1483
|
+
HubState.hub.wentEvents.push({ k: 'hub-went', players: ['p9'], door: 'race' }, { k: 'hub-went', players: ['p2'], door: 'race' });
|
|
1484
|
+
for (const went of HubState.hub.wentEvents.splice(0)) {
|
|
1485
|
+
const name = went.players.map((id) => system.together.lately(id)).find(Boolean);
|
|
1486
|
+
if (name) {
|
|
1487
|
+
system.playAsk = { from: went.players[0], name, door: went.door, until: performance.now() + 45000, went: true };
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
assert.deepEqual([system.ask().text, system.ask().yes], ['zed went into Foot Race', 'Follow'], 'bo is no friend: only zed is named');
|
|
1491
|
+
// A door that takes no late joiners: told where they are, with no Follow.
|
|
1492
|
+
HubState.hub.doors = [{ id: 'race', title: 'Foot Race' }];
|
|
1493
|
+
assert.deepEqual([system.ask().text, system.ask().yes, system.ask().no], ['zed went into Foot Race · back soon', 'OK', 'Go to the door']);
|
|
1494
|
+
sent.length = 0;
|
|
1495
|
+
system.jumpSentAt = -Infinity;
|
|
1496
|
+
system.answer(scene, system.ask(), true);
|
|
1497
|
+
assert.deepEqual(sent, [], 'OK stays put');
|
|
1498
|
+
system.playAsk = null;
|
|
1499
|
+
HubState.hub.doors = [];
|
|
1500
|
+
|
|
1293
1501
|
// A jump the player asks for ends a pending start, and one sent on the
|
|
1294
1502
|
// heels of another waits its turn rather than being dropped by the place.
|
|
1295
1503
|
system.startNear = { until: 99999, at: null, asked: false };
|
|
@@ -5,7 +5,8 @@ import assert from 'node:assert/strict';
|
|
|
5
5
|
import fs from 'node:fs';
|
|
6
6
|
import os from 'node:os';
|
|
7
7
|
import path from 'node:path';
|
|
8
|
-
import { checkResult, GRAB_DEFAULTS, publicPlace, readManifest } from '../code/server/manifest.js';
|
|
8
|
+
import { checkResult, GRAB_DEFAULTS, GRAB_REACH_LIMITS, publicPlace, readManifest } from '../code/server/manifest.js';
|
|
9
|
+
import { GRAB_REACH as SERVER_GRAB_REACH } from '../code/server/grab.js';
|
|
9
10
|
import { resolvePlace } from '../code/server/place.js';
|
|
10
11
|
|
|
11
12
|
const kit = JSON.parse(fs.readFileSync(new URL('../castle.json', import.meta.url), 'utf8'));
|
|
@@ -53,6 +54,14 @@ test('unknown keys are refused, not ignored', () => {
|
|
|
53
54
|
assert.match(errors.join('\n'), /hub\.maxPlayer is not part/);
|
|
54
55
|
});
|
|
55
56
|
|
|
57
|
+
test("tiers: the deck's, true or false", () => {
|
|
58
|
+
assert.deepEqual(readManifest(base({ tiers: true }), has).errors, []);
|
|
59
|
+
assert.deepEqual(readManifest(base({ tiers: false }), has).errors, []);
|
|
60
|
+
assert.match(readManifest(base({ tiers: 'yes' }), has).errors.join(), /hub\.tiers must be true or false/);
|
|
61
|
+
const { errors } = readManifest(base({ places: { arena: { title: 'Arena', scene: 'scenes/arena.scene', tiers: true } } }), has);
|
|
62
|
+
assert.match(errors.join('\n'), /hub\.places\.arena\.tiers is not part/);
|
|
63
|
+
});
|
|
64
|
+
|
|
56
65
|
test('player counts', () => {
|
|
57
66
|
assert.match(readManifest(base({ minPlayers: 5, maxPlayers: 4 }), has).errors.join(), /more than maxPlayers/);
|
|
58
67
|
assert.match(readManifest(base({ maxPlayers: 12 }), has).errors.join(), /server\.maxPlayers/);
|
|
@@ -125,6 +134,41 @@ test('grab (v1.3): true is the defaults, an object sets any of them, off is none
|
|
|
125
134
|
assert.ok(!('grab' in publicPlace('main', place(undefined).manifest.places.main)));
|
|
126
135
|
});
|
|
127
136
|
|
|
137
|
+
test('grab.reach and grab.steady (v1.22): kept only when set, bounded, and the rest unchanged', () => {
|
|
138
|
+
const place = (grab) => readManifest(base({ grab }), has);
|
|
139
|
+
// Left out, or steady false: exactly the place, and the client message, of before.
|
|
140
|
+
for (const grab of [true, {}, { throwSpeed: 6 }, { steady: false }]) {
|
|
141
|
+
const read = place(grab).manifest.places.main.grab;
|
|
142
|
+
assert.ok(!('reach' in read) && !('steady' in read));
|
|
143
|
+
assert.deepEqual(Object.keys(publicPlace('main', place(grab).manifest.places.main).grab), Object.keys(GRAB_DEFAULTS));
|
|
144
|
+
}
|
|
145
|
+
assert.deepEqual(place({ steady: false }).manifest.places.main.grab, GRAB_DEFAULTS);
|
|
146
|
+
assert.deepEqual(place({ steady: true, reach: 2.2, throwSpeed: 6 }).manifest.places.main.grab, {
|
|
147
|
+
...GRAB_DEFAULTS,
|
|
148
|
+
throwSpeed: 6,
|
|
149
|
+
reach: 2.2,
|
|
150
|
+
steady: true,
|
|
151
|
+
});
|
|
152
|
+
assert.deepEqual(publicPlace('main', place({ steady: true, reach: 2.2 }).manifest.places.main).grab, {
|
|
153
|
+
...GRAB_DEFAULTS,
|
|
154
|
+
reach: 2.2,
|
|
155
|
+
steady: true,
|
|
156
|
+
});
|
|
157
|
+
assert.deepEqual(GRAB_REACH_LIMITS.slice(0, 2), [1.6, 3]);
|
|
158
|
+
assert.equal(place({ reach: 1.6 }).manifest.places.main.grab.reach, 1.6);
|
|
159
|
+
assert.equal(place({ reach: 3 }).manifest.places.main.grab.reach, 3);
|
|
160
|
+
assert.deepEqual(place({ reach: 3 }).errors, []);
|
|
161
|
+
for (const reach of [1.5, 3.1, 4, -1, '2', Number.NaN, null, true]) {
|
|
162
|
+
assert.match(place({ reach }).errors.join(), /grab\.reach must be a number of metres from 1\.6 to 3/);
|
|
163
|
+
}
|
|
164
|
+
for (const steady of ['yes', 1, null, {}]) {
|
|
165
|
+
assert.match(place({ steady }).errors.join(), /grab\.steady must be true or false/);
|
|
166
|
+
}
|
|
167
|
+
assert.match(place({ reachh: 2 }).errors.join(), /hub\.grab\.reachh is not part/);
|
|
168
|
+
// The top of the reach stays inside the server's own GRAB_REACH.
|
|
169
|
+
assert.ok(GRAB_REACH_LIMITS[1] < SERVER_GRAB_REACH);
|
|
170
|
+
});
|
|
171
|
+
|
|
128
172
|
test('results are checked against the declared shape', () => {
|
|
129
173
|
const { manifest } = readManifest(
|
|
130
174
|
base({ result: { outcomes: ['win', 'lose'], score: { min: 0, max: 100 }, stats: { kart: 'string' } } }),
|
|
@@ -180,6 +224,8 @@ test('npcs name a shared-character route', () => {
|
|
|
180
224
|
assert.match(readManifest(base({ npcs: { route: 'plain' } }, { server, characterBundle }), has).errors[0], /characters: "shared"/);
|
|
181
225
|
assert.match(readManifest(base({ npcs: { route: 'town', turnsPerMinute: 0 } }, { server, characterBundle }), has).errors[0], /turnsPerMinute/);
|
|
182
226
|
assert.match(readManifest(base({ npcs: { route: 'town', disclosure: 'everyone' } }, { server, characterBundle }), has).errors[0], /disclosure/);
|
|
227
|
+
// Read, and never acted on: a player's conversation is theirs alone.
|
|
228
|
+
assert.equal(readManifest(base({ npcs: { route: 'town', disclosure: 'world' } }, { server, characterBundle }), has).manifest.places.main.npcs.disclosure, 'participants');
|
|
183
229
|
assert.match(readManifest(base({ npcs: { route: 'town', slot: 'a b' } }, { server, characterBundle }), has).errors[0], /slot/);
|
|
184
230
|
assert.match(readManifest(base({ npcs: { route: 'town', budget: 3 } }, { server, characterBundle }), has).errors[0], /not part of the hub contract/);
|
|
185
231
|
assert.match(readManifest(base({ npcs: { route: 'town' } }, { server }), has).errors[0], /characterBundle/);
|