castle-web-cli 0.4.229 → 0.4.230
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-prompts.d.ts +2 -0
- package/dist/agent-prompts.js +16 -8
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +21 -21
- package/dist/api.d.ts +28 -2
- package/dist/api.js +74 -16
- package/dist/castle-host/host.d.ts +91 -0
- package/dist/castle-host/host.js +779 -3
- package/dist/castleJson.d.ts +44 -0
- package/dist/castleJson.js +131 -0
- package/dist/check.js +27 -1
- package/dist/contentPack.d.ts +49 -0
- package/dist/contentPack.js +273 -0
- package/dist/devExperiments.d.ts +21 -0
- package/dist/devExperiments.js +139 -0
- package/dist/devHub.d.ts +55 -0
- package/dist/devHub.js +187 -0
- package/dist/devSessionChild.js +3 -1
- package/dist/devSessionServer.d.ts +14 -1
- package/dist/devSessionServer.js +229 -44
- package/dist/experimentAssignment.d.ts +15 -0
- package/dist/experimentAssignment.js +41 -0
- package/dist/importCheckHook.d.ts +40 -0
- package/dist/importCheckHook.js +171 -0
- package/dist/importRegression.d.ts +15 -0
- package/dist/importRegression.js +100 -0
- package/dist/importTrust.d.ts +2 -0
- package/dist/importTrust.js +27 -0
- package/dist/importUpdateHook.d.ts +18 -0
- package/dist/importUpdateHook.js +31 -8
- package/dist/importUpdateHookRunner.js +19 -7
- package/dist/imports.d.ts +16 -0
- package/dist/imports.js +141 -31
- package/dist/index.js +3 -1
- package/dist/init.d.ts +3 -0
- package/dist/init.js +125 -8
- package/dist/install.js +4 -1
- package/dist/localPaths.js +4 -0
- package/dist/login.js +2 -2
- package/dist/platformDoc.js +3 -8
- package/dist/playPagePolicy.js +3 -1
- package/dist/remix.js +5 -0
- package/dist/routerTaskReport.d.ts +28 -0
- package/dist/routerTaskReport.js +56 -0
- package/dist/save-deck.d.ts +18 -0
- package/dist/save-deck.js +142 -6
- package/dist/serve.d.ts +8 -0
- package/dist/serve.js +94 -13
- package/dist/serverBundle.d.ts +1 -1
- package/dist/serverBundle.js +5 -1
- package/dist/webSourceSync.d.ts +2 -0
- package/dist/webSourceSync.js +2 -0
- package/kits/base/CLAUDE.md +2 -3
- package/kits/base/castle.json +1 -1
- package/kits/base/sdk/README.md +258 -52
- package/kits/base/sdk/agent.js +4 -4
- package/kits/base/sdk/avatar.d.ts +12 -0
- package/kits/base/sdk/avatar.js +23 -0
- package/kits/base/sdk/castle.d.ts +5 -0
- package/kits/base/sdk/castle.js +3 -0
- package/kits/base/sdk/commands.d.ts +208 -0
- package/kits/base/sdk/commands.js +16 -0
- package/kits/base/sdk/context.d.ts +6 -0
- package/kits/base/sdk/experiments.d.ts +15 -0
- package/kits/base/sdk/experiments.js +83 -0
- package/kits/base/sdk/hub.d.ts +85 -0
- package/kits/base/sdk/hub.js +107 -0
- package/kits/base/sdk/multiplayer.d.ts +45 -1
- package/kits/base/sdk/multiplayer.js +106 -4
- package/kits/base/sdk/server/hub.d.ts +169 -0
- package/kits/base/sdk/server/hub.js +125 -0
- package/kits/base/sdk/server/platformHandle.d.ts +42 -1
- package/kits/base/sdk/server/storage.d.ts +55 -2
- package/kits/base/sdk/server/wrapper.d.ts +32 -2
- package/kits/base/sdk/server/wrapper.js +90 -11
- package/kits/base/sdk/transport.d.ts +2 -1
- package/kits/base/sdk/transport.js +13 -1
- package/kits/hub-game/.prettierrc +5 -0
- package/kits/hub-game/CLAUDE.md +146 -0
- package/kits/hub-game/blueprints/avatar-0.scene +28 -0
- package/kits/hub-game/blueprints/avatar-1.scene +28 -0
- package/kits/hub-game/blueprints/avatar-2.scene +28 -0
- package/kits/hub-game/blueprints/avatar-3.scene +28 -0
- package/kits/hub-game/blueprints/bean/avatar-0.scene +28 -0
- package/kits/hub-game/blueprints/bean/avatar-1.scene +28 -0
- package/kits/hub-game/blueprints/bean/avatar-2.scene +28 -0
- package/kits/hub-game/blueprints/bean/avatar-3.scene +28 -0
- package/kits/hub-game/blueprints/blocky/avatar-0.scene +28 -0
- package/kits/hub-game/blueprints/blocky/avatar-1.scene +28 -0
- package/kits/hub-game/blueprints/blocky/avatar-2.scene +28 -0
- package/kits/hub-game/blueprints/blocky/avatar-3.scene +28 -0
- package/kits/hub-game/blueprints/pixel/avatar-0.scene +28 -0
- package/kits/hub-game/blueprints/pixel/avatar-1.scene +28 -0
- package/kits/hub-game/blueprints/pixel/avatar-2.scene +28 -0
- package/kits/hub-game/blueprints/pixel/avatar-3.scene +28 -0
- package/kits/hub-game/castle.json +96 -0
- package/kits/hub-game/code/client/attention.js +133 -0
- package/kits/hub-game/code/client/avatar.js +288 -0
- package/kits/hub-game/code/client/cabinets.js +90 -0
- package/kits/hub-game/code/client/chat.js +135 -0
- package/kits/hub-game/code/client/chrome.js +1001 -0
- package/kits/hub-game/code/client/doorFrame.js +15 -0
- package/kits/hub-game/code/client/firstJoin.js +14 -0
- package/kits/hub-game/code/client/grab.js +241 -0
- package/kits/hub-game/code/client/hookLayer.js +230 -0
- package/kits/hub-game/code/client/idle.js +326 -0
- package/kits/hub-game/code/client/keys.js +48 -0
- package/kits/hub-game/code/client/pack.js +232 -0
- package/kits/hub-game/code/client/packFormat.js +397 -0
- package/kits/hub-game/code/client/say.js +127 -0
- package/kits/hub-game/code/client/sha256.js +80 -0
- package/kits/hub-game/code/client/sound.js +147 -0
- package/kits/hub-game/code/client/state.js +131 -0
- package/kits/hub-game/code/client/talk.js +259 -0
- package/kits/hub-game/code/client/together.js +365 -0
- package/kits/hub-game/code/client/wear.js +149 -0
- package/kits/hub-game/code/server/actors.js +627 -0
- package/kits/hub-game/code/server/blocks.js +103 -0
- package/kits/hub-game/code/server/cabinets.js +309 -0
- package/kits/hub-game/code/server/game.js +137 -0
- package/kits/hub-game/code/server/grab.js +247 -0
- package/kits/hub-game/code/server/history.js +96 -0
- package/kits/hub-game/code/server/hub.js +1904 -0
- package/kits/hub-game/code/server/idle.js +412 -0
- package/kits/hub-game/code/server/index.js +64 -0
- package/kits/hub-game/code/server/labels.js +59 -0
- package/kits/hub-game/code/server/manifest.js +527 -0
- package/kits/hub-game/code/server/npcs.js +745 -0
- package/kits/hub-game/code/server/party.js +381 -0
- package/kits/hub-game/code/server/place.js +43 -0
- package/kits/hub-game/code/server/say.js +83 -0
- package/kits/hub-game/code/server/wear.js +142 -0
- package/kits/hub-game/code/systems/hub.js +2230 -0
- package/kits/hub-game/docs/content-pack.md +151 -0
- package/kits/hub-game/docs/contract.md +1139 -0
- package/kits/hub-game/docs/style.md +137 -0
- package/kits/hub-game/drawings/blocky/castle-eye.sprite +58 -0
- package/kits/hub-game/drawings/blocky/dash.sprite +59 -0
- package/kits/hub-game/drawings/blocky/pom.sprite +59 -0
- package/kits/hub-game/drawings/blocky/tabby.sprite +59 -0
- package/kits/hub-game/drawings/pixel/castle-arm.sprite +13 -0
- package/kits/hub-game/drawings/pixel/castle-body.sprite +23 -0
- package/kits/hub-game/drawings/pixel/castle-leg.sprite +12 -0
- package/kits/hub-game/drawings/pixel/kai-arm.sprite +14 -0
- package/kits/hub-game/drawings/pixel/kai-head.sprite +24 -0
- package/kits/hub-game/drawings/pixel/kai-leg.sprite +15 -0
- package/kits/hub-game/drawings/pixel/kai-torso.sprite +18 -0
- package/kits/hub-game/drawings/pixel/mimi-arm.sprite +13 -0
- package/kits/hub-game/drawings/pixel/mimi-head.sprite +23 -0
- package/kits/hub-game/drawings/pixel/mimi-leg.sprite +15 -0
- package/kits/hub-game/drawings/pixel/mimi-torso.sprite +18 -0
- package/kits/hub-game/drawings/pixel/nox-arm.sprite +13 -0
- package/kits/hub-game/drawings/pixel/nox-head.sprite +21 -0
- package/kits/hub-game/drawings/pixel/nox-leg.sprite +14 -0
- package/kits/hub-game/drawings/pixel/nox-torso.sprite +18 -0
- package/kits/hub-game/eslint.config.js +20 -0
- package/kits/hub-game/fonts.generated.js +9 -0
- package/kits/hub-game/index.html +22 -0
- package/kits/hub-game/main.jsx +6 -0
- package/kits/hub-game/models/avatar-0.pxmodel +21 -0
- package/kits/hub-game/models/avatar-1.pxmodel +24 -0
- package/kits/hub-game/models/avatar-2.pxmodel +27 -0
- package/kits/hub-game/models/avatar-3.pxmodel +22 -0
- package/kits/hub-game/models/bean/avatar-0.pxmodel +19 -0
- package/kits/hub-game/models/bean/avatar-1.pxmodel +24 -0
- package/kits/hub-game/models/bean/avatar-2.pxmodel +22 -0
- package/kits/hub-game/models/bean/avatar-3.pxmodel +24 -0
- package/kits/hub-game/models/blocky/avatar-0.pxmodel +21 -0
- package/kits/hub-game/models/blocky/avatar-1.pxmodel +30 -0
- package/kits/hub-game/models/blocky/avatar-2.pxmodel +28 -0
- package/kits/hub-game/models/blocky/avatar-3.pxmodel +27 -0
- package/kits/hub-game/models/pixel/avatar-0.pxmodel +24 -0
- package/kits/hub-game/models/pixel/avatar-1.pxmodel +16 -0
- package/kits/hub-game/models/pixel/avatar-2.pxmodel +19 -0
- package/kits/hub-game/models/pixel/avatar-3.pxmodel +23 -0
- package/kits/hub-game/package-lock.json +365 -0
- package/kits/hub-game/package.json +32 -0
- package/kits/hub-game/scenes/main.scene +318 -0
- package/kits/hub-game/scripts/check.mjs +339 -0
- package/kits/hub-game/scripts/fixtures/sdk-stub.mjs +3 -0
- package/kits/hub-game/scripts/gen-avatars-bean.mjs +748 -0
- package/kits/hub-game/scripts/gen-avatars-blocky.mjs +607 -0
- package/kits/hub-game/scripts/gen-avatars-pixel.mjs +771 -0
- package/kits/hub-game/scripts/gen-avatars.mjs +621 -0
- package/kits/hub-game/scripts/pack.mjs +192 -0
- package/kits/hub-game/scripts/test-actors.mjs +666 -0
- package/kits/hub-game/scripts/test-attention.mjs +103 -0
- package/kits/hub-game/scripts/test-avatar.mjs +472 -0
- package/kits/hub-game/scripts/test-ban-join.mjs +194 -0
- package/kits/hub-game/scripts/test-blocks.mjs +351 -0
- package/kits/hub-game/scripts/test-chat.mjs +98 -0
- package/kits/hub-game/scripts/test-classic.mjs +590 -0
- package/kits/hub-game/scripts/test-door-jump.mjs +131 -0
- package/kits/hub-game/scripts/test-door.mjs +56 -0
- package/kits/hub-game/scripts/test-grab.mjs +331 -0
- package/kits/hub-game/scripts/test-hub-ops.mjs +835 -0
- package/kits/hub-game/scripts/test-hub-trip.mjs +1310 -0
- package/kits/hub-game/scripts/test-idle.mjs +518 -0
- package/kits/hub-game/scripts/test-interest.mjs +413 -0
- package/kits/hub-game/scripts/test-keys.mjs +50 -0
- package/kits/hub-game/scripts/test-manifest.mjs +224 -0
- package/kits/hub-game/scripts/test-no-forms.mjs +16 -0
- package/kits/hub-game/scripts/test-npcs.mjs +714 -0
- package/kits/hub-game/scripts/test-pack.mjs +424 -0
- package/kits/hub-game/scripts/test-party.mjs +286 -0
- package/kits/hub-game/scripts/test-say.mjs +149 -0
- package/kits/hub-game/scripts/test-together.mjs +183 -0
- package/kits/hub-game/theme.style +3 -0
- package/kits/multiplayer-3d/castle.json +5 -5
- package/kits/multiplayer-3d/code/client/avatars.js +101 -1
- package/kits/multiplayer-3d/code/server/players.js +4 -1
- package/kits/multiplayer-3d/code/server/sceneBodies.js +27 -6
- package/kits/multiplayer-3d/code/server/world.js +20 -7
- package/kits/multiplayer-3d/code/systems/multiplayer.js +222 -11
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/engine/art.js +13 -0
- package/kits/physics-2d/engine/assets.js +4 -2
- package/kits/physics-2d/engine/scene.js +25 -5
- package/kits/physics-3d/CLAUDE.md +6 -1
- package/kits/physics-3d/castle.json +3 -3
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +32 -4
- package/kits/physics-3d/engine3d/artobjects.js +2 -2
- package/kits/physics-3d/engine3d/materials.js +29 -1
- package/kits/physics-3d/engine3d/world3d.js +65 -1
- package/kits/physics-3d/systems/physics3d.js +5 -2
- package/kits/real-time/castle.json +2 -2
- package/kits/real-time/code/client/connection.js +77 -7
- package/kits/real-time/code/client/gameHooks.js +63 -3
- package/kits/real-time/code/client/messages.js +7 -0
- package/kits/real-time/code/server/gameHooks.js +24 -0
- package/kits/real-time/code/server/session.js +390 -22
- package/package.json +2 -2
|
@@ -2,8 +2,10 @@ import type { MultiplayerSessionMode, PlatformHandle, PlayerIdentity } from "./p
|
|
|
2
2
|
import type { Json } from "../types";
|
|
3
3
|
import type { MultiplayerWorldCharacterCommand, MultiplayerWorldCharacterCommandResult, MultiplayerWorldCharacterCommandResultValue } from "../multiplayer";
|
|
4
4
|
import { type ServerStorage } from "./storage";
|
|
5
|
+
import { type MultiplayerHubArrival, type MultiplayerServerHub } from "./hub";
|
|
5
6
|
export type { MultiplayerSessionMode, PlatformHandle, PlatformSessionConfig, PlatformWorldCheckpoint, PlatformWorldSnapshot, PlatformWorldTimeConfig, PlayerIdentity, } from "./platformHandle";
|
|
6
|
-
export type {
|
|
7
|
+
export type { MultiplayerHubArrival, MultiplayerHubBoard, MultiplayerHubOutcome, MultiplayerHubPadUpdateInput, MultiplayerHubPadUpdateResult, MultiplayerHubPlayerResults, MultiplayerHubRecord, MultiplayerHubReportReceipt, MultiplayerHubResultInput, MultiplayerHubResultRow, MultiplayerHubResultShape, MultiplayerHubResultsRead, MultiplayerHubResultsReadInput, MultiplayerHubWearable, MultiplayerHubWearReceipt, MultiplayerServerHub, } from "./hub";
|
|
8
|
+
export type { CharacterActionNotice, CharacterGameStateOperation, CharacterGameStateResult, CharacterKnowledgeDeliveryOperation, CharacterKnowledgeDeliveryResult, CharacterKnowledgeSource, CompleteCharacterBeatInput, DeliverCharacterKnowledgeInput, RecordCharacterEventInput, SetCharacterGameStateInput, ShareCharacterClaimInput, ServerStorage, ServerStorageBoard, ServerStorageBoardScore, ServerStorageListEntry, ServerStorageListOptions, ServerStorageListPage, ServerPlaythrough, ServerPlaythroughCharacters, ServerCharacterHistoryOptions, ServerStorageScope, } from "./storage";
|
|
7
9
|
export interface MultiplayerServerPlayer extends PlayerIdentity {
|
|
8
10
|
playerId: string;
|
|
9
11
|
readonly participantId: string;
|
|
@@ -16,6 +18,12 @@ export interface MultiplayerServerSession {
|
|
|
16
18
|
readonly sessionId: string;
|
|
17
19
|
readonly deckId: string;
|
|
18
20
|
readonly mode: MultiplayerSessionMode;
|
|
21
|
+
/**
|
|
22
|
+
* The place the host started this session for (a hub door's destination, or
|
|
23
|
+
* the hub place ghost pinned the session to), or null when the host stamped
|
|
24
|
+
* none. Never set from a client.
|
|
25
|
+
*/
|
|
26
|
+
readonly place: string | null;
|
|
19
27
|
/**
|
|
20
28
|
* Deck storage that outlives the session. Nothing else here does: a session ends
|
|
21
29
|
* when its last player leaves and its memory goes with it.
|
|
@@ -23,6 +31,27 @@ export interface MultiplayerServerSession {
|
|
|
23
31
|
readonly storage: ServerStorage;
|
|
24
32
|
/** A durable checkpoint for an opted-in persistent destination. */
|
|
25
33
|
readonly world: MultiplayerServerWorld | null;
|
|
34
|
+
/**
|
|
35
|
+
* The shared characters this session can address: `session.world.characters`
|
|
36
|
+
* in a shared-character world (the same object), or a hub place's characters
|
|
37
|
+
* on one of its layers, where `session.world` stays null. Null everywhere else.
|
|
38
|
+
*/
|
|
39
|
+
readonly characters: MultiplayerServerWorldCharacters | null;
|
|
40
|
+
/**
|
|
41
|
+
* The hub place this session runs (castle.json `hub`, as ghost pinned it):
|
|
42
|
+
* results, pads and arrivals. Null for a deck without a hub block and on hosts
|
|
43
|
+
* without hub support.
|
|
44
|
+
*/
|
|
45
|
+
readonly hub: MultiplayerServerHub | null;
|
|
46
|
+
/**
|
|
47
|
+
* The variant a connected player has in the A/B experiment `name`, or null
|
|
48
|
+
* when they are in no such experiment (or have left). Castle's server
|
|
49
|
+
* resolved it and the host delivered it with the join, so it is the same arm
|
|
50
|
+
* the player's page reads and nothing a client sent.
|
|
51
|
+
*/
|
|
52
|
+
experiment(player: MultiplayerServerPlayer | string, name: string): string | null;
|
|
53
|
+
/** Every experiment a connected player is in, `{ name: variant }`. */
|
|
54
|
+
experiments(player: MultiplayerServerPlayer | string): Record<string, string>;
|
|
26
55
|
/** Sends bytes as a binary message and all other payloads as JSON. */
|
|
27
56
|
send(playerId: string, data: unknown): void;
|
|
28
57
|
/** Broadcasts bytes as a binary message and all other payloads as JSON. */
|
|
@@ -243,7 +272,8 @@ export interface MultiplayerWorldCharacterTurn {
|
|
|
243
272
|
type CallbackResult = unknown;
|
|
244
273
|
export interface MultiplayerServerCallbacks {
|
|
245
274
|
onStart?: (session: MultiplayerServerSession) => CallbackResult;
|
|
246
|
-
|
|
275
|
+
/** `arrival` is set when ghost placed the player through a hub door. */
|
|
276
|
+
onPlayerJoin?: (session: MultiplayerServerSession, player: MultiplayerServerPlayer, arrival: MultiplayerHubArrival | null) => CallbackResult;
|
|
247
277
|
onPlayerLeave?: (session: MultiplayerServerSession, player: MultiplayerServerPlayer) => CallbackResult;
|
|
248
278
|
/** Receives binary messages as Uint8Array values and JSON messages otherwise. */
|
|
249
279
|
onMessage?: (session: MultiplayerServerSession, player: MultiplayerServerPlayer, data: unknown) => CallbackResult;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isBinaryPayload, toUint8Array, } from "../multiplayerProtocol";
|
|
2
2
|
import { encodeStorageValue, storageError } from "../storageJson";
|
|
3
3
|
import { createServerStorage } from "./storage";
|
|
4
|
+
import { createServerHub, hubArrival, recordHiddenUserIds, } from "./hub";
|
|
4
5
|
// The publish bundler binds the author's default callbacks export once and
|
|
5
6
|
// exports the returned one-argument function as `__castleBootSession`.
|
|
6
7
|
export function createCastleSessionBoot(callbacks) {
|
|
@@ -10,19 +11,23 @@ export function createCastleSessionBoot(callbacks) {
|
|
|
10
11
|
}
|
|
11
12
|
async function bootSession(platformHandle, callbacks) {
|
|
12
13
|
const players = new Map();
|
|
13
|
-
const
|
|
14
|
+
const arrivals = new Map();
|
|
15
|
+
// playerId -> users a block hides from them; never on the player object.
|
|
16
|
+
const hidden = new Map();
|
|
17
|
+
// playerId -> their A/B arms while connected; never on the player object.
|
|
18
|
+
const variants = new Map();
|
|
19
|
+
const session = createAuthorSession(platformHandle, players, arrivals, hidden, variants);
|
|
14
20
|
let tickTimer = null;
|
|
15
|
-
platformHandle.on("join", async (connId, identity) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// the runtime-agnostic (connId, trusted identity) pair.
|
|
19
|
-
const player = joinedPlayer(connId, identity);
|
|
20
|
-
players.set(player.playerId, player);
|
|
21
|
-
await callbacks.onPlayerJoin?.(session, player);
|
|
21
|
+
platformHandle.on("join", async (connId, identity, handleArrival, handleVariants) => {
|
|
22
|
+
const { player, arrival } = admitPlayer({ players, arrivals, hidden, variants }, connId, identity, handleArrival, handleVariants);
|
|
23
|
+
await callbacks.onPlayerJoin?.(session, player, arrival);
|
|
22
24
|
});
|
|
23
25
|
platformHandle.on("leave", async (connId) => {
|
|
24
26
|
const player = players.get(connId);
|
|
25
27
|
players.delete(connId);
|
|
28
|
+
arrivals.delete(connId);
|
|
29
|
+
hidden.delete(connId);
|
|
30
|
+
variants.delete(connId);
|
|
26
31
|
if (player) {
|
|
27
32
|
await callbacks.onPlayerLeave?.(session, player);
|
|
28
33
|
}
|
|
@@ -203,7 +208,22 @@ async function bootSession(platformHandle, callbacks) {
|
|
|
203
208
|
}, 1_000 / platformHandle.config.tickRate);
|
|
204
209
|
}
|
|
205
210
|
}
|
|
206
|
-
function createAuthorSession(platformHandle, players) {
|
|
211
|
+
function createAuthorSession(platformHandle, players, arrivals, hidden, variants) {
|
|
212
|
+
// Lenient about what it is handed: an unknown player is in no experiment.
|
|
213
|
+
const variantsOf = (player) => variants.get(typeof player === "string"
|
|
214
|
+
? player
|
|
215
|
+
: (player?.playerId ?? ""));
|
|
216
|
+
// The pinned place counts only where the host services the hub ops.
|
|
217
|
+
const hub = createServerHub(platformHandle, arrivals, (a, b) => {
|
|
218
|
+
if (hidden.size === 0 || a === b)
|
|
219
|
+
return false;
|
|
220
|
+
const userA = players.get(a)?.userId;
|
|
221
|
+
const userB = players.get(b)?.userId;
|
|
222
|
+
if (!userA || !userB)
|
|
223
|
+
return false;
|
|
224
|
+
return Boolean(hidden.get(a)?.has(userB) || hidden.get(b)?.has(userA));
|
|
225
|
+
});
|
|
226
|
+
const world = createServerWorld(platformHandle);
|
|
207
227
|
return {
|
|
208
228
|
get players() {
|
|
209
229
|
return Array.from(players.values());
|
|
@@ -211,8 +231,20 @@ function createAuthorSession(platformHandle, players) {
|
|
|
211
231
|
sessionId: platformHandle.config.sessionId,
|
|
212
232
|
deckId: platformHandle.config.deckId,
|
|
213
233
|
mode: platformHandle.config.mode,
|
|
234
|
+
place: typeof platformHandle.config.place === "string"
|
|
235
|
+
? platformHandle.config.place
|
|
236
|
+
: hub?.place ?? null,
|
|
214
237
|
storage: createServerStorage(platformHandle),
|
|
215
|
-
world
|
|
238
|
+
world,
|
|
239
|
+
characters: world?.characters ?? createPlaceCharacters(platformHandle),
|
|
240
|
+
hub,
|
|
241
|
+
experiment(player, name) {
|
|
242
|
+
const known = variantsOf(player);
|
|
243
|
+
return known && Object.hasOwn(known, name) ? known[name] : null;
|
|
244
|
+
},
|
|
245
|
+
experiments(player) {
|
|
246
|
+
return { ...variantsOf(player) };
|
|
247
|
+
},
|
|
216
248
|
send(playerId, data) {
|
|
217
249
|
if (isBinaryPayload(data)) {
|
|
218
250
|
requireSendBinary(platformHandle);
|
|
@@ -274,6 +306,15 @@ const WORLD_CATCH_UP_DEFAULT_MAX_ELAPSED_MS = 7 * 24 * 60 * 60 * 1_000;
|
|
|
274
306
|
const SAFE_WORLD_NOTIFICATION_KEY = /^[A-Za-z0-9_-]+$/;
|
|
275
307
|
const CANONICAL_WORLD_NOTIFICATION_TIME = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d{1,3}))?Z$/;
|
|
276
308
|
const URL_IN_WORLD_NOTIFICATION_TEXT = /(?:https?:\/\/|www\.|\b[a-z0-9-]+\.(?:app|com|dev|gg|io|net|org|xyz)\b)/i;
|
|
309
|
+
// A hub place's layer has no world of its own, but the host may still broker
|
|
310
|
+
// the place's shared characters into it (`placeCharacters` in the runtime
|
|
311
|
+
// init). The character API is the world one; only the binding differs, and the
|
|
312
|
+
// host stamps that.
|
|
313
|
+
function createPlaceCharacters(platformHandle) {
|
|
314
|
+
if (platformHandle.config.placeCharacters !== true)
|
|
315
|
+
return null;
|
|
316
|
+
return createServerWorldCharacters(platformHandle);
|
|
317
|
+
}
|
|
277
318
|
function createServerWorld(platformHandle) {
|
|
278
319
|
if (!platformHandle.config.world)
|
|
279
320
|
return null;
|
|
@@ -1257,13 +1298,51 @@ function requireBroadcastBinary(platformHandle) {
|
|
|
1257
1298
|
function unsupportedBinaryRuntime() {
|
|
1258
1299
|
throw new TypeError("This Castle runtime does not support binary multiplayer messages yet.");
|
|
1259
1300
|
}
|
|
1301
|
+
// The compatibility branch accepts the current Node shim's legacy
|
|
1302
|
+
// single-argument SessionPlayer event while the public handle contract uses the
|
|
1303
|
+
// runtime-agnostic (connId, trusted identity) pair. Either form may carry the hub
|
|
1304
|
+
// arrival after the player and the player's A/B arms after that, and a hub
|
|
1305
|
+
// player's block list on the player itself.
|
|
1306
|
+
function admitPlayer(state, connId, identity, handleArrival, handleVariants) {
|
|
1307
|
+
const player = joinedPlayer(connId, identity);
|
|
1308
|
+
const arrival = hubArrival(typeof connId === "string" ? handleArrival : identity);
|
|
1309
|
+
const known = experimentVariants(typeof connId === "string" ? handleVariants : handleArrival);
|
|
1310
|
+
state.players.set(player.playerId, player);
|
|
1311
|
+
if (known) {
|
|
1312
|
+
state.variants.set(player.playerId, known);
|
|
1313
|
+
}
|
|
1314
|
+
else {
|
|
1315
|
+
state.variants.delete(player.playerId);
|
|
1316
|
+
}
|
|
1317
|
+
recordHiddenUserIds(state.hidden, player.playerId, typeof connId === "string" ? identity : connId);
|
|
1318
|
+
if (arrival) {
|
|
1319
|
+
state.arrivals.set(player.playerId, arrival);
|
|
1320
|
+
}
|
|
1321
|
+
else {
|
|
1322
|
+
state.arrivals.delete(player.playerId);
|
|
1323
|
+
}
|
|
1324
|
+
return { player, arrival };
|
|
1325
|
+
}
|
|
1326
|
+
// Absent on a host that predates experiments, and for a player who is in none.
|
|
1327
|
+
function experimentVariants(value) {
|
|
1328
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
1329
|
+
return null;
|
|
1330
|
+
const entries = Object.entries(value).filter((entry) => typeof entry[1] === "string");
|
|
1331
|
+
return entries.length > 0 ? Object.freeze(Object.fromEntries(entries)) : null;
|
|
1332
|
+
}
|
|
1260
1333
|
function joinedPlayer(connId, identity) {
|
|
1261
1334
|
if (typeof connId === "string") {
|
|
1262
|
-
|
|
1335
|
+
const player = {
|
|
1263
1336
|
...identity,
|
|
1264
1337
|
playerId: connId,
|
|
1265
1338
|
participantId: identity.scopedUserId ?? identity.userId,
|
|
1266
1339
|
};
|
|
1340
|
+
// A hub player's block list stays in the wrapper (`session.hub.hiddenPair`):
|
|
1341
|
+
// decks broadcast player objects.
|
|
1342
|
+
delete player.hiddenUserIds;
|
|
1343
|
+
// A/B arms arrive beside the player; one a host put on it stays off it too.
|
|
1344
|
+
delete player.experimentVariants;
|
|
1345
|
+
return player;
|
|
1267
1346
|
}
|
|
1268
1347
|
const legacy = connId;
|
|
1269
1348
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommandName, type CommandParams, type CommandResult, type LifecycleEvent, type VoiceEvent } from "./commands";
|
|
1
|
+
import { type CommandName, type CommandParams, type CommandResult, type HubEvent, type LifecycleEvent, type VoiceEvent } from "./commands";
|
|
2
2
|
type PostChannel = "mobile" | "web";
|
|
3
3
|
export interface HostStreamOptions {
|
|
4
4
|
onStream?: (event: unknown) => void;
|
|
@@ -21,5 +21,6 @@ export declare function hostNotify(event: LifecycleEvent): void;
|
|
|
21
21
|
export declare function postUnloadDone(unloadId: string, state?: string): void;
|
|
22
22
|
export declare function setUnloadHandler(handler: (unloadId: string) => void): void;
|
|
23
23
|
export declare function setVoiceEventHandler(handler: ((event: VoiceEvent) => void) | null): void;
|
|
24
|
+
export declare function setHubEventHandler(handler: ((event: HubEvent) => void) | null): void;
|
|
24
25
|
export declare function installHostListener(): void;
|
|
25
26
|
export {};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// A streaming command (agent.chat) gets stream envelopes on its requestId before
|
|
12
12
|
// its response. Each one goes to the caller's onStream and restarts the wait,
|
|
13
13
|
// and the caller's AbortSignal sends the host a cancel envelope.
|
|
14
|
-
import { CASTLE_SDK_PROTOCOL, COMMAND_TIMEOUTS_MS, STREAM_IDLE_TIMEOUT_MS, isResponseEnvelope, isStreamEnvelope, unloadRequestId, voiceEventFrom, } from "./commands";
|
|
14
|
+
import { CASTLE_SDK_PROTOCOL, COMMAND_TIMEOUTS_MS, STREAM_IDLE_TIMEOUT_MS, isResponseEnvelope, isStreamEnvelope, hubEventFrom, unloadRequestId, voiceEventFrom, } from "./commands";
|
|
15
15
|
import { getCastleEmbed } from "./context";
|
|
16
16
|
import { CastleError } from "./errors";
|
|
17
17
|
import { cancelLocalCommand, releaseLocalCommand, sendLocalCommand } from "./runtime";
|
|
@@ -35,6 +35,7 @@ const pending = new Map();
|
|
|
35
35
|
let listenersInstalled = false;
|
|
36
36
|
let unloadHandler = null;
|
|
37
37
|
let voiceEventHandler = null;
|
|
38
|
+
let hubEventHandler = null;
|
|
38
39
|
export async function hostRequest(command, params, stream = {}) {
|
|
39
40
|
try {
|
|
40
41
|
const env = await sendCommand(resolveChannel(), command, params, stream);
|
|
@@ -103,6 +104,12 @@ export function setVoiceEventHandler(handler) {
|
|
|
103
104
|
if (handler)
|
|
104
105
|
installHostListener();
|
|
105
106
|
}
|
|
107
|
+
// Registered by hub.ts while the deck listens for the host's Back control.
|
|
108
|
+
export function setHubEventHandler(handler) {
|
|
109
|
+
hubEventHandler = handler;
|
|
110
|
+
if (handler)
|
|
111
|
+
installHostListener();
|
|
112
|
+
}
|
|
106
113
|
function resolveChannel() {
|
|
107
114
|
if (typeof window === "undefined")
|
|
108
115
|
return "local";
|
|
@@ -233,6 +240,11 @@ function receive(message) {
|
|
|
233
240
|
voiceEventHandler?.(voiceEvent);
|
|
234
241
|
return;
|
|
235
242
|
}
|
|
243
|
+
const hubEvent = hubEventFrom(message);
|
|
244
|
+
if (hubEvent) {
|
|
245
|
+
hubEventHandler?.(hubEvent);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
236
248
|
const unloadId = unloadRequestId(message);
|
|
237
249
|
if (unloadId !== null)
|
|
238
250
|
unloadHandler?.(unloadId);
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# hub-game
|
|
2
|
+
|
|
3
|
+
A game behind a door in the Cauldron hub town. A hub game is a
|
|
4
|
+
`castle.multiplayer-3d` deck that meets the **hub contract**
|
|
5
|
+
(`docs/contract.md`, version 1): the kit draws every player as their platform
|
|
6
|
+
avatar, brings them in at the arrival together and sends them back out
|
|
7
|
+
through the door they came in by, and draws the HUD, labels and Back control
|
|
8
|
+
the game declares. The game itself is scene data plus server hooks -- **no
|
|
9
|
+
client code** (Tier 0).
|
|
10
|
+
|
|
11
|
+
Read `docs/contract.md` before changing the `hub` block or the server hooks;
|
|
12
|
+
it is what every published hub game depends on.
|
|
13
|
+
|
|
14
|
+
## Quick reference
|
|
15
|
+
|
|
16
|
+
<!-- Injected into Castle's create assistant every turn; keep this compact and factual. -->
|
|
17
|
+
|
|
18
|
+
- Scenes, blueprints, models and behaviors are `castle.physics-3d`'s, the
|
|
19
|
+
network is `castle.multiplayer-3d`'s; this kit adds the hub. Everything those
|
|
20
|
+
kits' guides say about scenes and the server holds, except where it says
|
|
21
|
+
otherwise below.
|
|
22
|
+
- **No client code.** A hub game ships nothing under `code/client/`,
|
|
23
|
+
`code/systems/`, `behaviors/`, and no `.js` outside `code/server/`. The
|
|
24
|
+
check refuses it: a hub game's content runs inside the town's iframe.
|
|
25
|
+
- **The game is `code/server/game.js`**, a default export of hooks that each
|
|
26
|
+
get `hub`, the place's context: `ready(hub)`, `arrive(hub, group)`,
|
|
27
|
+
`step(hub, dt)`, `leave(hub, playerId, { userId, username })` (a result may be
|
|
28
|
+
reported there), `shutdown(hub)` (finish writing), `message(hub, player, data)`,
|
|
29
|
+
`fall(hub, playerId)` (below the place's `fallY`; a scene with
|
|
30
|
+
`"ground": { "none": true }` has no ground and catches at -20 by default).
|
|
31
|
+
`server.main` stays `imports/castle.hub-game/code/server/index.js`.
|
|
32
|
+
- **A player's progress between visits** goes in `hub.session.storage.deck`
|
|
33
|
+
under `'<name>:<userId>'`, never user scope, which their own client can
|
|
34
|
+
write (contract §14).
|
|
35
|
+
- What `hub` does: `players()`, `actorsWith(component)` (each with its `t`,
|
|
36
|
+
`props`, `shape` and `body`), `now`, `placeAt`,
|
|
37
|
+
`hold` / `release` (keep a player still), `setHud(spec, playerId?)`,
|
|
38
|
+
`hide` / `show` (an actor, for everyone), `move(actorId, { x, y, z,
|
|
39
|
+
rotationY }, { overMs })` (a `Body` `"kinematic"` actor: platforms, sweepers,
|
|
40
|
+
gates), `tint(actorId, '#rrggbb' | null)` (a Shape actor's colour),
|
|
41
|
+
`mark(playerId, { text, color } | null)` (a coloured tag over a player's
|
|
42
|
+
avatar: a team, who is it), `wear(playerId, { kind, color, rarity } | null)`
|
|
43
|
+
(v1.4: `halo`, `aura` or `orbit` in `#rrggbb`, rarity 0-9, worn on the
|
|
44
|
+
player's avatar in every hub place once ghost keeps it), `spawn(fromActorId, at)` / `despawn(id)` (a
|
|
45
|
+
copy of a scene actor, often a hidden prototype), `pose(actorId)` /
|
|
46
|
+
`reset(actorId, at?)` (read a body; put a loose object back, at rest),
|
|
47
|
+
`tune(playerId, { speed,
|
|
48
|
+
jump } | null)` (one player's own walk, as multipliers of the preset),
|
|
49
|
+
`label(actorId, text)`, `drop(playerId?)` / `holding(playerId)` (grab, below),
|
|
50
|
+
`result(playerId, { outcome, score, stats })`, `results(playerId)` (ghost's
|
|
51
|
+
recent results and records of a player), `end(playerIds?)`,
|
|
52
|
+
`go(door, playerIds)`, `send`, `broadcast`, `session`, `sim`, `place`.
|
|
53
|
+
- **The HUD** is `{ title, big, text, timer: { since | until } }` in simulation
|
|
54
|
+
ms (`hub.now`), drawn by the hub. It is the only way the game puts words on
|
|
55
|
+
screen.
|
|
56
|
+
- **Results** are server-only, once per player per visit, checked against
|
|
57
|
+
`hub.result` in `castle.json`. No free text: the town writes the words. The
|
|
58
|
+
`outcome` may be left out when a `score` says it all (a time trial).
|
|
59
|
+
- **Players arrive at `hub.arrival.actor`**, in a row, facing
|
|
60
|
+
`hub.arrival.face`, already placed when `arrive` runs. Never move the Player
|
|
61
|
+
actor in the scene to change that -- change the arrival.
|
|
62
|
+
- **Exit is always the hub's**: the Back control, `hub.end`, or
|
|
63
|
+
`hub.maxDurationSec`. A game has no lobby and no leave button.
|
|
64
|
+
- Never ship `blueprints/other-player.scene` or restyle the Player: every
|
|
65
|
+
player is drawn as their avatar (`blueprints/avatar-<n>.scene` here).
|
|
66
|
+
- Controller: `"walk"` (the engine's `Player`) is the only preset; `hub.tune`
|
|
67
|
+
scales one player's speed and jump within it. No
|
|
68
|
+
player shove: other players are kinematic.
|
|
69
|
+
- **Grab and throw** (contract v1.3): `"grab": true` in the `hub` block (or
|
|
70
|
+
`{ throwSpeed, holdDistance, holdHeight }`) gives players a Grab / Throw
|
|
71
|
+
button for the place's `Body` `"dynamic"` actors (crates, barrels). The
|
|
72
|
+
optional hook `grab(hub, playerId, actorId, op)` hears each `'grab'` and
|
|
73
|
+
`'throw'` and refuses a grab by returning `false`; `hub.drop(playerId?)`
|
|
74
|
+
makes holders let go (a goal, a whistle), `hub.holding(playerId)` says what
|
|
75
|
+
someone holds. Never a player, one object at a time.
|
|
76
|
+
- **Idle play** (contract v1.6): `"idle": true` in the `hub` block (or
|
|
77
|
+
`{ emotes, seats, sounds: ["sounds/x.mp3"] }`) gives players an emote picker
|
|
78
|
+
(wave, dance, cheer, bow, spin, drawn on their avatar) and Sit on scene
|
|
79
|
+
actors carrying `HubSeat` (`{ face, height }`); a seat is a hold, so the
|
|
80
|
+
place's `hub.release` stands a sitter. Hooks `emote(hub, playerId, id)` and
|
|
81
|
+
`sit(hub, playerId, seatId)` may refuse with `false`; `hub.emote(playerId,
|
|
82
|
+
id)`, `hub.seat(playerId)`, and `hub.sound(actorId, file, { loop, volume,
|
|
83
|
+
radius })` / `hub.sound(actorId, null)` for a listed sound file of the deck
|
|
84
|
+
(carried in its content pack's `audio`, so a game behind a door sounds too;
|
|
85
|
+
silent only on a town whose engine predates that).
|
|
86
|
+
- **Cabinets** (contract v1.7): a `HubDoor` with `"kind": "cabinet"` whose
|
|
87
|
+
board from ghost carries `classic` is a door to a classic Castle deck the
|
|
88
|
+
host plays itself. `hub.doors()` says `classic: true` once the board is
|
|
89
|
+
read; `hub.go(doorId, [playerId])` sends that player through alone (away
|
|
90
|
+
under the hub's cover until Back). The kit sends and draws the cabinet's
|
|
91
|
+
card: by the cabinet a small chip (the best score and whose it is), and on a
|
|
92
|
+
tap the board (cover, title, top scores with photos and frames). Inert on the dev
|
|
93
|
+
serve, where there is no board.
|
|
94
|
+
- Run it like any multiplayer deck: `castle-web serve`, two tabs on the play
|
|
95
|
+
URL. Played on its own, Back and the game's end start a fresh instance.
|
|
96
|
+
- `npm run check` bundles the deck and runs this kit's contract check; it must
|
|
97
|
+
pass before `save-deck`, which runs the same check and refuses to publish.
|
|
98
|
+
|
|
99
|
+
## What is where
|
|
100
|
+
|
|
101
|
+
| file | what it is |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| `docs/contract.md` | the contract, versioned |
|
|
104
|
+
| `code/server/index.js` | the session entry: multiplayer-3d's, with the hub layer around the deck's hooks |
|
|
105
|
+
| `code/server/hub.js` | the hub layer: place, avatars, arrival, holds, HUD, visibility, labels, results, exit, doors |
|
|
106
|
+
| `code/server/actors.js` | `hub.move` and `hub.tint`: kinematic actors driven by the server, painted actors under a budget |
|
|
107
|
+
| `code/server/grab.js`, `code/client/grab.js` | grabbing and throwing (v1.3): the server's checks, hook and `hub.drop`; the client's button, hold and throw |
|
|
108
|
+
| `code/server/idle.js`, `code/client/idle.js`, `code/client/sound.js` | idle play (v1.6): emotes, seats and sounds; the server's checks, hooks and `hub.emote` / `hub.seat` / `hub.sound`; the client's picker, Sit / Stand, avatar motion and audio |
|
|
109
|
+
| `code/server/cabinets.js`, `code/client/cabinets.js` | cabinets (v1.7): the server's cards (bounded, sent per player in range inside a send budget) and the dev fixture; the client's kept cards and which one to draw |
|
|
110
|
+
| `code/server/say.js`, `code/client/say.js` | quick reactions and canned phrases (v1.11): ids only, never text; the server's checks and fan-out, the client's words, bubbles and feed |
|
|
111
|
+
| `code/client/chat.js` | free-text chat (v1.12): polls the host for what this player may read and whom they reach, sends through it; who may chat is ghost's rule, never the kit's |
|
|
112
|
+
| `code/server/party.js` | parties in a town (v1.10): invitations, a door proposed to the party, members put on its pad, `hub.coming`; a member away through a door is kept |
|
|
113
|
+
| `code/client/together.js` | finding a friend in a town (v1.9): who here is one, the People list's rows, the pointers; the server's half (`hub-where`, `hub-goto`, the `where` hook) is in `code/server/hub.js` |
|
|
114
|
+
| `code/server/manifest.js` | reads and checks the `hub` block and results (plain JS, shared with the check) |
|
|
115
|
+
| `code/server/place.js` | which place a session runs, from the session alone |
|
|
116
|
+
| `code/server/game.js` | the starter game (Flag Dash), copied into a new deck |
|
|
117
|
+
| `code/client/hookLayer.js` | the client hooks, layered under the deck's by `castle.real-time` |
|
|
118
|
+
| `code/systems/hub.js` | the door trip, Back, joining a friend's layer, the HUD, labels, hidden actors, holds, the ribbon |
|
|
119
|
+
| `code/client/chrome.js`, `state.js`, `avatar.js`, `firstJoin.js` | the DOM chrome, what the place declared, the avatar seam, the main place's first join (§13) |
|
|
120
|
+
| `blueprints/avatar-<n>.scene`, `models/avatar-<n>.pxmodel`, `scripts/gen-avatars.mjs` | the four avatars (the Castle mascot, Petal, Beat, Star) and the script that writes their models; each avatar's height is in `avatar.js`, for what is worn over it |
|
|
121
|
+
| `scripts/gen-avatars-blocky.mjs`, `gen-avatars-bean.mjs`, `gen-avatars-pixel.mjs` | the scripts that write the other three sets' models (and blocky's and pixel's drawings); each set is the Castle mascot and three characters of its own |
|
|
122
|
+
| `blueprints/<style>/avatar-<n>.scene`, `models/<style>/`, `drawings/<style>/` | the other avatar sets (`blocky`, `bean`, `pixel`): the same four avatar ids drawn another way, picked per viewer by `Avatar.style()` (the `hub_avatar_style` experiment, or `?hubStyle=` on localhost); toon unless one is assigned (contract §11) |
|
|
123
|
+
| `scripts/check.mjs` | the publish check (`onCheck`) |
|
|
124
|
+
| `scripts/pack.mjs` | the content pack exporter (`onPack`): the deck's client half as data, for another deck's engine (`docs/content-pack.md`) |
|
|
125
|
+
| `code/client/pack.js`, `packFormat.js`, `sha256.js` | mounting a pack: fetch, verify, validate, build content |
|
|
126
|
+
| `scripts/test-manifest.mjs`, `test-pack.mjs`, `test-actors.mjs`, `test-idle.mjs`, `test-classic.mjs` | tests over the manifest, results, place resolution, the pack, moved and painted actors, idle play, and cabinets |
|
|
127
|
+
|
|
128
|
+
## Rules for editing this kit
|
|
129
|
+
|
|
130
|
+
- A change to anything `docs/contract.md` describes is a contract change: an
|
|
131
|
+
optional new field is fine within v1; anything that changes what a field
|
|
132
|
+
means, or removes one, is v2 and must keep v1 decks working.
|
|
133
|
+
- The place a session runs comes from the session (`place.js`), never from a
|
|
134
|
+
client message.
|
|
135
|
+
- Hub chrome is drawn by this kit, never by game content.
|
|
136
|
+
- Root-anchor anything that reaches the deck (`/castle.json`,
|
|
137
|
+
`/code/server/game.js`), as the multiplayer kits do.
|
|
138
|
+
|
|
139
|
+
## Not offered yet
|
|
140
|
+
|
|
141
|
+
This kit's `castle.json` carries no `description` on purpose: the CLI's kit
|
|
142
|
+
catalog (`cli/src/kitCatalog.ts`) offers the create assistant only kits that
|
|
143
|
+
describe themselves, and hub games are Castle-authored only until the door
|
|
144
|
+
table and curation exist (HUB.md decision 10). `castle-web init --kit
|
|
145
|
+
hub-game` works regardless. Adding the description is the switch that offers
|
|
146
|
+
it.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Avatar 1",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "capsule",
|
|
11
|
+
"radius": 0.35,
|
|
12
|
+
"height": 1.4,
|
|
13
|
+
"color": "#7fc9b8",
|
|
14
|
+
"roughness": 0.4
|
|
15
|
+
},
|
|
16
|
+
"Body": {
|
|
17
|
+
"type": "kinematic",
|
|
18
|
+
"lockRotations": true
|
|
19
|
+
},
|
|
20
|
+
"Solid": {},
|
|
21
|
+
"Model": {
|
|
22
|
+
"file": "models/avatar-0.pxmodel",
|
|
23
|
+
"yOffset": -0.7
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Avatar 2",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "capsule",
|
|
11
|
+
"radius": 0.35,
|
|
12
|
+
"height": 1.4,
|
|
13
|
+
"color": "#7fc9b8",
|
|
14
|
+
"roughness": 0.4
|
|
15
|
+
},
|
|
16
|
+
"Body": {
|
|
17
|
+
"type": "kinematic",
|
|
18
|
+
"lockRotations": true
|
|
19
|
+
},
|
|
20
|
+
"Solid": {},
|
|
21
|
+
"Model": {
|
|
22
|
+
"file": "models/avatar-1.pxmodel",
|
|
23
|
+
"yOffset": -0.7
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Avatar 3",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "capsule",
|
|
11
|
+
"radius": 0.35,
|
|
12
|
+
"height": 1.4,
|
|
13
|
+
"color": "#7fc9b8",
|
|
14
|
+
"roughness": 0.4
|
|
15
|
+
},
|
|
16
|
+
"Body": {
|
|
17
|
+
"type": "kinematic",
|
|
18
|
+
"lockRotations": true
|
|
19
|
+
},
|
|
20
|
+
"Solid": {},
|
|
21
|
+
"Model": {
|
|
22
|
+
"file": "models/avatar-2.pxmodel",
|
|
23
|
+
"yOffset": -0.7
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Avatar 4",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "capsule",
|
|
11
|
+
"radius": 0.35,
|
|
12
|
+
"height": 1.4,
|
|
13
|
+
"color": "#7fc9b8",
|
|
14
|
+
"roughness": 0.4
|
|
15
|
+
},
|
|
16
|
+
"Body": {
|
|
17
|
+
"type": "kinematic",
|
|
18
|
+
"lockRotations": true
|
|
19
|
+
},
|
|
20
|
+
"Solid": {},
|
|
21
|
+
"Model": {
|
|
22
|
+
"file": "models/avatar-3.pxmodel",
|
|
23
|
+
"yOffset": -0.7
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Avatar 1",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "capsule",
|
|
11
|
+
"radius": 0.35,
|
|
12
|
+
"height": 1.4,
|
|
13
|
+
"color": "#7fc9b8",
|
|
14
|
+
"roughness": 0.4
|
|
15
|
+
},
|
|
16
|
+
"Body": {
|
|
17
|
+
"type": "kinematic",
|
|
18
|
+
"lockRotations": true
|
|
19
|
+
},
|
|
20
|
+
"Solid": {},
|
|
21
|
+
"Model": {
|
|
22
|
+
"file": "models/bean/avatar-0.pxmodel",
|
|
23
|
+
"yOffset": -0.7
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Avatar 2",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "capsule",
|
|
11
|
+
"radius": 0.35,
|
|
12
|
+
"height": 1.4,
|
|
13
|
+
"color": "#7fc9b8",
|
|
14
|
+
"roughness": 0.4
|
|
15
|
+
},
|
|
16
|
+
"Body": {
|
|
17
|
+
"type": "kinematic",
|
|
18
|
+
"lockRotations": true
|
|
19
|
+
},
|
|
20
|
+
"Solid": {},
|
|
21
|
+
"Model": {
|
|
22
|
+
"file": "models/bean/avatar-1.pxmodel",
|
|
23
|
+
"yOffset": -0.7
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Avatar 3",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "capsule",
|
|
11
|
+
"radius": 0.35,
|
|
12
|
+
"height": 1.4,
|
|
13
|
+
"color": "#7fc9b8",
|
|
14
|
+
"roughness": 0.4
|
|
15
|
+
},
|
|
16
|
+
"Body": {
|
|
17
|
+
"type": "kinematic",
|
|
18
|
+
"lockRotations": true
|
|
19
|
+
},
|
|
20
|
+
"Solid": {},
|
|
21
|
+
"Model": {
|
|
22
|
+
"file": "models/bean/avatar-2.pxmodel",
|
|
23
|
+
"yOffset": -0.7
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Avatar 4",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "capsule",
|
|
11
|
+
"radius": 0.35,
|
|
12
|
+
"height": 1.4,
|
|
13
|
+
"color": "#7fc9b8",
|
|
14
|
+
"roughness": 0.4
|
|
15
|
+
},
|
|
16
|
+
"Body": {
|
|
17
|
+
"type": "kinematic",
|
|
18
|
+
"lockRotations": true
|
|
19
|
+
},
|
|
20
|
+
"Solid": {},
|
|
21
|
+
"Model": {
|
|
22
|
+
"file": "models/bean/avatar-3.pxmodel",
|
|
23
|
+
"yOffset": -0.7
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|