world_snapshot/README.md

17 lines
691 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# world_snapshot 模块
世界状态快照模块,聚合世界(world)、场景(scene)、实体(entity)当前状态生成快照,支持查询与恢复。
## 功能
- 世界快照表 `world_snapshot` 的 CRUD
- `create_snapshot`:聚合 world/scene/entity 当前状态写入 `snapshot_json`
- `restore_snapshot`:读取并校验快照 JSON,恢复状态(基础实现:校验 + 状态标记)
- 下拉接口:世界列表、快照类型、快照状态
## 数据表
- `world_snapshot`(models/world_snapshot.json)
## 集成
- 通过 `load_world_snapshot()` 挂载到宿主应用
- 库名经 `ServerEnv().get_module_dbname('world_snapshot')` 获取,禁止硬编码