castle-web-cli 0.4.172 → 0.4.173
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/assetCompression.d.ts +3 -0
- package/dist/assetCompression.js +30 -0
- package/dist/castleJson.d.ts +1 -1
- package/dist/castleJson.js +2 -2
- package/dist/imports.js +2 -2
- package/dist/init.js +4 -4
- package/dist/serve.js +2 -0
- package/dist/serveSecurity.d.ts +2 -0
- package/dist/serveSecurity.js +17 -3
- package/kits/multiplayer-2d/castle.json +2 -2
- package/kits/multiplayer-2d/code/server/sceneBodies.js +1 -1
- package/kits/multiplayer-2d/code/server/world.js +2 -2
- package/kits/multiplayer-2d/code/systems/multiplayer.js +12 -0
- package/kits/multiplayer-2d/fonts.generated.js +1 -1
- package/kits/multiplayer-2d/package-lock.json +1 -1
- package/kits/multiplayer-3d/CLAUDE.md +5 -4
- package/kits/multiplayer-3d/castle.json +3 -3
- package/kits/multiplayer-3d/code/client/avatars.js +47 -18
- package/kits/multiplayer-3d/code/client/nameTags.js +16 -35
- package/kits/multiplayer-3d/code/server/sceneBodies.js +1 -1
- package/kits/multiplayer-3d/code/systems/multiplayer.js +14 -1
- package/kits/multiplayer-3d/fonts.generated.js +1 -1
- package/kits/multiplayer-3d/package-lock.json +1 -1
- package/kits/physics-2d/CLAUDE.md +7 -6
- package/kits/physics-2d/behaviors/Collider.jsx +7 -1
- package/kits/physics-2d/behaviors/RigidBody.jsx +6 -3
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/editors/SceneEditor.jsx +1 -0
- package/kits/physics-2d/editors/SingleEditor.jsx +4 -4
- package/kits/physics-2d/editors/{StyleEditor.jsx → ThemeEditor.jsx} +8 -8
- package/kits/physics-2d/editors/deckFont.js +2 -2
- package/kits/physics-2d/editors/{styleEditor.module.css → themeEditor.module.css} +2 -2
- package/kits/physics-2d/engine/avatarArt.js +108 -14
- package/kits/physics-2d/engine/files.js +2 -2
- package/kits/physics-2d/engine/physics/matterBridge.js +2 -2
- package/kits/physics-2d/engine/scene.js +1 -1
- package/kits/physics-2d/fonts.generated.js +1 -1
- package/kits/physics-2d/package-lock.json +1 -1
- package/kits/physics-3d/behaviors/Body.jsx +10 -1
- package/kits/physics-3d/behaviors/Door.jsx +5 -0
- package/kits/physics-3d/behaviors/Lookable.jsx +3 -0
- package/kits/physics-3d/behaviors/Model.jsx +4 -0
- package/kits/physics-3d/behaviors/Pickup.jsx +4 -0
- package/kits/physics-3d/behaviors/Player.jsx +7 -0
- package/kits/physics-3d/behaviors/Shape.jsx +13 -0
- package/kits/physics-3d/castle.json +1 -1
- package/kits/physics-3d/engine3d/editor3dInspector.jsx +1 -0
- package/kits/physics-3d/fonts.generated.js +1 -1
- package/kits/physics-3d/package-lock.json +1 -1
- package/kits/real-time/castle.json +1 -1
- package/kits/real-time/code/client/connection.js +11 -2
- package/kits/real-time/package-lock.json +1 -1
- package/kits/turn-based/castle.json +1 -1
- package/kits/turn-based/fonts.generated.js +1 -1
- package/kits/turn-based/package-lock.json +1 -1
- package/package.json +3 -1
- /package/kits/physics-2d/editors/{styleTheme.js → theme.js} +0 -0
|
@@ -91,7 +91,16 @@ export async function connectSession({ onLog = () => {} } = {}) {
|
|
|
91
91
|
sendMove(net, pose, owned, claims, releases, state),
|
|
92
92
|
|
|
93
93
|
// Send deck-specific data. The server routes these to `code/server/game.js`.
|
|
94
|
-
send: (data) =>
|
|
94
|
+
send: (data) => {
|
|
95
|
+
if (connection.state !== 'closed') {
|
|
96
|
+
net.connection.send(data);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// Whether the session has ended under this connection: the server was
|
|
101
|
+
// replaced, the platform closed it, or `close` was called. Nothing is sent
|
|
102
|
+
// on it again; the client system joins afresh.
|
|
103
|
+
closed: () => connection.state === 'closed',
|
|
95
104
|
|
|
96
105
|
// Connection and presence data for a deck status line.
|
|
97
106
|
status: () => ({
|
|
@@ -127,7 +136,7 @@ function sendMove(net, pose, owned, claims, releases, state) {
|
|
|
127
136
|
net.releases.add(id);
|
|
128
137
|
}
|
|
129
138
|
const now = performance.now();
|
|
130
|
-
if (now - net.sentAt < SEND_MS) {
|
|
139
|
+
if (now - net.sentAt < SEND_MS || net.connection.state === 'closed') {
|
|
131
140
|
return false;
|
|
132
141
|
}
|
|
133
142
|
net.sentAt = now;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"autoUpdateWhenImported": true,
|
|
29
29
|
"deckId": "K6-Xs7dCoMVi",
|
|
30
30
|
"cardId": "Kh_08IYATpC3",
|
|
31
|
-
"publishedVersion": "2026-09-
|
|
31
|
+
"publishedVersion": "2026-09-10T22:05:30.856Z",
|
|
32
32
|
"server": {
|
|
33
33
|
"main": "code/server/index.js",
|
|
34
34
|
"maxPlayers": 8,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by the
|
|
1
|
+
// Generated by the Theme editor. Do not edit -- picking a font rewrites it.
|
|
2
2
|
//
|
|
3
3
|
// `theme.style` records that this deck's font is DMSans; this module is what
|
|
4
4
|
// puts DMSans's bytes in the published bundle. It has to name the face in a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "castle-web-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.173",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"castle-web": "./dist/index.js"
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"@xterm/headless": "^6.0.0",
|
|
42
42
|
"@xterm/xterm": "^6.0.0",
|
|
43
43
|
"codemirror": "^6.0.2",
|
|
44
|
+
"compression": "^1.8.1",
|
|
44
45
|
"html2canvas": "^1.4.1",
|
|
45
46
|
"marked": "^18.0.5",
|
|
46
47
|
"nanoid": "^5.1.7",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"ws": "^8.20.0"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
58
|
+
"@types/compression": "^1.8.1",
|
|
57
59
|
"@types/node": "^20.0.0",
|
|
58
60
|
"@types/picomatch": "^4.0.2",
|
|
59
61
|
"@types/react": "^18.3.31",
|
|
File without changes
|