cyberia 3.2.9 → 3.2.12
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/.github/workflows/engine-cyberia.cd.yml +6 -0
- package/.github/workflows/npmpkg.ci.yml +1 -0
- package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
- package/.github/workflows/release.cd.yml +1 -0
- package/.vscode/extensions.json +9 -9
- package/.vscode/settings.json +20 -4
- package/CHANGELOG.md +213 -1
- package/CLI-HELP.md +92 -23
- package/README.md +190 -348
- package/bin/build.js +24 -8
- package/bin/build.template.js +187 -0
- package/bin/cyberia.js +229 -52
- package/bin/deploy.js +12 -2
- package/bin/index.js +229 -52
- package/bump.config.js +26 -0
- package/conf.js +130 -24
- package/deployment.yaml +4 -2
- package/hardhat/package-lock.json +113 -144
- package/hardhat/package.json +4 -3
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
- package/manifests/deployment/dd-cyberia-development/deployment.yaml +4 -2
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +4 -2
- package/manifests/kind-config-dev.yaml +8 -0
- package/manifests/lxd/lxd-admin-profile.yaml +12 -3
- package/manifests/mongodb/pv-pvc.yaml +44 -8
- package/manifests/mongodb/statefulset.yaml +55 -68
- package/manifests/mongodb-4.4/headless-service.yaml +10 -0
- package/manifests/mongodb-4.4/kustomization.yaml +3 -1
- package/manifests/mongodb-4.4/mongodb-nodeport.yaml +17 -0
- package/manifests/mongodb-4.4/pv-pvc.yaml +10 -14
- package/manifests/mongodb-4.4/statefulset.yaml +79 -0
- package/manifests/mongodb-4.4/storage-class.yaml +9 -0
- package/manifests/valkey/statefulset.yaml +1 -1
- package/manifests/valkey/valkey-nodeport.yaml +17 -0
- package/package.json +27 -15
- package/scripts/ipxe-setup.sh +52 -49
- package/scripts/k3s-node-setup.sh +81 -46
- package/scripts/lxd-vm-setup.sh +193 -8
- package/scripts/maas-nat-firewalld.sh +145 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.router.js +38 -33
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +16 -16
- package/src/api/core/core.router.js +19 -14
- package/src/api/core/core.service.js +5 -5
- package/src/api/crypto/crypto.router.js +18 -12
- package/src/api/crypto/crypto.service.js +3 -3
- package/src/api/cyberia-action/cyberia-action.model.js +1 -1
- package/src/api/cyberia-action/cyberia-action.router.js +22 -18
- package/src/api/cyberia-action/cyberia-action.service.js +5 -5
- package/src/api/cyberia-client-hints/cyberia-client-hints.controller.js +74 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.model.js +99 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.router.js +98 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.service.js +152 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.router.js +25 -20
- package/src/api/cyberia-dialogue/cyberia-dialogue.service.js +6 -6
- package/src/api/cyberia-entity/cyberia-entity.router.js +22 -18
- package/src/api/cyberia-entity/cyberia-entity.service.js +5 -5
- package/src/api/cyberia-instance/cyberia-fallback-world.js +79 -4
- package/src/api/cyberia-instance/cyberia-instance.router.js +57 -52
- package/src/api/cyberia-instance/cyberia-instance.service.js +10 -10
- package/src/api/cyberia-instance/cyberia-world-generator.js +3 -3
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +14 -48
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.router.js +22 -18
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.service.js +5 -5
- package/src/api/cyberia-map/cyberia-map.router.js +35 -30
- package/src/api/cyberia-map/cyberia-map.service.js +7 -7
- package/src/api/cyberia-quest/cyberia-quest.model.js +1 -1
- package/src/api/cyberia-quest/cyberia-quest.router.js +22 -18
- package/src/api/cyberia-quest/cyberia-quest.service.js +5 -5
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.router.js +22 -18
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.service.js +5 -5
- package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +451 -0
- package/src/api/default/default.router.js +22 -18
- package/src/api/default/default.service.js +5 -5
- package/src/api/document/document.router.js +28 -23
- package/src/api/document/document.service.js +100 -23
- package/src/api/file/file.router.js +19 -13
- package/src/api/file/file.service.js +9 -7
- package/src/api/instance/instance.router.js +29 -24
- package/src/api/instance/instance.service.js +6 -6
- package/src/api/ipfs/ipfs.router.js +21 -16
- package/src/api/ipfs/ipfs.service.js +8 -8
- package/src/api/object-layer/object-layer.router.js +512 -507
- package/src/api/object-layer/object-layer.service.js +17 -14
- package/src/api/object-layer-render-frames/object-layer-render-frames.router.js +22 -18
- package/src/api/object-layer-render-frames/object-layer-render-frames.service.js +5 -5
- package/src/api/test/test.router.js +17 -12
- package/src/api/types.js +24 -0
- package/src/api/user/guest.service.js +5 -4
- package/src/api/user/user.router.js +297 -288
- package/src/api/user/user.service.js +100 -35
- package/src/cli/baremetal.js +132 -101
- package/src/cli/cluster.js +700 -232
- package/src/cli/db.js +59 -60
- package/src/cli/deploy.js +216 -137
- package/src/cli/fs.js +13 -3
- package/src/cli/index.js +80 -15
- package/src/cli/ipfs.js +4 -6
- package/src/cli/kubectl.js +4 -1
- package/src/cli/lxd.js +1099 -223
- package/src/cli/monitor.js +9 -3
- package/src/cli/release.js +334 -140
- package/src/cli/repository.js +68 -23
- package/src/cli/run.js +193 -49
- package/src/cli/secrets.js +11 -2
- package/src/cli/test.js +9 -3
- package/src/client/Default.index.js +9 -3
- package/src/client/components/core/Auth.js +5 -0
- package/src/client/components/core/ClientEvents.js +76 -0
- package/src/client/components/core/EventBus.js +4 -0
- package/src/client/components/core/Modal.js +82 -41
- package/src/client/components/core/PanelForm.js +56 -52
- package/src/client/components/core/Worker.js +162 -363
- package/src/client/components/cyberia/MapEngineCyberia.js +1 -1
- package/src/client/components/cyberia/SharedDefaultsCyberia.js +330 -0
- package/src/client/public/cyberia-docs/ARCHITECTURE.md +50 -410
- package/src/client/public/cyberia-docs/CYBERIA-CLI.md +114 -327
- package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +200 -222
- package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +203 -185
- package/src/client/public/cyberia-docs/CYBERIA.md +259 -0
- package/src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md +2 -2
- package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
- package/src/client/public/cyberia-docs/UNDERPOST-PLATFORM.md +106 -0
- package/src/client/public/cyberia-docs/WHITE-PAPER.md +1 -1
- package/src/client/services/cyberia-client-hints/cyberia-client-hints.service.js +99 -0
- package/src/client/ssr/views/CyberiaServerMetrics.js +982 -0
- package/src/client/sw/core.sw.js +174 -112
- package/src/db/DataBaseProvider.js +115 -15
- package/src/db/mariadb/MariaDB.js +2 -1
- package/src/db/mongo/MongoBootstrap.js +657 -0
- package/src/db/mongo/MongooseDB.js +129 -21
- package/src/grpc/cyberia/grpc-server.js +25 -57
- package/src/index.js +1 -1
- package/src/runtime/cyberia-client/Dockerfile +24 -3
- package/src/runtime/cyberia-client/Dockerfile.dev +82 -0
- package/src/runtime/cyberia-server/Dockerfile +29 -4
- package/src/runtime/cyberia-server/Dockerfile.dev +71 -0
- package/src/runtime/express/Express.js +2 -2
- package/src/runtime/wp/Wp.js +8 -5
- package/src/server/auth.js +2 -2
- package/src/server/client-build-docs.js +1 -1
- package/src/server/client-build.js +94 -129
- package/src/server/conf.js +86 -83
- package/src/server/process.js +180 -19
- package/src/server/proxy.js +9 -2
- package/src/server/runtime.js +1 -1
- package/src/server/start.js +17 -5
- package/src/server/valkey.js +2 -0
- package/src/ws/IoInterface.js +16 -16
- package/src/ws/core/channels/core.ws.chat.js +11 -11
- package/src/ws/core/channels/core.ws.mailer.js +29 -29
- package/src/ws/core/channels/core.ws.stream.js +19 -19
- package/src/ws/core/core.ws.connection.js +8 -8
- package/src/ws/core/core.ws.server.js +6 -5
- package/src/ws/default/channels/default.ws.main.js +10 -10
- package/src/ws/default/default.ws.connection.js +4 -4
- package/src/ws/default/default.ws.server.js +4 -3
- package/bin/file.js +0 -202
- package/bin/vs.js +0 -74
- package/bin/zed.js +0 -84
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.defaults.js +0 -574
- package/src/client/components/cyberia-portal/CommonCyberiaPortal.js +0 -467
- package/src/client/ssr/email/DefaultRecoverEmail.js +0 -21
- package/src/client/ssr/email/DefaultVerifyEmail.js +0 -17
- package/src/client/ssr/pages/CyberiaServerMetrics.js +0 -461
- /package/src/client/ssr/{offline → views}/Maintenance.js +0 -0
- /package/src/client/ssr/{offline → views}/NoNetworkConnection.js +0 -0
- /package/src/client/ssr/{pages → views}/Test.js +0 -0
package/README.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://www.cyberiaonline.com/assets/splash/apple-touch-icon-precomposed.png" alt="CYBERIA Network Object Layer Engine"/>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
1
|
<div align="center">
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
<img src="https://www.cyberiaonline.com/assets/splash/apple-touch-icon-precomposed.png" alt="CYBERIA Network Object Layer Engine"/>
|
|
4
|
+
|
|
5
|
+
<h1>CYBERIA</h1>
|
|
8
6
|
|
|
9
7
|
**Network Object Layers**
|
|
10
8
|
|
|
@@ -13,405 +11,249 @@ _Stackable Rendering Layers as a Unified Tokenized Reality_
|
|
|
13
11
|
[](https://www.npmjs.org/package/cyberia)
|
|
14
12
|
|
|
15
13
|
</div>
|
|
14
|
+
Cyberia is an MMORPG extension built on the Underpost Platform. The platform owns the
|
|
15
|
+
toolchain, deployment surface, PWA delivery, and base infrastructure. Cyberia adds a three-service MMO
|
|
16
|
+
runtime: `engine-cyberia`, `cyberia-server`, and `cyberia-client`.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Overview
|
|
24
|
-
|
|
25
|
-
The Cyberia CLI (`cyberia`) is an extension of the **Underpost CLI** specifically for the Cyberia MMORPG ecosystem. Underpost is the end-to-end bare-metal infrastructure platform for general-purpose applications; `cyberia` extends it with tooling for the game's content pipeline, economy, and MMO engine toolchain. Unrecognized commands are transparently passed through to `underpost` for infrastructure operations.
|
|
26
|
-
|
|
27
|
-
The CLI manages:
|
|
28
|
-
|
|
29
|
-
- **Object Layer (`ol`)** — import, generate, and manage game item definitions and sprite atlases.
|
|
30
|
-
- **Instance (`instance`)** — export/import/seed game instance data (maps, entities, configs).
|
|
31
|
-
- **Chain (`chain`)** — Hyperledger Besu deployment and ERC-1155 ObjectLayerToken lifecycle.
|
|
32
|
-
- **Run-Workflow (`run-workflow`)** — execute named operational scripts (seed defaults, build manifests).
|
|
18
|
+
`engine-cyberia` is the **sidecar-backed data layer**: a Node.js sidecar that owns content,
|
|
19
|
+
validation, persistence, the gRPC/REST data services, and asset metadata. It backs the authoritative
|
|
20
|
+
Go server and the WASM client with data — it does not run the simulation or the presentation.
|
|
33
21
|
|
|
34
22
|
---
|
|
35
23
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
## Ecosystem at a glance
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
┌───────────────────────────────────────────────┐
|
|
28
|
+
│ UNDERPOST PLATFORM │
|
|
29
|
+
│ toolchain · deploy · PWA build · static │
|
|
30
|
+
│ delivery · cluster/image/db · monitoring │
|
|
31
|
+
│ │
|
|
32
|
+
│ underpost CLI ──▶ builds & deploys all │
|
|
33
|
+
└───────────────────────────────────────────────┘
|
|
34
|
+
│ hosts / delivers
|
|
35
|
+
▼
|
|
36
|
+
╔═══════════════════════════════ CYBERIA MMO ══════════════════════════════════╗
|
|
37
|
+
║ ║
|
|
38
|
+
║ ┌──────────────────┐ gRPC ┌──────────────────┐ WebSocket ║
|
|
39
|
+
║ │ engine-cyberia │ ────────▶ │ cyberia-server │ ───────────┐ ║
|
|
40
|
+
║ │ (Node.js) │ │ (Go) │ │ ║
|
|
41
|
+
║ │ │ │ │ ▼ ║
|
|
42
|
+
║ │ content │ │ authoritative │ ┌──────────────────┐ ║
|
|
43
|
+
║ │ validation │ │ simulation │ │ cyberia-client │ ║
|
|
44
|
+
║ │ persistence │ │ world tick │ │ (C / WASM) │ ║
|
|
45
|
+
║ │ gRPC/REST data │ │ AOI replication │ │ │ ║
|
|
46
|
+
║ │ asset metadata │ │ │ │ rendering │ ║
|
|
47
|
+
║ └──────────────────┘ └──────────────────┘ │ input │ ║
|
|
48
|
+
║ │ │ prediction │ ║
|
|
49
|
+
║ └──────────────── REST (content/assets) ─────▶│ presentation │ ║
|
|
50
|
+
║ └──────────────────┘ ║
|
|
51
|
+
╚═══════════════════════════════════════════════════════════════════════════════╝
|
|
52
|
+
|
|
53
|
+
One source of truth per concern:
|
|
54
|
+
content & world config ── engine-cyberia
|
|
55
|
+
real-time world state ── cyberia-server
|
|
56
|
+
presentation & input ── cyberia-client
|
|
42
57
|
```
|
|
43
58
|
|
|
44
59
|
---
|
|
45
60
|
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
Manages the Object Layer content pipeline: import PNG assets, generate procedural layers, build atlas sprite sheets, and push to IPFS/MongoDB.
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
cyberia ol [item-id] [options]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Options
|
|
55
|
-
|
|
56
|
-
| Option | Description |
|
|
57
|
-
| ------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
58
|
-
| `--import` | Import specific item-id(s) (comma-separated) from the PNG asset directory into MongoDB + IPFS |
|
|
59
|
-
| `--import-types [types]` | Batch import by type (e.g. `skin,floor`) or `all` |
|
|
60
|
-
| `--generate` | Generate procedural layers for a semantic item-id (see Semantic Registry below) |
|
|
61
|
-
| `--count <n>` | Shape element count multiplier for `--generate` (default: `3`) |
|
|
62
|
-
| `--seed <seed>` | Deterministic seed string for `--generate` (e.g. `fx-42`) |
|
|
63
|
-
| `--frame-index <n>` | Starting frame index for `--generate` (default: `0`) |
|
|
64
|
-
| `--frame-count <n>` | Number of frames to generate for `--generate` (default: `1`) |
|
|
65
|
-
| `--density <0..1>` | Shape density factor for `--generate` (default: `0.5`) |
|
|
66
|
-
| `--to-atlas-sprite-sheet [dim]` | Convert ObjectLayer frames to a consolidated atlas PNG |
|
|
67
|
-
| `--show-atlas-sprite-sheet` | Display the atlas PNG for the given item-id |
|
|
68
|
-
| `--show-frame [dir_frame]` | View a single frame (e.g. `08_0`; default: `08_0`) |
|
|
69
|
-
| `--drop` | Drop existing data before importing |
|
|
70
|
-
| `--client-public` | With `--drop`: also remove static client asset folders |
|
|
71
|
-
| `--git-clean` | With `--drop`: run clean on the cyberia asset directory |
|
|
72
|
-
| `--dev` | Force development env (uses `.env.development` for localhost IPFS) |
|
|
73
|
-
| `--env-path <path>` | Path to `.env` file (e.g. `./engine-private/conf/dd-cyberia/.env.development`) |
|
|
74
|
-
| `--mongo-host <host>` | MongoDB host override |
|
|
75
|
-
| `--storage-file-path <path>` | Storage filter JSON path override |
|
|
76
|
-
|
|
77
|
-
### Examples
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
# Import a single item from PNG source
|
|
81
|
-
cyberia ol hatchet --import --env-path ./engine-private/conf/dd-cyberia/.env.development
|
|
82
|
-
|
|
83
|
-
# Import all items of type 'skin' and 'floor'
|
|
84
|
-
cyberia ol --import-types skin,floor
|
|
85
|
-
|
|
86
|
-
# Import all types
|
|
87
|
-
cyberia ol --import-types all
|
|
88
|
-
|
|
89
|
-
# Generate a procedural floor tile (desert biome, seed fx-42)
|
|
90
|
-
cyberia ol floor-desert --generate --seed fx-42
|
|
91
|
-
|
|
92
|
-
# Generate 4 frames of a procedural floor with custom count and density
|
|
93
|
-
cyberia ol floor-grass --generate --frame-count 4 --count 5 --density 0.7
|
|
61
|
+
## 1. Toolchain and base infrastructure
|
|
94
62
|
|
|
95
|
-
|
|
96
|
-
|
|
63
|
+
Underpost Platform is the operational backbone and the source of truth for deploy IDs, runtime
|
|
64
|
+
selection, host/path layout, generated client assets, and environment resolution.
|
|
97
65
|
|
|
98
|
-
|
|
99
|
-
|
|
66
|
+
| Area | What it owns |
|
|
67
|
+
| --------------- | ------------------------------------------------------------------------------------ |
|
|
68
|
+
| Toolchain | `underpost` CLI, build, deploy, release, metadata, secrets, environment selection |
|
|
69
|
+
| Infrastructure | bare metal, LXD, Kubernetes, K3s, kubeadm, images, SSH, runners |
|
|
70
|
+
| Data operations | MongoDB, MariaDB where needed, backups, cron, monitoring |
|
|
71
|
+
| Delivery | static build, SSR views, PWA packaging, service worker generation, host/path routing |
|
|
100
72
|
|
|
101
|
-
|
|
102
|
-
cyberia
|
|
103
|
-
|
|
104
|
-
# Drop and re-import a single item
|
|
105
|
-
cyberia ol hatchet --drop --import
|
|
106
|
-
```
|
|
73
|
+
`underpost` is the shared control surface for everything infrastructural. Cyberia-specific work belongs
|
|
74
|
+
in the `cyberia` CLI, never in parallel platform commands. When a concern already exists in `underpost`,
|
|
75
|
+
reuse it instead of forking a Cyberia variant.
|
|
107
76
|
|
|
108
77
|
---
|
|
109
78
|
|
|
110
|
-
##
|
|
111
|
-
|
|
112
|
-
The `--generate` flag uses item-id prefixes to look up a procedural descriptor from the semantic registry.
|
|
113
|
-
|
|
114
|
-
### Floor Prefixes
|
|
79
|
+
## 2. PWA workflow
|
|
115
80
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
| `floor-desert` | Desert | Sandy, arid tile with warm yellow/brown palette |
|
|
119
|
-
| `floor-grass` | Grass | Meadow tile with green/earth tones |
|
|
120
|
-
| `floor-water` | Water | Ocean/lake tile with blue/teal palette |
|
|
121
|
-
| `floor-stone` | Stone | Rock/cobble tile with grey palette |
|
|
122
|
-
| `floor-lava` | Lava | Magma tile with red/orange palette |
|
|
81
|
+
Every deployed client ships as a static application shell with PWA support. The pipeline has exactly two
|
|
82
|
+
inputs:
|
|
123
83
|
|
|
124
|
-
|
|
84
|
+
- the deploy `ssr` configuration in `conf.dd-*.js` (or `conf.ssr.json`)
|
|
85
|
+
- the service worker source in `src/client/sw/core.sw.js`
|
|
125
86
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
| `skin-random` | Fully random skin tone and hair |
|
|
129
|
-
| `skin-dark` | Dark skin tones |
|
|
130
|
-
| `skin-light` | Light / pale skin tones |
|
|
131
|
-
| `skin-vivid` | Vivid / exotic hair colours (blue, red, green…) |
|
|
132
|
-
| `skin-natural` | Natural hair colours (brown, blond, grey…) |
|
|
133
|
-
| `skin-shaved` | Shaved / bald head — no hair |
|
|
87
|
+
Everything else — `index.html` pages, `sw.js`, the precache list — is **generated** during the client
|
|
88
|
+
build. Treat them as outputs only; never hand-edit them.
|
|
134
89
|
|
|
135
|
-
|
|
90
|
+
Runtime service-worker behavior:
|
|
136
91
|
|
|
137
|
-
|
|
92
|
+
| Request | Strategy |
|
|
93
|
+
| ------------- | -------------------------------- |
|
|
94
|
+
| static assets | stale-while-revalidate |
|
|
95
|
+
| API `GET` | network-first + short cache |
|
|
96
|
+
| API mutations | network-only + background replay |
|
|
97
|
+
| navigation | network-first + fallback shells |
|
|
138
98
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
| `petal` | Parabolic arc shapes — coloured petals |
|
|
142
|
-
| `stone` | Hard, angular mineral shapes |
|
|
143
|
-
| `polygon` | Crystal/geometric faceted shapes |
|
|
144
|
-
| `thread` | Thin, wispy Bézier lines |
|
|
145
|
-
|
|
146
|
-
**Biomes:** `desert`, `grass`, `water`, `stone`, `lava`
|
|
147
|
-
|
|
148
|
-
**Full matrix (20 prefixes):**
|
|
149
|
-
|
|
150
|
-
```
|
|
151
|
-
resource-desert-petal resource-grass-petal resource-water-petal
|
|
152
|
-
resource-desert-stone resource-grass-stone resource-water-stone
|
|
153
|
-
resource-desert-polygon resource-grass-polygon resource-water-polygon
|
|
154
|
-
resource-desert-thread resource-grass-thread resource-water-thread
|
|
155
|
-
|
|
156
|
-
resource-stone-petal resource-lava-petal
|
|
157
|
-
resource-stone-stone resource-lava-stone
|
|
158
|
-
resource-stone-polygon resource-lava-polygon
|
|
159
|
-
resource-stone-thread resource-lava-thread
|
|
160
|
-
```
|
|
99
|
+
Fallback selection: offline network → offline fallback view; origin/server failure → maintenance
|
|
100
|
+
fallback view. Only fallback-marked views are guaranteed precached.
|
|
161
101
|
|
|
162
102
|
---
|
|
163
103
|
|
|
164
|
-
##
|
|
165
|
-
|
|
166
|
-
Manages game instance documents (maps, entities, actions, quests, skill config) in MongoDB.
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
cyberia instance [instance-code] [options]
|
|
170
|
-
```
|
|
104
|
+
## 3. Cyberia MMO extension
|
|
171
105
|
|
|
172
|
-
###
|
|
106
|
+
### Responsibility split
|
|
173
107
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
| `--drop` | Drop all documents associated with the instance code |
|
|
180
|
-
| `--env-path <path>` | Path to `.env` file |
|
|
181
|
-
| `--mongo-host <host>` | MongoDB host override |
|
|
182
|
-
| `--dev` | Force development environment |
|
|
108
|
+
| Service | Owns | Must not own |
|
|
109
|
+
| ---------------- | ------------------------------------------------------------------------- | --------------------------------------------- |
|
|
110
|
+
| `engine-cyberia` | content, validation, persistence, gRPC/REST data services, asset metadata | authoritative simulation, render policy |
|
|
111
|
+
| `cyberia-server` | authoritative simulation, world tick, gameplay mutation, AOI replication | content authority, presentation metadata |
|
|
112
|
+
| `cyberia-client` | rendering, input, prediction, interpolation, presentation | authoritative world state, gameplay authority |
|
|
183
113
|
|
|
184
|
-
|
|
114
|
+
Two boundaries are non-negotiable:
|
|
185
115
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
cyberia instance cyberia-main --export ./backups/cyberia-main
|
|
116
|
+
- Do not move authoritative logic into the client.
|
|
117
|
+
- Do not move content-authority logic into the Go runtime.
|
|
189
118
|
|
|
190
|
-
|
|
191
|
-
cyberia instance cyberia-main --import ./backups/cyberia-main
|
|
119
|
+
### Data flow
|
|
192
120
|
|
|
193
|
-
|
|
194
|
-
cyberia
|
|
121
|
+
```text
|
|
122
|
+
engine-cyberia ──gRPC──▶ cyberia-server ──WebSocket──▶ cyberia-client
|
|
123
|
+
engine-cyberia ──REST──────────────────────────────▶ cyberia-client
|
|
195
124
|
```
|
|
196
125
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
```
|
|
210
|
-
|
|
126
|
+
### `engine-cyberia` as the sidecar-backed data layer
|
|
127
|
+
|
|
128
|
+
`engine-cyberia` is the only Cyberia service that owns content-backed data and asset metadata.
|
|
129
|
+
|
|
130
|
+
- Boot-time world configuration flows from `engine-cyberia` to `cyberia-server` over gRPC `GetFullInstance`.
|
|
131
|
+
- Client-facing assets, object layers, dialogues, and presentation hints flow from `engine-cyberia` to `cyberia-client` over REST.
|
|
132
|
+
- Simulation never migrates into the sidecar, and presentation policy never migrates out of the client.
|
|
133
|
+
|
|
134
|
+
### Runtime / health model
|
|
135
|
+
|
|
136
|
+
Three supervised processes run in parallel, each with its own monitor and reconnect loop. Gameplay is live only when all three are healthy at once.
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
140
|
+
│ SUPERVISION (parallel) │
|
|
141
|
+
│ │
|
|
142
|
+
│ engine-cyberia cyberia-server cyberia-client │
|
|
143
|
+
│ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
|
|
144
|
+
│ │ monitor │ │ monitor │ │ monitor │ │
|
|
145
|
+
│ │ +reconnect │ │ +reconnect │ │ +reconnect │ │
|
|
146
|
+
│ └─────┬──────┘ └─────┬──────┘ └─────┬──────┘ │
|
|
147
|
+
│ │ │ │ │
|
|
148
|
+
│ └──────────┬──────────┴──────────┬──────────┘ │
|
|
149
|
+
│ ▼ ▼ │
|
|
150
|
+
│ all three up & connected? │
|
|
151
|
+
└────────────────────────────┬─────────────────────────────────┘
|
|
152
|
+
│
|
|
153
|
+
┌─────────────────────┼─────────────────────┐
|
|
154
|
+
▼ ▼ ▼
|
|
155
|
+
┌───────────┐ ┌───────────┐ ┌───────────┐
|
|
156
|
+
│ HEALTHY │ │ DEGRADED │ │ STANDBY │
|
|
157
|
+
│ all 3 up │ │ ≥1 service│ │ gameplay │
|
|
158
|
+
│ gameplay │ │ reconnect-│ │ paused │
|
|
159
|
+
│ live │ │ ing / down│ │ until all │
|
|
160
|
+
│ │ │ │ │ 3 healthy │
|
|
161
|
+
└───────────┘ └───────────┘ └───────────┘
|
|
211
162
|
```
|
|
212
163
|
|
|
213
|
-
|
|
|
214
|
-
|
|
|
215
|
-
|
|
|
216
|
-
|
|
|
217
|
-
|
|
|
218
|
-
| `--epoch-length <n>` | `30000` | IBFT2 epoch length |
|
|
219
|
-
| `--besu-image <img>` | `hyperledger/besu:24.12.1` | Besu container image |
|
|
220
|
-
| `--node-port-rpc <port>` | `30545` | Kubernetes NodePort for JSON-RPC |
|
|
221
|
-
| `--node-port-ws <port>` | `30546` | Kubernetes NodePort for WebSocket |
|
|
222
|
-
| `--namespace <ns>` | `besu` | Kubernetes namespace |
|
|
223
|
-
| `--pull-image` | — | Pull Besu images before deploying |
|
|
224
|
-
| `--skip-generate` | — | Use existing `manifests/besu/` as-is |
|
|
225
|
-
| `--skip-wait` | — | Skip waiting for validators to be Running |
|
|
226
|
-
|
|
227
|
-
#### `cyberia chain remove`
|
|
228
|
-
|
|
229
|
-
Remove the Besu network from Kubernetes:
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
cyberia chain remove [--namespace besu] [--clean-keys] [--clean-manifests]
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
#### `cyberia chain generate-manifests`
|
|
236
|
-
|
|
237
|
-
Generate Kubernetes manifests without deploying:
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
cyberia chain generate-manifests [options] # same options as deploy
|
|
241
|
-
```
|
|
164
|
+
| State | Meaning |
|
|
165
|
+
| ---------- | -------------------------------------------------------------------- |
|
|
166
|
+
| `healthy` | all three Cyberia services are up and connected |
|
|
167
|
+
| `degraded` | at least one service is reconnecting or unavailable |
|
|
168
|
+
| `standby` | gameplay is paused because the full three-service set is not healthy |
|
|
242
169
|
|
|
243
170
|
---
|
|
244
171
|
|
|
245
|
-
|
|
172
|
+
## User commands
|
|
246
173
|
|
|
247
|
-
|
|
174
|
+
Use `underpost` for platform, infrastructure, build, and deploy. Use `cyberia` for MMO content and
|
|
175
|
+
extension workflows. Both share the same helpers — never duplicate config, env, or path logic.
|
|
248
176
|
|
|
249
|
-
|
|
177
|
+
### Platform (underpost)
|
|
250
178
|
|
|
251
179
|
```bash
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
#### `cyberia chain deploy-contract`
|
|
180
|
+
# Bootstrap a new app (local app serves on http://localhost:4001)
|
|
181
|
+
underpost new app-name
|
|
256
182
|
|
|
257
|
-
|
|
183
|
+
# Build the client bundle / static + PWA output
|
|
184
|
+
underpost client
|
|
185
|
+
npm run build # node bin client
|
|
258
186
|
|
|
259
|
-
|
|
260
|
-
|
|
187
|
+
# Deploy and operate
|
|
188
|
+
underpost deploy <deploy-id>
|
|
189
|
+
underpost monitor
|
|
261
190
|
```
|
|
262
191
|
|
|
263
|
-
|
|
264
|
-
| ------------------ | ---------- | ------------------------------------------------------------ |
|
|
265
|
-
| `--network <name>` | `besu-k8s` | Hardhat network name (`besu-ibft2`, `besu-qbft`, `besu-k8s`) |
|
|
192
|
+
### Cyberia (cyberia) — `bin/cyberia.js`
|
|
266
193
|
|
|
267
|
-
|
|
194
|
+
| Group | Command | Purpose |
|
|
195
|
+
| -------------- | -------------------------------------- | -------------------------------------------------------- |
|
|
196
|
+
| `ol` | `cyberia ol [item-id]` | ObjectLayer import, procedural generation, atlas/sprite |
|
|
197
|
+
| `instance` | `cyberia instance [instance-code]` | export / import / drop a Cyberia instance and its data |
|
|
198
|
+
| `client-hints` | `cyberia client-hints [instance-code]` | per-instance presentation hints (palette, camera, icons) |
|
|
199
|
+
| `chain` | `cyberia chain <sub>` | Hyperledger Besu + ERC-1155 ObjectLayerToken lifecycle |
|
|
200
|
+
| `run-workflow` | `cyberia run-workflow <name>` | named maintenance/build scripts from `scripts/` |
|
|
268
201
|
|
|
269
|
-
|
|
202
|
+
Common examples:
|
|
270
203
|
|
|
271
204
|
```bash
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
cyberia
|
|
294
|
-
cyberia
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
### Token Commands
|
|
300
|
-
|
|
301
|
-
#### `cyberia chain register`
|
|
302
|
-
|
|
303
|
-
Register a single Object Layer item on-chain:
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
cyberia chain register <item-id> [options]
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
| Option | Default | Description |
|
|
310
|
-
| ---------------------- | ---------- | ----------------------------------------------------- |
|
|
311
|
-
| `--from-db` | — | Resolve canonical IPFS CID from MongoDB (recommended) |
|
|
312
|
-
| `--metadata-cid <cid>` | `""` | Manual CID override (ignored when `--from-db` is set) |
|
|
313
|
-
| `--supply <n>` | `1` | Initial token supply (1 = NFT, >1 = semi-fungible) |
|
|
314
|
-
| `--network <name>` | `besu-k8s` | Hardhat network name |
|
|
315
|
-
| `--env-path <path>` | `./.env` | Path to `.env` file |
|
|
316
|
-
| `--mongo-host <host>` | — | MongoDB host override |
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
# Register unique NFT item (non-fungible)
|
|
320
|
-
cyberia chain register legendary-hatchet --from-db --supply 1
|
|
321
|
-
|
|
322
|
-
# Register stackable resource (semi-fungible)
|
|
323
|
-
cyberia chain register gold-ore --from-db --supply 1000000
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
#### `cyberia chain batch-register`
|
|
327
|
-
|
|
328
|
-
Register multiple items in a single batch transaction:
|
|
329
|
-
|
|
330
|
-
```bash
|
|
331
|
-
cyberia chain batch-register --from-db --items '[{"itemId":"wood","supply":500000},{"itemId":"stone","supply":500000}]'
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
#### `cyberia chain mint`
|
|
335
|
-
|
|
336
|
-
Mint additional tokens for an existing token ID:
|
|
337
|
-
|
|
338
|
-
```bash
|
|
339
|
-
cyberia chain mint --token-id 0 --to 0xABCD...1234 --amount 1000000000000000000000
|
|
340
|
-
cyberia chain mint --token-id <tokenId> --to <address> --amount <uint256>
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
#### `cyberia chain balance`
|
|
344
|
-
|
|
345
|
-
Query the token balance of an address:
|
|
346
|
-
|
|
347
|
-
```bash
|
|
348
|
-
cyberia chain balance --address 0xABCD...1234 --token-id 0
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
#### `cyberia chain transfer`
|
|
352
|
-
|
|
353
|
-
Transfer tokens between addresses:
|
|
354
|
-
|
|
355
|
-
```bash
|
|
356
|
-
cyberia chain transfer --from 0x... --to 0x... --token-id 0 --amount 1000
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
#### `cyberia chain burn`
|
|
360
|
-
|
|
361
|
-
Burn tokens from an address:
|
|
362
|
-
|
|
363
|
-
```bash
|
|
364
|
-
cyberia chain burn --token-id 0 --amount 500 --address 0x...
|
|
205
|
+
# Object layer content
|
|
206
|
+
cyberia ol hatchet,sword --import # import specific items
|
|
207
|
+
cyberia ol --import-types skin,floors # batch import by type (or: all)
|
|
208
|
+
cyberia ol floor-desert --generate --seed fx-42 # procedural generation
|
|
209
|
+
cyberia ol hatchet --to-atlas-sprite-sheet # build atlas sprite sheet
|
|
210
|
+
cyberia ol --drop --client-public # drop data + static asset folders
|
|
211
|
+
|
|
212
|
+
# Instance data
|
|
213
|
+
cyberia instance FOREST --export ./backup
|
|
214
|
+
cyberia instance FOREST --import ./backup
|
|
215
|
+
cyberia instance FOREST --drop
|
|
216
|
+
|
|
217
|
+
# Presentation hints
|
|
218
|
+
cyberia client-hints cyberia-main --seed-defaults
|
|
219
|
+
|
|
220
|
+
# Chain / token lifecycle
|
|
221
|
+
cyberia chain deploy --chain-id 777771
|
|
222
|
+
cyberia chain status
|
|
223
|
+
cyberia chain register / mint / transfer / burn / pause / unpause
|
|
224
|
+
|
|
225
|
+
# Named workflows
|
|
226
|
+
cyberia run-workflow import-default-items
|
|
227
|
+
cyberia run-workflow seed-skill-config --instance-code default
|
|
228
|
+
cyberia run-workflow seed-dialogues
|
|
229
|
+
cyberia run-workflow build-manifest
|
|
230
|
+
cyberia run-workflow build-server-dashboard
|
|
365
231
|
```
|
|
366
232
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
Query chain and contract status:
|
|
233
|
+
### Run the MMO services
|
|
370
234
|
|
|
371
235
|
```bash
|
|
372
|
-
cyberia
|
|
373
|
-
#
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
#### `cyberia chain pause` / `cyberia chain unpause`
|
|
236
|
+
# engine-cyberia (Node.js data/content services)
|
|
237
|
+
npm start # node src/server
|
|
377
238
|
|
|
378
|
-
|
|
239
|
+
# cyberia-server (Go authoritative simulation)
|
|
240
|
+
cd cyberia-server && go run main.go # dev
|
|
241
|
+
cd cyberia-server && go build -o cyberia-server . && ./cyberia-server
|
|
379
242
|
|
|
380
|
-
|
|
381
|
-
cyberia
|
|
382
|
-
cyberia
|
|
243
|
+
# cyberia-client (C / WASM presentation)
|
|
244
|
+
cd cyberia-client && make -f Web.mk clean && make -f Web.mk web
|
|
245
|
+
cd cyberia-client && make -f Web.mk serve-development # serves on :8082
|
|
383
246
|
```
|
|
384
247
|
|
|
385
248
|
---
|
|
386
249
|
|
|
387
|
-
##
|
|
388
|
-
|
|
389
|
-
Pre-built operational workflows for seeding and maintenance:
|
|
390
|
-
|
|
391
|
-
| Subcommand | Description |
|
|
392
|
-
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
393
|
-
| `import-default-items` | Import the canonical default item set (`DefaultCyberiaItems`) into MongoDB + IPFS, then seed skill config and dialogues |
|
|
394
|
-
| `seed-skill-config` | Upsert `DefaultSkillConfig` into `CyberiaInstanceConf` for the target instance |
|
|
395
|
-
| `seed-dialogues` | Upsert `DefaultCyberiaDialogues` (NPC dialogue lines) into the `cyberia-dialogue` collection |
|
|
396
|
-
| `generate-semantic-examples` | Generate procedural examples for skin prefixes (`skin-*`); floor and resource generation is available but commented out by default |
|
|
397
|
-
| `build-manifest` | Build Kubernetes Deployment + Service YAML manifests for mmo-client and mmo-server instances (kubeadm + kind variants) |
|
|
398
|
-
|
|
399
|
-
```bash
|
|
400
|
-
cyberia run-workflow import-default-items --env-path ./engine-private/conf/dd-cyberia/.env.development
|
|
401
|
-
cyberia run-workflow seed-skill-config --env-path ./engine-private/conf/dd-cyberia/.env.development
|
|
402
|
-
cyberia run-workflow build-manifest
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
---
|
|
406
|
-
|
|
407
|
-
## Environment Variables
|
|
408
|
-
|
|
409
|
-
The CLI respects the following environment variables (typically loaded from an `--env-path` file):
|
|
250
|
+
## Operational guardrails
|
|
410
251
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
252
|
+
- Prefer one source of truth for config, deploy IDs, runtime selection, startup behavior, and generated assets.
|
|
253
|
+
- Reuse existing helpers and conventions instead of creating parallel implementations.
|
|
254
|
+
- Do not duplicate parsing, env resolution, or path normalization logic across modules.
|
|
255
|
+
- Treat generated artifacts (`sw.js`, static pages, atlases, README, manifests) as outputs only.
|
|
256
|
+
- Host-level changes must be idempotent, reversible, and explicit; validate before mutating; keep
|
|
257
|
+
orchestration scripts safe to rerun.
|
|
258
|
+
- `engine-private/` is a private external dependency. Reference it only as private input; never assume
|
|
259
|
+
its contents exist locally.
|