Enforce Genarrative play-type SOP and update docs

Rewrite Genarrative play-type integration guidance across .codex and .hermes to define a platform-level SOP: default to form/image workbench, unify single-image asset slots (CreativeImageInputPanel), standardize series-material sheet->cut->transparent->OSS pipeline, and forbid copying legacy chat/agent workflows as the default. Add decision-log entry freezing the SOP and a pitfalls note warning against direct reuse of old play tools. Update CONTEXT.md and docs/README.md, add a new PRD file, and apply related small server-side changes (module-auth, spacetime-client mappers and runtime) to align back-end code with the new contracts and flows.
This commit is contained in:
2026-05-20 12:12:00 +08:00
parent f370539a6f
commit 3931442249
123 changed files with 15514 additions and 3419 deletions

View File

@@ -111,6 +111,22 @@
- 验证方式:新增玩法 PRD 必须显式声明单图资产槽位和系列素材槽位;新增工作台测试确认没有默认聊天式 Agent 输入skill 通过 `quick_validate.py` - 验证方式:新增玩法 PRD 必须显式声明单图资产槽位和系列素材槽位;新增工作台测试确认没有默认聊天式 Agent 输入skill 通过 `quick_validate.py`
- 关联文档:`docs/【玩法创作】平台入口与玩法链路-2026-05-15.md``.codex/skills/genarrative-play-type-integration/SKILL.md``.hermes/skills/genarrative-play-type-integration/SKILL.md` - 关联文档:`docs/【玩法创作】平台入口与玩法链路-2026-05-15.md``.codex/skills/genarrative-play-type-integration/SKILL.md``.hermes/skills/genarrative-play-type-integration/SKILL.md`
## 2026-05-19 系列素材 n*n 图集抽为 api-server 通用模块
- 背景:抓大鹅物品 sheet 已包含 prompt 组装、固定网格切图、绿幕 / 近白底透明化、切片 PNG 持久化和 prompt 追踪;继续留在 Match3D 私有模块会让跳一跳、后续地块 / 道具类玩法重复复制同一套算法和 OSS 元数据口径。
- 决策:`server-rs/crates/api-server/src/generated_asset_sheets.rs` 作为通用系列素材图集模块,`n` 作为必选 `grid_size` 参数;物品名称 prompt 模板与特殊设定 prompt 作为可选输入;模块负责 sheet prompt、`n*n` 切片、透明化、PNG 输出、OSS private upload 请求构造,以及 sheet / item / special prompt 的 base64 元数据持久化。玩法只负责生图 provider、计费、slot 规划、失败回写和把通用切片结果映射回自身 DTO / 草稿 / runtime 字段。
- 影响范围:`api-server` 系列素材生成、Match3D 物品五视角素材、后续新增玩法的地块 / 物品 / 障碍 / 装饰图集生成。
- 验证方式:`cargo test -p api-server generated_asset_sheets --manifest-path server-rs\Cargo.toml -- --nocapture` 覆盖通用 prompt、切片、`n` 校验和 prompt 元数据;玩法侧执行对应素材流水线定向测试。
- 关联文档:`docs/【玩法创作】平台入口与玩法链路-2026-05-15.md``docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md`
## 2026-05-19 跳一跳玩法采用正式 scoring DTO 与 public view 投影
- 背景跳一跳玩法新增后前端、shared-contracts、SpacetimeDB 生成绑定和后端 mapper 对 scoring 字段口径不一致schema guard 也要求 table / view 目录与 `migration.rs` 同步。
- 决策:跳一跳的 `JumpHopScoring` 统一采用 `chargeToDistanceRatio/maxChargeMs/hitBonus/perfectBonus`,公开广场优先使用 `jump_hop_gallery_card_view`,详情兼容投影保留 `jump_hop_gallery_view``spacetime-module` 新增的 `jump_hop_*` table 必须同步进入 `migration.rs` 和后端架构文档。
- 影响范围:`packages/shared/src/contracts/jumpHop.ts``server-rs/crates/shared-contracts/src/jump_hop.rs``server-rs/crates/spacetime-client/src/mapper/jump_hop.rs``server-rs/crates/spacetime-module/src/migration.rs``docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md`
- 验证方式:`cargo check -p shared-contracts --manifest-path server-rs/Cargo.toml``cargo check -p spacetime-client --manifest-path server-rs/Cargo.toml``cargo check -p api-server --manifest-path server-rs/Cargo.toml``npm run check:spacetime-schema`
- 关联文档:`docs/prd/【玩法创作】跳一跳俯视角玩法模板PRD-2026-05-19.md``docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md`
## 2026-05-16 公开作品列表短期由 BFF 订阅读模型缓存 ## 2026-05-16 公开作品列表短期由 BFF 订阅读模型缓存
- 背景:作品列表压测和实时性讨论中,曾考虑让浏览器前端直接订阅公开作品列表,减少 HTTP 拉取和 BFF 压力。 - 背景:作品列表压测和实时性讨论中,曾考虑让浏览器前端直接订阅公开作品列表,减少 HTTP 拉取和 BFF 压力。
@@ -644,3 +660,11 @@
- 默认阈值:每批 500 条或 1 秒 flush 一次outbox 磁盘上限 256 MiB超过后丢弃低价值 route 事件并记录指标 / 日志。 - 默认阈值:每批 500 条或 1 秒 flush 一次outbox 磁盘上限 256 MiB超过后丢弃低价值 route 事件并记录指标 / 日志。
- 影响范围:`api-server` tracking 中间件、SpacetimeDB tracking procedure、部署数据目录、OTLP 指标和运维排障。 - 影响范围:`api-server` tracking 中间件、SpacetimeDB tracking procedure、部署数据目录、OTLP 指标和运维排障。
- 验证方式:数据库不可用时公开 route 请求不失败且 outbox 文件保留;恢复后批量写入成功并删除本地 sealed 文件;关键事件仍立即影响任务 / 统计。 - 验证方式:数据库不可用时公开 route 请求不失败且 outbox 文件保留;恢复后批量写入成功并删除本地 sealed 文件;关键事件仍立即影响任务 / 统计。
## 2026-05-19 跳一跳平台公开链路采用独立玩法路由
- 背景:跳一跳玩法已接入平台入口、推荐、公开详情、试玩和运行态,后续继续扩展公开广场或推荐流时需要避免把它当成拼图兼容分支。
- 决策:跳一跳公开路由统一依赖 `sourceType='jump-hop'``JH-*` public code平台首页、推荐、公开作品列表/详情、试玩和运行态都按 `jump-hop` 独立玩法分发。后端仍是作品、运行和发布状态的业务真相,前端只做展示、交互和临时 UI 状态,不在页面层补业务规则或权限判断。
- 影响范围:平台入口、推荐流、公开详情、试玩启动、跳一跳运行态、`api-server` / SpacetimeDB 公开投影和 shared contracts。
- 验证方式:从平台推荐或公开详情进入跳一跳作品时,路由 source type 为 `jump-hop`、public code 为 `JH-*`,运行态启动消费后端返回的完整 profile / run 数据;后端 smoke 统一使用 `npm run dev:api-server` 启动并检查 `/healthz`
- 关联文档:`docs/prd/【玩法创作】跳一跳俯视角玩法模板PRD-2026-05-19.md``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md``docs/【开发运维】本地开发验证与生产运维-2026-05-15.md`

View File

@@ -22,6 +22,14 @@
- 验证:拼图入口测试仍可通过,且新组件可通过不同页面复用而不需要复制上传卡实现。 - 验证:拼图入口测试仍可通过,且新组件可通过不同页面复用而不需要复制上传卡实现。
- 关联:`src/components/common/CreativeImageInputPanel.tsx``src/components/puzzle-agent/PuzzleAgentWorkspace.tsx` - 关联:`src/components/common/CreativeImageInputPanel.tsx``src/components/puzzle-agent/PuzzleAgentWorkspace.tsx`
## 通用图片面板的展示图不能自动等于 AI 重绘参考图
- 现象:结果页关卡详情把正式关卡图传给 `CreativeImageInputPanel` 后,面板会按“有图”默认显示 AI 重绘开关,容易让用户误以为正式图也能直接作为重绘参考图。
- 原因:展示图和 AI 重绘参考图是两种不同语义;前者只是预览当前图片,后者决定是否向后端提交可编辑参考图和重绘动作。
- 处理:给通用面板补独立控制位,只有外层明确允许时才显示 AI 重绘开关;结果页关卡详情在存在独立 `pictureReference` 时才开启重绘控制UI 背景预览始终只走展示模式。
- 验证:结果页测试能区分“只有正式图”与“有独立参考图”两种情况,入口页的上传/历史图/AI 重绘行为不受影响。
- 关联:`src/components/common/CreativeImageInputPanel.tsx``src/components/puzzle-result/PuzzleResultView.tsx`
## 新增玩法不要直接复制旧玩法创作工具 ## 新增玩法不要直接复制旧玩法创作工具
- 现象:新玩法一开始就复制既有玩法的聊天式 Agent、轻输入 Agent、专属素材 DTO 或生成流程,后续在结果页、作品架和 runtime 上不断补兼容层。 - 现象:新玩法一开始就复制既有玩法的聊天式 Agent、轻输入 Agent、专属素材 DTO 或生成流程,后续在结果页、作品架和 runtime 上不断补兼容层。
@@ -115,6 +123,14 @@
- 验证:执行 `npm run check:spacetime-runtime-access``npm run check:server-rs-ddd`,涉及绑定变化时先执行 `npm run spacetime:generate``npm run check:spacetime-schema` - 验证:执行 `npm run check:spacetime-runtime-access``npm run check:server-rs-ddd`,涉及绑定变化时先执行 `npm run spacetime:generate``npm run check:spacetime-schema`
- 关联:`docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md``scripts/check-spacetime-runtime-access.mjs``server-rs/crates/spacetime-module/src/*``server-rs/crates/spacetime-client/src/mapper.rs` - 关联:`docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md``scripts/check-spacetime-runtime-access.mjs``server-rs/crates/spacetime-module/src/*``server-rs/crates/spacetime-client/src/mapper.rs`
## SpacetimeDB schema guard 还要同步 migration.rs 和表目录
- 现象:`npm run check:spacetime-schema` 报 schema 已变化,但只指出 `server-rs/crates/spacetime-module/src/migration.rs` 和后端架构文档没有同步。
- 原因:新增 table / view / row shape 后,代码生成绑定可以先通过,但 migration 白名单和文档中的机器可读表目录仍然落后schema guard 会把它判定为不完整变更。
- 处理:新增 `spacetime-module` table 时同步把表名加入 `migration.rs` 的迁移表宏和 `docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md` 的表目录;如果新增 view还要补长期订阅列表和 view 描述。
- 验证:重新运行 `npm run check:spacetime-schema` 应通过;再跑相关 `cargo check``npm run check:encoding`
- 关联:`server-rs/crates/spacetime-module/src/migration.rs``docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md``docs/README.md`
## 拼图广场列表不要每次 HTTP 请求调用 SpacetimeDB procedure ## 拼图广场列表不要每次 HTTP 请求调用 SpacetimeDB procedure
- 现象:`/api/runtime/puzzle/gallery` 每个请求都走 `spacetime-client.list_puzzle_gallery()` 调用 SpacetimeDB procedure导致 SpacetimeDB WASM 侧重复组装全量列表,客户端再映射一遍;历史实现还出现过 procedure JSON 字符串往返。 - 现象:`/api/runtime/puzzle/gallery` 每个请求都走 `spacetime-client.list_puzzle_gallery()` 调用 SpacetimeDB procedure导致 SpacetimeDB WASM 侧重复组装全量列表,客户端再映射一遍;历史实现还出现过 procedure JSON 字符串往返。
@@ -1039,3 +1055,11 @@
- 处理:打开草稿时把持久化 `generationStatus=generating` 等同于生成中 notice恢复对应玩法生成进度页恢复计时使用作品摘要 `updatedAt` 推导 `startedAtMs` - 处理:打开草稿时把持久化 `generationStatus=generating` 等同于生成中 notice恢复对应玩法生成进度页恢复计时使用作品摘要 `updatedAt` 推导 `startedAtMs`
- 验证:`npm test -- src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx -t "persisted generating"` - 验证:`npm test -- src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx -t "persisted generating"`
- 关联:`src/components/platform-entry/PlatformEntryFlowShellImpl.tsx``src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md` - 关联:`src/components/platform-entry/PlatformEntryFlowShellImpl.tsx``src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md`
## 跳一跳公开作品排障先查 sourceType 与后端运行态
- 现象:平台推荐、公开详情、试玩或运行态里跳一跳作品打不开、走错玩法、详情缺字段,或 `JH-*` 作品号搜索不到对应作品。
- 原因:跳一跳已是独立玩法链路,公开入口必须按 `sourceType='jump-hop'``JH-*` public code 分发;如果前端把它当作拼图/旧公开作品兼容分支,或在页面层自行补作品状态、权限、运行规则,就会和后端业务真相漂移。
- 处理:排查时先确认公开卡片、推荐项、详情页和试玩启动都保留 `sourceType='jump-hop'``publicCode` 使用 `JH-*`;运行态只消费后端返回的 profile / run / scoring / path 数据,前端只做展示和交互。后端 smoke 统一用 `npm run dev:api-server` 拉起,再检查 `/healthz`,不要回到旧的本地后端启动口径。
- 验证:从推荐或公开详情启动跳一跳试玩能进入跳一跳运行态;搜索 `JH-*` 能打开公开详情;`npm run dev:api-server` 启动后 `/healthz` 返回健康。
- 关联:`src/components/platform-entry/PlatformEntryFlowShellImpl.tsx``src/services/jump-hop/jumpHopClient.ts``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md``docs/【开发运维】本地开发验证与生产运维-2026-05-15.md`

View File

@@ -13,7 +13,7 @@
重点补充RPG 创作与运行时脚本职责地图见 [RPG_CREATION_AND_RUNTIME_SCRIPT_RESPONSIBILITY_MAP_2026-04-28.md](./reference/RPG_CREATION_AND_RUNTIME_SCRIPT_RESPONSIBILITY_MAP_2026-04-28.md)。 重点补充RPG 创作与运行时脚本职责地图见 [RPG_CREATION_AND_RUNTIME_SCRIPT_RESPONSIBILITY_MAP_2026-04-28.md](./reference/RPG_CREATION_AND_RUNTIME_SCRIPT_RESPONSIBILITY_MAP_2026-04-28.md)。
- [埋点查询](./tracking/README.md):埋点原始事件与聚合投影的本地 SQL 查询。 - [埋点查询](./tracking/README.md):埋点原始事件与聚合投影的本地 SQL 查询。
- [运营查询](./operations/README.md):任务、领奖、钱包对账等后台核查查询。 - [运营查询](./operations/README.md):任务、领奖、钱包对账等后台核查查询。
- [PRD](./prd/README.md):产品需求与阶段计划;参考 MOKU / 幕间类 AI 文游的陶泥儿 `text-game` 模板口径见 [AI_NATIVE_TEXT_GAME_TEMPLATE_MOKU_REFERENCE_PRD_2026-05-05.md](./prd/AI_NATIVE_TEXT_GAME_TEMPLATE_MOKU_REFERENCE_PRD_2026-05-05.md),视觉小说模板 TXT 玩法平台化接入口径见 [AI_NATIVE_VISUAL_NOVEL_TEMPLATE_PRD_2026-05-05.md](./prd/AI_NATIVE_VISUAL_NOVEL_TEMPLATE_PRD_2026-05-05.md),创意互动内容 Agent Phase 1 的 LangChain-Rust PoC、拼图闭环和并行任务拆分见 [CREATIVE_INTERACTIVE_AGENT_PHASE1_LANGCHAIN_RUST_PUZZLE_LOOP_PRD_2026-05-05.md](./prd/CREATIVE_INTERACTIVE_AGENT_PHASE1_LANGCHAIN_RUST_PUZZLE_LOOP_PRD_2026-05-05.md),幸存者类模板闭环见 [AI_NATIVE_SURVIVOR_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-05-05.md](./prd/AI_NATIVE_SURVIVOR_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-05-05.md),后台管理独立前端工程见 [ADMIN_WEB_CONSOLE_PRD_2026-04-30.md](./prd/ADMIN_WEB_CONSOLE_PRD_2026-04-30.md),新增 RPG 开场动画方案见 [AI_NATIVE_RPG_OPENING_ANIMATION_PRD_2026-04-25.md](./prd/AI_NATIVE_RPG_OPENING_ANIMATION_PRD_2026-04-25.md),新增抓大鹅 Match3D 玩法方案见 [AI_NATIVE_MATCH3D_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-04-30.md](./prd/AI_NATIVE_MATCH3D_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-04-30.md),方洞挑战创作、发布与试玩闭环见 [AI_NATIVE_SQUARE_HOLE_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-05-04.md](./prd/AI_NATIVE_SQUARE_HOLE_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-05-04.md)。 - [PRD](./prd/README.md):产品需求与阶段计划;参考 MOKU / 幕间类 AI 文游的陶泥儿 `text-game` 模板口径见 [AI_NATIVE_TEXT_GAME_TEMPLATE_MOKU_REFERENCE_PRD_2026-05-05.md](./prd/AI_NATIVE_TEXT_GAME_TEMPLATE_MOKU_REFERENCE_PRD_2026-05-05.md),视觉小说模板 TXT 玩法平台化接入口径见 [AI_NATIVE_VISUAL_NOVEL_TEMPLATE_PRD_2026-05-05.md](./prd/AI_NATIVE_VISUAL_NOVEL_TEMPLATE_PRD_2026-05-05.md),创意互动内容 Agent Phase 1 的 LangChain-Rust PoC、拼图闭环和并行任务拆分见 [CREATIVE_INTERACTIVE_AGENT_PHASE1_LANGCHAIN_RUST_PUZZLE_LOOP_PRD_2026-05-05.md](./prd/CREATIVE_INTERACTIVE_AGENT_PHASE1_LANGCHAIN_RUST_PUZZLE_LOOP_PRD_2026-05-05.md),幸存者类模板闭环见 [AI_NATIVE_SURVIVOR_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-05-05.md](./prd/AI_NATIVE_SURVIVOR_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-05-05.md),后台管理独立前端工程见 [ADMIN_WEB_CONSOLE_PRD_2026-04-30.md](./prd/ADMIN_WEB_CONSOLE_PRD_2026-04-30.md),新增 RPG 开场动画方案见 [AI_NATIVE_RPG_OPENING_ANIMATION_PRD_2026-04-25.md](./prd/AI_NATIVE_RPG_OPENING_ANIMATION_PRD_2026-04-25.md),新增抓大鹅 Match3D 玩法方案见 [AI_NATIVE_MATCH3D_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-04-30.md](./prd/AI_NATIVE_MATCH3D_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-04-30.md),方洞挑战创作、发布与试玩闭环见 [AI_NATIVE_SQUARE_HOLE_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-05-04.md](./prd/AI_NATIVE_SQUARE_HOLE_CREATOR_AND_GAMEPLAY_SYSTEM_PRD_2026-05-04.md),跳一跳俯视角玩法模板 PRD 见 [【玩法创作】跳一跳俯视角玩法模板PRD-2026-05-19.md](./prd/%E3%80%90%E7%8E%A9%E6%B3%95%E5%88%9B%E4%BD%9C%E3%80%91%E8%B7%B3%E4%B8%80%E8%B7%B3%E4%BF%AF%E8%A7%86%E8%A7%92%E7%8E%A9%E6%B3%95%E6%A8%A1%E6%9D%BFPRD-2026-05-19.md)
生产部署切换到 systemd + Nginx + SpacetimeDB 自托管的总方案见 [PRODUCTION_DEPLOYMENT_PLAN_2026-05-02.md](./technical/PRODUCTION_DEPLOYMENT_PLAN_2026-05-02.md),该文档也是当前生产 Jenkinsfile 的唯一入口。SpacetimeDB 表结构变更、自动迁移边界和保留旧数据的分阶段迁移流程见 [SPACETIMEDB_SCHEMA_CHANGE_CONSTRAINTS.md](./technical/SPACETIMEDB_SCHEMA_CHANGE_CONSTRAINTS.md)private 表迁移 JSON 导入导出、HTTP 413 分片导入和旧数据库迁移流水线经验见 [SPACETIMEDB_JSON_STRING_MIGRATION_PROCEDURE_2026-04-27.md](./technical/SPACETIMEDB_JSON_STRING_MIGRATION_PROCEDURE_2026-04-27.md) 与 [JENKINS_SPACETIMEDB_DATABASE_MIGRATION_PIPELINES_2026-04-29.md](./technical/JENKINS_SPACETIMEDB_DATABASE_MIGRATION_PIPELINES_2026-04-29.md);后台管理独立前端工程技术方案见 [ADMIN_WEB_CONSOLE_TECHNICAL_SOLUTION_2026-04-30.md](./technical/ADMIN_WEB_CONSOLE_TECHNICAL_SOLUTION_2026-04-30.md)。 生产部署切换到 systemd + Nginx + SpacetimeDB 自托管的总方案见 [PRODUCTION_DEPLOYMENT_PLAN_2026-05-02.md](./technical/PRODUCTION_DEPLOYMENT_PLAN_2026-05-02.md),该文档也是当前生产 Jenkinsfile 的唯一入口。SpacetimeDB 表结构变更、自动迁移边界和保留旧数据的分阶段迁移流程见 [SPACETIMEDB_SCHEMA_CHANGE_CONSTRAINTS.md](./technical/SPACETIMEDB_SCHEMA_CHANGE_CONSTRAINTS.md)private 表迁移 JSON 导入导出、HTTP 413 分片导入和旧数据库迁移流水线经验见 [SPACETIMEDB_JSON_STRING_MIGRATION_PROCEDURE_2026-04-27.md](./technical/SPACETIMEDB_JSON_STRING_MIGRATION_PROCEDURE_2026-04-27.md) 与 [JENKINS_SPACETIMEDB_DATABASE_MIGRATION_PIPELINES_2026-04-29.md](./technical/JENKINS_SPACETIMEDB_DATABASE_MIGRATION_PIPELINES_2026-04-29.md);后台管理独立前端工程技术方案见 [ADMIN_WEB_CONSOLE_TECHNICAL_SOLUTION_2026-04-30.md](./technical/ADMIN_WEB_CONSOLE_TECHNICAL_SOLUTION_2026-04-30.md)。

View File

@@ -0,0 +1,485 @@
# 跳一跳俯视角玩法模板 PRD 2026-05-19
## 1. 目标
新增一个可创作、可试玩、可发布的玩法模板:
```text
跳一跳
```
本模板参考拼图模板的创作闭环,沿用“创作入口 -> 生成过程页 -> 结果页 -> 试玩 -> 发布”的平台链路,但玩法本体改为俯视角 / 等距视角的跳跃闯关。
首版要求:
1. 初始草稿生成时,角色形象单独调用一次生图;
2. 初始草稿生成时,地块只调用一次生图,输出 3D 视图的 2D 图片图集;
3. 运行态不接真实 3D 网格,不生成 GLB / glTF
4. 作品可以直接进入试玩和发布。
## 2. 模板定位
模板 ID
```text
jump-hop
```
用户展示名:
```text
跳一跳
```
体验关键词:
1. 俯视角;
2. 等距感地块;
3. 单局闯关;
4. 长按蓄力,松手起跳;
5. 轻量休闲。
首版采用竖屏优先的移动端体验,桌面端保持居中展示,画面比例以 `9:16` 为主。参考图的核心视觉要点是:
1. 大面积留白或浅色渐变背景;
2. 角色站在单个地块上;
3. 地块有明显顶面、侧面和投影;
4. 整体是俯视角 / 等距视角,而不是横版平台跳跃;
5. UI 克制,只保留必要控制,不堆说明文案。
## 3. 与拼图模板的复用边界
可以复用:
1. 创作入口和模板分流;
2. 生成过程页;
3. 结果页的草稿保存、返回编辑、试玩、发布、分享链路;
4. 作品架展示和草稿恢复口径;
5. 平台统一的发布与公开展示流程。
不复用:
1. 拼图关卡切片逻辑;
2. 拼图拖拽拼块逻辑;
3. 拼图 UI 背景和多关卡编辑结构;
4. 任何方格拼合语义。
## 4. 工程接入范围
首版需要做到完整玩法闭环,不只做入口占位。
新增前端阶段:
```text
jump-hop-workspace
jump-hop-generating
jump-hop-result
jump-hop-runtime
jump-hop-gallery-detail
```
新增前端组件建议:
1. `src/components/jump-hop-creation/JumpHopWorkspace.tsx`
2. `src/components/jump-hop-result/JumpHopResultView.tsx`
3. `src/components/jump-hop-runtime/JumpHopRuntimeShell.tsx`
4. `src/services/jump-hop/jumpHopClient.ts`
新增共享契约建议:
1. `packages/shared/src/contracts/jumpHop.ts`
2. `server-rs/crates/shared-contracts/src/jump_hop.rs`
新增后端模块建议:
1. `server-rs/crates/module-jump-hop`:纯领域规则,包含路径生成、蓄力换算、落点判定、通关 / 失败状态机;
2. `server-rs/crates/api-server/src/jump_hop.rs``src/jump_hop/` 子模块HTTP handler、生成编排、资产保存和 DTO 映射;
3. `server-rs/crates/spacetime-module/src/jump_hop.rs`session、work profile、runtime run、公开 view 和 reducer / procedure
4. `server-rs/crates/spacetime-client/src/jump_hop.rs`api-server 访问 SpacetimeDB 的 facade
5. `server-rs/crates/api-server/src/modules/jump_hop.rs`:路由挂载。
入口配置事实源必须走 SpacetimeDB `creation_entry_type_config` 默认种子和后台配置接口,不新增前端硬编码入口配置。
## 5. 创作输入
创作者需要填写以下内容:
1. 作品主题描述,必填;
2. 角色形象描述,必填;
3. 地块风格卡,必选;
4. 难度,必选;
5. 可选的终点氛围或节奏偏好。
推荐的最小输入形态是:
1. 一句话主题;
2. 角色一句话描述;
3. 风格卡;
4. 难度卡。
不在首版开放手工拖拽平台编辑器。平台路径、地块间距和终点位置由系统自动生成,创作者只负责风格与难度选择。
### 5.1 地块风格卡
建议提供以下风格:
1. 极简积木;
2. 纸模玩具;
3. 霓虹玻璃;
4. 森林石块;
5. 未来金属;
6. 自定义。
### 5.2 难度
建议提供以下离散档位:
1. 轻松;
2. 标准;
3. 进阶;
4. 挑战。
难度主要影响:
1. 平台路径长度;
2. 平台间距;
3. 可落点容差;
4. 完美落点窗口;
5. 终点前的节奏变化。
## 6. 生成规则
本模板必须把生图责任拆成两条独立链路:
### 6.1 角色形象只生一次
角色形象必须只调用一次生图,输出一张可直接进入运行态的主角色图。
角色图要求:
1. 单人主角;
2. 全身可见;
3. 透明背景;
4. 角色站姿或轻微前倾姿态;
5. 镜头和透视必须匹配俯视角场景;
6. 不要求多视角,不要求多帧动画图集。
角色图生成后作为作品级锚点资产使用,结果页、封面合成、试玩和发布都复用同一张图。后续如果只修改标题、标签、难度或路径,不应默认重新生角色。只有用户在结果页明确点击“重生成角色”时,才允许再调用一次角色生图。
### 6.2 地块只生一次图集
地块必须只调用一次生图,输出一张 3D 视图的 2D 图片图集,再由后端切成运行态可用的地块资产。
地块图集要求:
1. 统一使用等距 / 俯视角;
2. 必须表现出顶面、侧面和投影;
3. 必须与角色图保持同一光向;
4. 必须有清晰的立体层次,但仍然是 2D 图片;
5. 必须包含至少以下地块类型:
- 起点地块;
- 普通地块;
- 目标地块;
- 终点地块。
建议额外包含:
1. 奖励地块;
2. 视觉强调地块;
3. 风格化变体地块。
图集生成后按地块类型切分并去掉背景,运行态直接消费切好的 PNG不在前端做复杂拼接。只有用户在结果页明确点击“重生成地块”时才允许再调用一次地块图集生图。
### 6.3 不新增第三次生成
首版不把封面、分享海报、路径预览再拆成第三次图像生成。封面和分享图必须由角色图 + 地块图集在本地或后端轻量合成,不额外增加新的角色生图次数。
### 6.4 路径元数据
除图片资产外,系统还必须生成跳跃路径元数据:
1. 平台序列;
2. 平台中心点;
3. 平台宽度;
4. 平台间距;
5. 终点索引;
6. 评分和容差参数。
路径由领域规则自动生成,创作者不直接编辑坐标。路径元数据不依赖 LLM 或图片生成。
### 6.5 推荐的难度区间
| 难度 | 平台数量 | 平台间距 | 节奏 |
| --- | ---: | --- | --- |
| 轻松 | 12 - 14 | 短 | 宽容 |
| 标准 | 16 - 18 | 中 | 稳定 |
| 进阶 | 20 - 24 | 中长 | 紧凑 |
| 挑战 | 26 - 32 | 长 | 高压 |
平台宽度和容差由系统按难度自动缩放,不要求创作者手工填写。
## 7. 契约草案
### 7.1 草稿结构
`JumpHopDraft` 至少包含:
1. `templateId = "jump-hop"`
2. `templateName = "跳一跳"`
3. `profileId`
4. `workTitle`
5. `workDescription`
6. `themeTags`
7. `difficulty`
8. `stylePreset`
9. `characterPrompt`
10. `tilePrompt`
11. `characterAsset`
12. `tileAtlasAsset`
13. `tileAssets[]`
14. `path`
15. `coverComposite`
16. `generationStatus`
### 7.2 资产结构
`JumpHopCharacterAsset` 至少包含:
1. `assetId`
2. `imageSrc`
3. `imageObjectKey`
4. `assetObjectId`
5. `generationProvider`
6. `prompt`
7. `width`
8. `height`
`JumpHopTileAsset` 至少包含:
1. `tileType`
2. `imageSrc`
3. `imageObjectKey`
4. `assetObjectId`
5. `sourceAtlasCell`
6. `visualWidth`
7. `visualHeight`
8. `topSurfaceRadius`
9. `landingRadius`
`tileType` 首版限定:
```text
start | normal | target | finish | bonus | accent
```
### 7.3 路径结构
`JumpHopPath` 至少包含:
1. `seed`
2. `difficulty`
3. `platforms[]`
4. `finishIndex`
5. `cameraPreset`
6. `scoring`
`JumpHopPlatform` 至少包含:
1. `platformId`
2. `tileType`
3. `x`
4. `y`
5. `width`
6. `height`
7. `landingRadius`
8. `perfectRadius`
9. `scoreValue`
### 7.4 运行态快照
`JumpHopRunSnapshot` 至少包含:
1. `runId`
2. `profileId`
3. `status = playing | failed | cleared`
4. `currentPlatformIndex`
5. `score`
6. `combo`
7. `lastJump`
8. `startedAtMs`
9. `finishedAtMs`
`lastJump` 至少包含:
1. `chargeMs`
2. `jumpDistance`
3. `targetPlatformIndex`
4. `landedX`
5. `landedY`
6. `result = miss | hit | perfect | finish`
## 8. API 草案
HTTP 路由建议:
```text
POST /api/creation/jump-hop/sessions
GET /api/creation/jump-hop/sessions/{sessionId}
POST /api/creation/jump-hop/sessions/{sessionId}/actions
POST /api/creation/jump-hop/works/{profileId}/publish
GET /api/runtime/jump-hop/works/{profileId}
POST /api/runtime/jump-hop/runs
POST /api/runtime/jump-hop/runs/{runId}/jump
POST /api/runtime/jump-hop/runs/{runId}/restart
GET /api/runtime/jump-hop/gallery
GET /api/runtime/jump-hop/gallery/{publicWorkCode}
```
动作类型建议:
```text
compile-draft
regenerate-character
regenerate-tiles
update-work-meta
update-difficulty
```
`compile-draft` 是长耗时动作。前端进入生成页后必须持久化 `generationStatus=generating`,刷新后能从作品架恢复生成页。失败前需要复读 session如果后端已经完成草稿并写回资产前端按成功收尾。
## 9. SpacetimeDB 表和 view
建议新增表:
1. `jump_hop_agent_session`
2. `jump_hop_work_profile`
3. `jump_hop_runtime_run`
4. `jump_hop_event`
5. `jump_hop_leaderboard_entry`,首版可暂不对外展示;
6. `jump_hop_gallery_view`
7. `jump_hop_gallery_card_view`
表结构新增字段必须按 SpacetimeDB 迁移规则放在结构体末尾并设置明确默认值。新增或调整表、reducer、procedure、view 后必须同步 `migration.rs`、表目录、生成 bindings并执行 `npm run check:spacetime-schema`
公开列表主路径应优先订阅 `jump_hop_gallery_card_view` 后在 `api-server` 本地 cache 构造列表响应,不要让每个 HTTP 请求都调用 SpacetimeDB procedure 组装全量列表。
## 10. 结果页能力
结果页必须展示:
1. 作品标题;
2. 作品简介;
3. 角色形象;
4. 地块图集;
5. 路径预览;
6. 标签;
7. 试玩;
8. 发布;
9. 返回编辑。
结果页还必须支持:
1. 单独重生成角色;
2. 单独重生成地块图集;
3. 单独修改标题和简介;
4. 单独调整标签和难度。
结果页不应强制再走一次封面生图。封面只做合成,不新增图像生成调用。
## 11. 运行态规则
运行态采用 2D 表现,但画面视觉上必须保留参考图那种俯视角 / 等距感。
### 11.1 核心玩法
1. 玩家长按蓄力;
2. 松手后角色按蓄力长度起跳;
3. 跳跃距离决定是否落到下一个地块;
4. 落在目标区域内判定成功;
5. 落在地块外或越界判定失败;
6. 到达终点地块判定通关。
### 11.2 判定规则
1. 只做一个当前局面的起跳判定;
2. 不做复杂连招动作树;
3. 不新增生命数、体力、回合数;
4. 不新增计时赛作为首版核心规则;
5. 不把前端动画结果当成最终真相,通关与失败必须能回写运行态状态。
### 11.3 角色动画
角色不需要多帧生图,运行态只通过位移、缩放、轻微旋转和投影变化表达:
1. 蓄力时轻微压缩;
2. 起跳时向上抬升;
3. 空中保持可读轮廓;
4. 落地时轻微弹性回弹;
5. 失败时从地块边缘跌落。
### 11.4 摄像机与构图
1. 相机以当前角色和下一地块为中心;
2. 至少保证下一个落点一直可见;
3. 画面要留出顶部和底部的 UI 安全区;
4. 不要把地块做得太满,保留参考图那种疏朗感。
### 11.5 UI
运行态 UI 只保留必要元素:
1. 分数;
2. 暂停;
3. 重新开始;
4. 分享;
5. 结算按钮。
不默认展示大段规则说明。首进如果需要引导,只能用一次轻量提示,不允许常驻一屏的说明文案。
## 12. 视觉规范
本模板的视觉目标是“像 3D但仍是 2D 图片”。
必须遵守:
1. 平台有明确厚度;
2. 侧面可见分层或材质变化;
3. 投影统一且方向一致;
4. 背景干净,颜色克制;
5. 角色尺寸在小屏上依然可读;
6. 地块不能出现过多文字、按钮或装饰信息;
7. 不能把运行态做成重 UI 面板。
建议的背景策略:
1. 以静态浅色渐变或纯色背景为主;
2. 不把背景也做成每次都生成的重资产;
3. 让地块和角色成为画面的第一视觉焦点。
## 13. 发布后体验
发布后的作品必须支持:
1. 进入作品架和公开展示;
2. 分享;
3. 试玩;
4. 重新进入结果页编辑。
发布后的卡片封面应优先由角色图和地块图合成,不要求单独再生成封面图。
首版不新增排行榜、回放和对局对抗。后续如要扩展排行,可另起版本,不要塞进首版模板范围。
## 14. 验收
1. 创作入口能看到 `跳一跳` 模板;
2. 创作者可以填写主题、角色描述、风格和难度;
3. 提交后只生成一次角色图和一次地块图集;
4. 结果页能看到角色图、地块图集和路径预览;
5. 结果页可单独重生成角色或地块;
6. 试玩进入跳一跳运行态;
7. 长按蓄力、松手起跳、落点判定、失败和通关都可用;
8. 作品可以保存、发布和分享;
9. 前端不直接读取或暴露生图密钥;
10. 发布后的封面不依赖第三次额外生图。
11. `npm run check:spacetime-schema` 在 schema 变更后通过;
12. `npm run check:encoding` 通过。

View File

@@ -101,7 +101,7 @@ npm run check:server-rs-ddd
- `server-rs/crates/api-server/src/match3d/handlers.rs` 承接 Axum handler负责 extract、鉴权上下文、调用 SpacetimeDB facade / 编排 helper并返回 HTTP 响应。 - `server-rs/crates/api-server/src/match3d/handlers.rs` 承接 Axum handler负责 extract、鉴权上下文、调用 SpacetimeDB facade / 编排 helper并返回 HTTP 响应。
- `server-rs/crates/api-server/src/match3d/draft.rs` 承接 Agent session、草稿编译、题材 / 难度 / 物品计划和草稿持久化编排。 - `server-rs/crates/api-server/src/match3d/draft.rs` 承接 Agent session、草稿编译、题材 / 难度 / 物品计划和草稿持久化编排。
- `server-rs/crates/api-server/src/match3d/works.rs` 承接作品 CRUD、封面 / 背景 / 容器资产生成入口、发布 / Remix / 点赞 / 游玩记录和作品级 helper。 - `server-rs/crates/api-server/src/match3d/works.rs` 承接作品 CRUD、封面 / 背景 / 容器资产生成入口、发布 / Remix / 点赞 / 游玩记录和作品级 helper。
- `server-rs/crates/api-server/src/match3d/item_assets.rs` 承接物品 sheet 生成、绿幕 / 近白底透明化、切图、append / replace / delete / sort / merge 和素材持久化 - `server-rs/crates/api-server/src/match3d/item_assets.rs` 承接物品生成批次编排、append / replace / delete / sort / merge、计费外层和草稿素材映射sheet prompt、绿幕 / 近白底透明化、切图和切片持久化复用 `generated_asset_sheets` 通用模块
- `server-rs/crates/api-server/src/match3d/vector_engine_gemini.rs` 承接 VectorEngine Gemini 请求体、响应解析、base64 图片下载和上游错误归一。 - `server-rs/crates/api-server/src/match3d/vector_engine_gemini.rs` 承接 VectorEngine Gemini 请求体、响应解析、base64 图片下载和上游错误归一。
- `server-rs/crates/api-server/src/match3d/runtime.rs` 保留运行态轻量归一 helper`mappers.rs` / `tags.rs` / `tests.rs` 分别承接 DTO 映射、标签 / 通用错误 helper 和原有单测。 - `server-rs/crates/api-server/src/match3d/runtime.rs` 保留运行态轻量归一 helper`mappers.rs` / `tags.rs` / `tests.rs` 分别承接 DTO 映射、标签 / 通用错误 helper 和原有单测。
@@ -114,6 +114,7 @@ npm run check:server-rs-ddd
3. Adapter 输出应保留 legacy public path、object key、asset object id、MIME、extension、task id 和实际 prompt。 3. Adapter 输出应保留 legacy public path、object key、asset object id、MIME、extension、task id 和实际 prompt。
4. Adapter 不负责扣费、退款或钱包读取;计费仍由调用方显式包裹。 4. Adapter 不负责扣费、退款或钱包读取;计费仍由调用方显式包裹。
5. Puzzle、Match3D、音频、GLB、视频等复杂媒体可以复用 OSS + asset object + binding 的底层持久化能力,但玩法专属处理规则留在各自编排层,不塞进公共接口。 5. Puzzle、Match3D、音频、GLB、视频等复杂媒体可以复用 OSS + asset object + binding 的底层持久化能力,但玩法专属处理规则留在各自编排层,不塞进公共接口。
6. 系列素材图集使用 `server-rs/crates/api-server/src/generated_asset_sheets.rs`:调用方必须传入 `grid_size` 作为 `n*n``n`,可选传入物品名称 prompt 模板和特殊设定 prompt模块负责 sheet prompt 组装、按 `n*n` 切片、透明化、PNG 输出、OSS private upload 请求构造和 sheet / item / special prompt 元数据持久化。玩法只负责规划 slot、调用具体生图 provider、计费、失败回写以及把通用切片结果映射回自己的 DTO / 草稿 / runtime 字段。
## SpacetimeDB schema 变更规则 ## SpacetimeDB schema 变更规则
@@ -151,7 +152,7 @@ npm run check:server-rs-ddd
- LLM`GENARRATIVE_LLM_*`,创意 Agent 另用 `APIMART_BASE_URL` / `APIMART_API_KEY` - LLM`GENARRATIVE_LLM_*`,创意 Agent 另用 `APIMART_BASE_URL` / `APIMART_API_KEY`
- 图片生成VectorEngine / APIMart / DashScope密钥只在后端环境变量中。 - 图片生成VectorEngine / APIMart / DashScope密钥只在后端环境变量中。
- Match3D 物品 sheetVectorEngine Gemini `gemini-3-pro-image-preview` 原生 `generateContent` - Match3D 物品 sheetVectorEngine Gemini `gemini-3-pro-image-preview` 原生 `generateContent`;图集 prompt、切图、透明化和切片持久化走 `generated_asset_sheets` 通用模块Match3D 只补题材 / 风格 / 五视角设定和字段映射
- Match3D 封面和 9:16 纯背景VectorEngine `/v1/images/generations` - Match3D 封面和 9:16 纯背景VectorEngine `/v1/images/generations`
- Match3D 1:1 容器 UIVectorEngine `/v1/images/edits` multipart 参考图。 - Match3D 1:1 容器 UIVectorEngine `/v1/images/edits` multipart 参考图。
- Hyper3D / Rodin只保留后端安全代理和旧数据兼容新 Match3D 草稿和批量新增不再生成 GLB。 - Hyper3D / Rodin只保留后端安全代理和旧数据兼容新 Match3D 草稿和批量新增不再生成 GLB。
@@ -361,6 +362,40 @@ npm run check:server-rs-ddd
- Rust 结构体:`InventorySlot` - Rust 结构体:`InventorySlot`
- 源码:`server-rs/crates/spacetime-module/src/gameplay.rs` - 源码:`server-rs/crates/spacetime-module/src/gameplay.rs`
### `jump_hop_agent_session`
- Rust 结构体:`JumpHopAgentSessionRow`
- 源码:`server-rs/crates/spacetime-module/src/jump_hop/tables.rs`
### `jump_hop_event`
- Rust 结构体:`JumpHopEventRow`
- 源码:`server-rs/crates/spacetime-module/src/jump_hop/tables.rs`
### `jump_hop_runtime_run`
- Rust 结构体:`JumpHopRuntimeRunRow`
- 源码:`server-rs/crates/spacetime-module/src/jump_hop/tables.rs`
### `jump_hop_work_profile`
- Rust 结构体:`JumpHopWorkProfileRow`
- 源码:`server-rs/crates/spacetime-module/src/jump_hop/tables.rs`
### SpacetimeDB view`jump_hop_gallery_card_view`
- Rust view`jump_hop_gallery_card_view`
- 返回类型:`Vec<JumpHopGalleryCardViewRow>`
- 源码:`server-rs/crates/spacetime-module/src/jump_hop.rs`
- 说明:跳一跳公开广场列表卡片投影,只暴露 `publication_status = Published` 的作品卡片字段;`api-server``spacetime-client` 长期订阅 `SELECT * FROM jump_hop_gallery_card_view` 后,从本地 cache 构造跳一跳公开列表响应。个人作品列表、详情、发布和运行态仍按 procedure 路径处理。
### SpacetimeDB view`jump_hop_gallery_view`
- Rust view`jump_hop_gallery_view`
- 返回类型:`Vec<JumpHopGalleryViewRow>`
- 源码:`server-rs/crates/spacetime-module/src/jump_hop.rs`
- 说明:跳一跳公开详情兼容投影,包含作品、路径和素材字段;公开列表主路径优先使用 `jump_hop_gallery_card_view`
### `match3d_agent_message` ### `match3d_agent_message`
- Rust 结构体:`Match3DAgentMessageRow` - Rust 结构体:`Match3DAgentMessageRow`
@@ -545,6 +580,7 @@ npm run check:server-rs-ddd
- `SELECT * FROM square_hole_gallery_view` - `SELECT * FROM square_hole_gallery_view`
- `SELECT * FROM visual_novel_gallery_view` - `SELECT * FROM visual_novel_gallery_view`
- `SELECT * FROM big_fish_gallery_view` - `SELECT * FROM big_fish_gallery_view`
- `SELECT * FROM jump_hop_gallery_card_view`
下列订阅用于统计或配置缓存,订阅失败不会让公开列表连接整体不可用,调用方保留兼容兜底: 下列订阅用于统计或配置缓存,订阅失败不会让公开列表连接整体不可用,调用方保留兼容兜底:

View File

@@ -40,10 +40,10 @@ npm run dev:web
单独启动 Rust API server 单独启动 Rust API server
```bash ```bash
npm run api-server npm run dev:api-server
``` ```
后端日志默认写入 `logs/api-server/`。后端 API smoke 使用 `npm run api-server` 并检查 `/healthz`;不要使用旧 `api-server:maincloud` 或任何 `GENARRATIVE_SPACETIME_MAINCLOUD_*` 口径。 后端日志默认写入 `logs/api-server/`。后端 API smoke 使用 `npm run dev:api-server` 并检查 `/healthz`;不要使用旧 `api-server:maincloud` 或任何 `GENARRATIVE_SPACETIME_MAINCLOUD_*` 口径。
查看本地 Rust / SpacetimeDB 日志: 查看本地 Rust / SpacetimeDB 日志:
@@ -103,7 +103,7 @@ npm run spacetime:generate
- `cargo check -p spacetime-client --manifest-path server-rs/Cargo.toml` - `cargo check -p spacetime-client --manifest-path server-rs/Cargo.toml`
- `cargo check -p spacetime-module --manifest-path server-rs/Cargo.toml` - `cargo check -p spacetime-module --manifest-path server-rs/Cargo.toml`
- `npm run check:server-rs-ddd` - `npm run check:server-rs-ddd`
- `npm run api-server` 后请求 `/healthz` - `npm run dev:api-server` 后请求 `/healthz`
涉及 SpacetimeDB schema 时必须补: 涉及 SpacetimeDB schema 时必须补:

View File

@@ -10,6 +10,20 @@
`PlatformEntryFlowShellImpl.tsx` 仍是平台入口编排壳,后续维护时应优先把独立 UI 片段、公开作品映射、草稿生成 notice 和运行态状态 helper 拆到 `src/components/platform-entry/PlatformEntryFlowShellImpl/` 或同目录紧邻 helper 文件。拆分只允许改变文件组织不改变入口配置事实源、默认导出、props、页面阶段、UI 文案或现有交互;其中拼图首访 onboarding 已拆为 `PlatformEntryFlowShellImpl/PuzzleOnboardingView.tsx` `PlatformEntryFlowShellImpl.tsx` 仍是平台入口编排壳,后续维护时应优先把独立 UI 片段、公开作品映射、草稿生成 notice 和运行态状态 helper 拆到 `src/components/platform-entry/PlatformEntryFlowShellImpl/` 或同目录紧邻 helper 文件。拆分只允许改变文件组织不改变入口配置事实源、默认导出、props、页面阶段、UI 文案或现有交互;其中拼图首访 onboarding 已拆为 `PlatformEntryFlowShellImpl/PuzzleOnboardingView.tsx`
## 新增玩法创作工具平台 SOP
新增玩法默认采用表单/图片输入创作工作台,链路为:
```text
创作入口 -> 工作台 -> 生成页 -> 结果页 -> 试玩 -> 发布 -> 运行态
```
默认工作台只提交结构化表单、图片槽位和配置 payload不默认增加聊天输入区、流式消息区或轻输入 Agent。确需偏离该模式时必须先在 PRD 和本文档写明例外原因、影响范围和回退方式,再进入编码。
单图资产编辑统一通过 `CreativeImageInputPanel` 承载上传、AI 重绘、参考图、历史图和删除确认;新玩法页面不得重复手写这些交互。系列素材图集生成统一走“批量规划 -> sheet 生图 -> 后端切图 -> 透明化 -> OSS 持久化 -> 状态回写 -> 局部重生成”流程,玩法只提供 `sheetSpec``slotSpecs`、提示词和字段映射,不把任一玩法专属素材 DTO 当作平台通用模型。
`api-server``generated_asset_sheets` 是当前通用系列素材图集模块:`n` 是必选参数,模块负责组装 `n*n` sheet prompt、按 `n*n` 切片、绿幕 / 近白底透明化、导出 PNG 和 OSS 持久化请求。物品名称 prompt 和特殊设定 prompt 是可选输入;调用方可传入类似“每个物品生成五个不同视图”的视角约束,通用模块会把 sheet prompt、物品行 prompt、特殊设定 prompt 编码写入 OSS 元数据。玩法仍负责计费、物品规划、slot 映射、失败回写和把通用切片结果映射回自己的草稿 / profile / runtime 字段。
## 草稿与作品架 ## 草稿与作品架
1. 草稿页作品卡对齐发现页列表卡风格:左侧信息,右侧封面图,移动端单列,桌面两到三列。 1. 草稿页作品卡对齐发现页列表卡风格:左侧信息,右侧封面图,移动端单列,桌面两到三列。
@@ -31,6 +45,7 @@
当前口径: 当前口径:
- 图像输入复用 `CreativeImageInputPanel` - 图像输入复用 `CreativeImageInputPanel`
- 结果页每关画面编辑和素材配置里的 UI 背景生成也复用 `CreativeImageInputPanel`;三处只共享受控 UI 模块不共享数据源、状态、action 或存储位置:入口页继续写 `formDraft` 与草稿编译 payload关卡画面写 `levels[].pictureReference/pictureDescription` 并触发 `generate_puzzle_images`UI 背景写 `levels[0].uiBackgroundPrompt/uiBackgroundImage*` 并触发 `generate_puzzle_ui_background`。通用图片面板的展示图和 AI 重绘参考图能力必须分开控制:结果页正式关卡图只作为预览图,不因存在 `displayImageSrc` 自动暴露 AI 重绘开关;只有本地上传、历史选择或已保存 `pictureReference` 可作为重绘参考图时,才显示 AI 重绘开关并把状态带入 `generate_puzzle_images`
- 支持画面描述生图、多参考图生图、上传或历史生成主图后 AI 重绘、上传或历史生成主图后不重绘;关闭 AI 重绘时,前端可提交本地上传 Data URL 或历史 `/generated-*` 图片路径,后端统一解析为首关正式图后再持久化。 - 支持画面描述生图、多参考图生图、上传或历史生成主图后 AI 重绘、上传或历史生成主图后不重绘;关闭 AI 重绘时,前端可提交本地上传 Data URL 或历史 `/generated-*` 图片路径,后端统一解析为首关正式图后再持久化。
- 草稿生成会先持久化 `generationStatus=generating` 的作品摘要生成完成并回写关卡图、UI 背景后再变为 `ready`;首关关卡图和 UI 背景在命名稳定后并行启动,当前不自动生成背景音乐。 - 草稿生成会先持久化 `generationStatus=generating` 的作品摘要生成完成并回写关卡图、UI 背景后再变为 `ready`;首关关卡图和 UI 背景在命名稳定后并行启动,当前不自动生成背景音乐。
- 作品架拼图草稿的“生成中”遮罩只表示初始草稿还没有可查看结果;只要作品摘要、首关封面或任一关卡候选图已经可用,后续 UI 背景重生成和追加关卡生图都必须作为结果页局部生成态处理,不能阻止打开草稿结果页。 - 作品架拼图草稿的“生成中”遮罩只表示初始草稿还没有可查看结果;只要作品摘要、首关封面或任一关卡候选图已经可用,后续 UI 背景重生成和追加关卡生图都必须作为结果页局部生成态处理,不能阻止打开草稿结果页。
@@ -50,6 +65,28 @@
- 推荐页里的拼图作品如果从运行态进入“改造”结果页,返回平台后要清掉推荐嵌入态的 `activeRecommendEntryKey` / `activeRecommendRuntimeKind` / `isStartingRecommendEntry`,再重新按推荐页自动启动逻辑进入作品,不能复用已经被清空的旧 `puzzleRun` - 推荐页里的拼图作品如果从运行态进入“改造”结果页,返回平台后要清掉推荐嵌入态的 `activeRecommendEntryKey` / `activeRecommendRuntimeKind` / `isStartingRecommendEntry`,再重新按推荐页自动启动逻辑进入作品,不能复用已经被清空的旧 `puzzleRun`
- 拼图运行态允许前端低延迟交互表现,但通关、排行榜、奖励和作品状态仍以后端确认为准。 - 拼图运行态允许前端低延迟交互表现,但通关、排行榜、奖励和作品状态仍以后端确认为准。
## 跳一跳
对外名称:`跳一跳`。工程域:`jump-hop`。PRD 见 `docs/prd/【玩法创作】跳一跳俯视角玩法模板PRD-2026-05-19.md`
首版定位为俯视角 / 等距视角 2D 休闲跳跃模板,链路对齐拼图的创作闭环:
```text
创作入口 -> 模板输入 -> 生成过程页 -> 结果页 -> 试玩 -> 发布 -> 运行态
```
素材生成规则固定为:
1. 初始草稿生成时,角色形象单独调用一次生图;
2. 初始草稿生成时,地块单独调用一次生图,输出 3D 视图的 2D 图片图集;
3. 地块图集由后端切分为起点、普通、目标、终点等透明 PNG
4. 封面和分享图由角色图与地块图轻量合成,不再额外调用第三次生图;
5. 显式重生成角色或地块时,只重生成对应资产槽位。
运行态规则真相必须沉到 `module-jump-hop`前端只做蓄力表现、角色位移、投影和落地反馈。通关、失败、分数、combo、运行态快照和发布作品状态以后端为准。公开列表应走 `jump_hop_gallery_card_view` 订阅缓存,不要每次 HTTP 请求调用 procedure 组装全量列表。
平台首页推荐、精选、最新、公开详情、搜索、已玩作品和公开试玩统一按 `sourceType='jump-hop'``JH-*` 公开作品号识别跳一跳作品;从公开详情或推荐流启动运行态时,若卡片摘要不足以携带角色图、地块图集和路径配置,必须先补读完整 work profile 再传入运行态。
## 抓大鹅 Match3D ## 抓大鹅 Match3D
对外名称:`抓大鹅`。工程域:`match3d` 对外名称:`抓大鹅`。工程域:`match3d`
@@ -75,12 +112,13 @@
2. 先写入可恢复草稿 profile再执行文本计划、图片生成、切图、OSS 上传、背景和容器生成;作品摘要在素材或背景未完整时下发 `generationStatus=generating`,素材和背景完整后下发 `ready`,草稿完成条件不包含 `backgroundMusic` 2. 先写入可恢复草稿 profile再执行文本计划、图片生成、切图、OSS 上传、背景和容器生成;作品摘要在素材或背景未完整时下发 `generationStatus=generating`,素材和背景完整后下发 `ready`,草稿完成条件不包含 `backgroundMusic`
3. 物品素材不再调用 Hyper3D Rodin不再生成 GLB。新草稿和批量新增固定生成 2D 五视角素材。 3. 物品素材不再调用 Hyper3D Rodin不再生成 GLB。新草稿和批量新增固定生成 2D 五视角素材。
4. 物品 sheet 走 VectorEngine Gemini `gemini-3-pro-image-preview` 原生 `generateContent`,单张 `1:1` 图固定 `5*5`,每张承载 `5` 个物品、每个物品 `5` 个视角。 4. 物品 sheet 走 VectorEngine Gemini `gemini-3-pro-image-preview` 原生 `generateContent`,单张 `1:1` 图固定 `5*5`,每张承载 `5` 个物品、每个物品 `5` 个视角。
5. 切图前先在整张 sheet 上做绿幕 / 近白底透明化和边缘去污染,再按格子导出独立 PNG每个视角图再以扩大的 PNG 边界带为种子,把连通的浅绿 / 近白抗锯齿边直接改为透明,并对贴透明背景的弱绿 / 暗绿轮廓像素做去绿污染处理,最后按剩余可见主体二次收紧;不要先裁剪单格再各自去绿 5. 物品 sheet prompt、切图、透明化和五视角切片持久化复用 `generated_asset_sheets` 通用模块Match3D 只传入题材 / 风格 subject、物品行 prompt 模板和“同一行五格必须是同一物品五个不同视角”的特殊设定,并把通用切片结果映射回 `generatedItemAssets[].imageViews[]`
6. `generatedItemAssets[].imageViews[]` 是新素材主字段,`imageSrc/imageObjectKey` 只兼容首张视角 6. 切图前先在整张 sheet 上做绿幕 / 近白底透明化和边缘去污染,再按格子导出独立 PNG每个视角图再以扩大的 PNG 边界带为种子,把连通的浅绿 / 近白抗锯齿边直接改为透明,并对贴透明背景的弱绿 / 暗绿轮廓像素做去绿污染处理,最后按剩余可见主体二次收紧;不要先裁剪单格再各自去绿
7. 文本生成物品名称时必须同时生成 `itemSize`,只允许 `大``中``小`。该字段随 `generatedItemAssets[].itemSize` 持久化并下发;历史缺失字段的素材按 `大` 兼容,模型缺失或非法值按物品名本地推断 7. `generatedItemAssets[].imageViews[]` 是新素材主字段,`imageSrc/imageObjectKey` 兼容首张视角
8. 局内 `9:16` 纯背景图和 `1:1` 中心容器 UI 图分开生成。纯背景不得包含锅、盘、托盘、HUD、按钮、文字或物品且入库前必须合成为全画幅不透明图片不允许出现透明区域容器图走 `/v1/images/edits` 参考透明容器图 8. 文本生成物品名称时必须同时生成 `itemSize`,只允许 `大``中``小`。该字段随 `generatedItemAssets[].itemSize` 持久化并下发;历史缺失字段的素材按 `大` 兼容,模型缺失或非法值按物品名本地推断
9. 当前抓大鹅音频生成关闭:入口无 `生成音效`,草稿不生成背景音乐或点击音效,结果页不展示背景音乐 Tab 或点击音效生成入口。历史 `backgroundMusic` / `clickSound` 字段继续兼容传递 9. 局内 `9:16` 纯背景图和 `1:1` 中心容器 UI 图分开生成。纯背景不得包含锅、盘、托盘、HUD、按钮、文字或物品且入库前必须合成为全画幅不透明图片不允许出现透明区域容器图走 `/v1/images/edits` 参考透明容器图
10. UI 背景和容器资产的持久化真相仍在 `generatedItemAssets[].backgroundAsset`Agent session、work summary/detail、结果页和运行态入口都必须把该字段提升为 `backgroundImageSrc/backgroundImageObjectKey/generatedBackgroundAsset` 读取。草稿编译后的 `draftJson` 自身也必须携带 `generatedItemAssets` 快照HTTP facade 不能只依赖 work detail 回读补齐 UI 资产,外部回读为空时也不得清空草稿内已有的背景 / 容器图。平台壳层从作品架、广场、生成完成回调、结果页保存 / 发布 / 试玩回调进入 Match3D profile 时也要先归一化并提升,避免首次试玩、手动试玩、推荐流或公开详情运行态退回默认背景 / 默认容器 10. 当前抓大鹅音频生成关闭:入口无 `生成音效`,草稿不生成背景音乐或点击音效,结果页不展示背景音乐 Tab 或点击音效生成入口。历史 `backgroundMusic` / `clickSound` 字段继续兼容传递
11. UI 背景和容器资产的持久化真相仍在 `generatedItemAssets[].backgroundAsset`Agent session、work summary/detail、结果页和运行态入口都必须把该字段提升为 `backgroundImageSrc/backgroundImageObjectKey/generatedBackgroundAsset` 读取。草稿编译后的 `draftJson` 自身也必须携带 `generatedItemAssets` 快照HTTP facade 不能只依赖 work detail 回读补齐 UI 资产,外部回读为空时也不得清空草稿内已有的背景 / 容器图。平台壳层从作品架、广场、生成完成回调、结果页保存 / 发布 / 试玩回调进入 Match3D profile 时也要先归一化并提升,避免首次试玩、手动试玩、推荐流或公开详情运行态退回默认背景 / 默认容器。
结果页当前结构: 结果页当前结构:

View File

@@ -1,6 +1,7 @@
export type * from './creativeAgent'; export type * from './creativeAgent';
export type * from './creationAudio'; export type * from './creationAudio';
export type * from './hyper3d'; export type * from './hyper3d';
export type * from './jumpHop';
export type * from './puzzleCreativeTemplate'; export type * from './puzzleCreativeTemplate';
export type * from './visualNovel'; export type * from './visualNovel';
export type * from './barkBattle'; export type * from './barkBattle';

View File

@@ -0,0 +1,262 @@
export type JumpHopDifficulty = 'easy' | 'standard' | 'advanced' | 'challenge';
export type JumpHopStylePreset =
| 'minimal-blocks'
| 'paper-toy'
| 'neon-glass'
| 'forest-stone'
| 'future-metal'
| 'custom';
export type JumpHopGenerationStatus =
| 'draft'
| 'generating'
| 'ready'
| 'failed';
export type JumpHopTileType =
| 'start'
| 'normal'
| 'target'
| 'finish'
| 'bonus'
| 'accent';
export type JumpHopActionType =
| 'compile-draft'
| 'regenerate-character'
| 'regenerate-tiles'
| 'update-work-meta'
| 'update-difficulty';
export type JumpHopRunStatus = 'playing' | 'failed' | 'cleared';
export type JumpHopJumpResult = 'miss' | 'hit' | 'perfect' | 'finish';
export interface JumpHopWorkspaceCreateRequest {
templateId: string;
workTitle: string;
workDescription: string;
themeTags: string[];
difficulty: JumpHopDifficulty;
stylePreset: JumpHopStylePreset;
characterPrompt: string;
tilePrompt: string;
endMoodPrompt?: string | null;
}
export interface JumpHopActionRequest {
actionType: JumpHopActionType;
workTitle?: string | null;
workDescription?: string | null;
themeTags?: string[] | null;
difficulty?: JumpHopDifficulty | null;
stylePreset?: JumpHopStylePreset | null;
characterPrompt?: string | null;
tilePrompt?: string | null;
endMoodPrompt?: string | null;
}
export interface JumpHopCharacterAsset {
assetId: string;
imageSrc: string;
imageObjectKey: string;
assetObjectId: string;
generationProvider: string;
prompt: string;
width: number;
height: number;
}
export interface JumpHopTileAsset {
tileType: JumpHopTileType;
imageSrc: string;
imageObjectKey: string;
assetObjectId: string;
sourceAtlasCell: string;
visualWidth: number;
visualHeight: number;
topSurfaceRadius: number;
landingRadius: number;
}
export interface JumpHopScoring {
chargeToDistanceRatio: number;
maxChargeMs: number;
hitBonus: number;
perfectBonus: number;
}
export interface JumpHopPlatform {
platformId: string;
tileType: JumpHopTileType;
x: number;
y: number;
width: number;
height: number;
landingRadius: number;
perfectRadius: number;
scoreValue: number;
}
export interface JumpHopPath {
seed: string;
difficulty: JumpHopDifficulty;
platforms: JumpHopPlatform[];
finishIndex: number;
cameraPreset: string;
scoring: JumpHopScoring;
}
export interface JumpHopLastJump {
chargeMs: number;
jumpDistance: number;
targetPlatformIndex: number;
landedX: number;
landedY: number;
result: JumpHopJumpResult;
}
export interface JumpHopDraftResponse {
templateId: string;
templateName: string;
profileId: string | null;
workTitle: string;
workDescription: string;
themeTags: string[];
difficulty: JumpHopDifficulty;
stylePreset: JumpHopStylePreset;
characterPrompt: string;
tilePrompt: string;
endMoodPrompt: string | null;
characterAsset: JumpHopCharacterAsset | null;
tileAtlasAsset: JumpHopCharacterAsset | null;
tileAssets: JumpHopTileAsset[];
path: JumpHopPath | null;
coverComposite: string | null;
generationStatus: JumpHopGenerationStatus;
}
export interface JumpHopSessionSnapshotResponse {
sessionId: string;
ownerUserId: string;
status: JumpHopGenerationStatus;
draft: JumpHopDraftResponse | null;
createdAt: string;
updatedAt: string;
}
export interface JumpHopSessionResponse {
session: JumpHopSessionSnapshotResponse;
}
export interface JumpHopActionResponse {
actionType: JumpHopActionType;
session: JumpHopSessionSnapshotResponse;
work: JumpHopWorkProfileResponse | null;
}
export interface JumpHopWorkSummaryResponse {
runtimeKind: 'jump-hop';
workId: string;
profileId: string;
ownerUserId: string;
sourceSessionId: string | null;
workTitle: string;
workDescription: string;
themeTags: string[];
difficulty: JumpHopDifficulty;
stylePreset: JumpHopStylePreset;
coverImageSrc: string | null;
publicationStatus: string;
playCount: number;
updatedAt: string;
publishedAt: string | null;
publishReady: boolean;
generationStatus: JumpHopGenerationStatus;
}
export interface JumpHopWorkProfileResponse {
summary: JumpHopWorkSummaryResponse;
draft: JumpHopDraftResponse;
path: JumpHopPath;
characterAsset: JumpHopCharacterAsset;
tileAtlasAsset: JumpHopCharacterAsset;
tileAssets: JumpHopTileAsset[];
}
export interface JumpHopWorksResponse {
items: JumpHopWorkSummaryResponse[];
}
export interface JumpHopWorkDetailResponse {
item: JumpHopWorkProfileResponse;
}
export interface JumpHopWorkMutationResponse {
item: JumpHopWorkProfileResponse;
}
export interface JumpHopGalleryCardResponse {
publicWorkCode: string;
workId: string;
profileId: string;
ownerUserId: string;
authorDisplayName: string;
workTitle: string;
workDescription: string;
coverImageSrc: string | null;
themeTags: string[];
difficulty: JumpHopDifficulty;
stylePreset: JumpHopStylePreset;
publicationStatus: string;
playCount: number;
updatedAt: string;
publishedAt: string | null;
generationStatus: JumpHopGenerationStatus;
}
export interface JumpHopGalleryResponse {
items: JumpHopGalleryCardResponse[];
hasMore: boolean;
nextCursor: string | null;
}
export interface JumpHopGalleryDetailResponse {
item: JumpHopWorkProfileResponse;
}
export interface JumpHopRuntimeRunSnapshotResponse {
runId: string;
profileId: string;
ownerUserId: string;
status: JumpHopRunStatus;
currentPlatformIndex: number;
score: number;
combo: number;
path: JumpHopPath;
lastJump: JumpHopLastJump | null;
startedAtMs: number;
finishedAtMs: number | null;
}
export interface JumpHopRunResponse {
run: JumpHopRuntimeRunSnapshotResponse;
}
export interface JumpHopStartRunRequest {
profileId: string;
}
export interface JumpHopJumpRequest {
chargeMs: number;
clientEventId: string;
}
export interface JumpHopRestartRunRequest {
clientActionId: string;
}
export interface JumpHopJumpResponse {
run: JumpHopRuntimeRunSnapshotResponse;
}

View File

@@ -474,11 +474,11 @@ function loadBaseSources(baseRef) {
} }
function getChangedFiles(baseRef) { function getChangedFiles(baseRef) {
const diffOutput = tryGit(['diff', '--name-only', baseRef, '--']) ?? ''; const diffOutput = tryGit(['diff', '--name-only', '-z', baseRef, '--']) ?? '';
const untrackedOutput = const untrackedOutput =
tryGit(['ls-files', '--others', '--exclude-standard', moduleSrcRoot]) ?? ''; tryGit(['ls-files', '--others', '--exclude-standard', '-z', moduleSrcRoot]) ?? '';
return new Set( return new Set(
[...diffOutput.split(/\r?\n/u), ...untrackedOutput.split(/\r?\n/u)] [...diffOutput.split(/\u0000/u), ...untrackedOutput.split(/\u0000/u)]
.map(normalizePath) .map(normalizePath)
.filter(Boolean), .filter(Boolean),
); );

11
server-rs/Cargo.lock generated
View File

@@ -1827,6 +1827,15 @@ dependencies = [
"spacetimedb", "spacetimedb",
] ]
[[package]]
name = "module-jump-hop"
version = "0.1.0"
dependencies = [
"serde",
"shared-kernel",
"spacetimedb",
]
[[package]] [[package]]
name = "module-match3d" name = "module-match3d"
version = "0.1.0" version = "0.1.0"
@@ -3259,6 +3268,7 @@ dependencies = [
"module-combat", "module-combat",
"module-custom-world", "module-custom-world",
"module-inventory", "module-inventory",
"module-jump-hop",
"module-match3d", "module-match3d",
"module-npc", "module-npc",
"module-puzzle", "module-puzzle",
@@ -3291,6 +3301,7 @@ dependencies = [
"module-combat", "module-combat",
"module-custom-world", "module-custom-world",
"module-inventory", "module-inventory",
"module-jump-hop",
"module-match3d", "module-match3d",
"module-npc", "module-npc",
"module-progression", "module-progression",

View File

@@ -17,6 +17,7 @@ members = [
"crates/module-creative-agent", "crates/module-creative-agent",
"crates/module-inventory", "crates/module-inventory",
"crates/module-custom-world", "crates/module-custom-world",
"crates/module-jump-hop",
"crates/module-match3d", "crates/module-match3d",
"crates/module-npc", "crates/module-npc",
"crates/module-puzzle", "crates/module-puzzle",
@@ -57,6 +58,7 @@ module-combat = { path = "crates/module-combat", default-features = false }
module-creative-agent = { path = "crates/module-creative-agent", default-features = false } module-creative-agent = { path = "crates/module-creative-agent", default-features = false }
module-custom-world = { path = "crates/module-custom-world", default-features = false } module-custom-world = { path = "crates/module-custom-world", default-features = false }
module-inventory = { path = "crates/module-inventory", default-features = false } module-inventory = { path = "crates/module-inventory", default-features = false }
module-jump-hop = { path = "crates/module-jump-hop", default-features = false }
module-match3d = { path = "crates/module-match3d", default-features = false } module-match3d = { path = "crates/module-match3d", default-features = false }
module-npc = { path = "crates/module-npc", default-features = false } module-npc = { path = "crates/module-npc", default-features = false }
module-progression = { path = "crates/module-progression", default-features = false } module-progression = { path = "crates/module-progression", default-features = false }

View File

@@ -59,6 +59,7 @@ pub fn build_router(state: AppState) -> Router {
.merge(modules::bark_battle::router(state.clone())) .merge(modules::bark_battle::router(state.clone()))
.merge(modules::match3d::router(state.clone())) .merge(modules::match3d::router(state.clone()))
.merge(modules::square_hole::router(state.clone())) .merge(modules::square_hole::router(state.clone()))
.merge(modules::jump_hop::router(state.clone()))
.merge(modules::puzzle::router(state.clone())) .merge(modules::puzzle::router(state.clone()))
.merge(visual_novel_router(state.clone())) .merge(visual_novel_router(state.clone()))
.route( .route(

View File

@@ -87,6 +87,12 @@ pub fn resolve_creation_entry_route_id(path: &str) -> Option<&'static str> {
if normalized.starts_with("/api/runtime/square-hole") { if normalized.starts_with("/api/runtime/square-hole") {
return Some("square-hole"); return Some("square-hole");
} }
if normalized.starts_with("/api/runtime/jump-hop") {
return Some("jump-hop");
}
if normalized.starts_with("/api/creation/jump-hop") {
return Some("jump-hop");
}
if normalized.starts_with("/api/runtime/big-fish") { if normalized.starts_with("/api/runtime/big-fish") {
return Some("big-fish"); return Some("big-fish");
} }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,447 @@
use axum::{
Json,
extract::{Extension, Path, State, rejection::JsonRejection},
http::{HeaderName, StatusCode, header},
response::Response,
};
use serde_json::{Value, json};
use shared_contracts::jump_hop::{
JumpHopActionRequest, JumpHopDraftResponse, JumpHopGalleryDetailResponse,
JumpHopGenerationStatus, JumpHopJumpRequest, JumpHopJumpResponse, JumpHopRestartRunRequest,
JumpHopRunResponse, JumpHopSessionResponse, JumpHopSessionSnapshotResponse,
JumpHopStartRunRequest, JumpHopWorkDetailResponse, JumpHopWorkMutationResponse,
JumpHopWorkspaceCreateRequest,
};
use shared_kernel::{build_prefixed_uuid_id, format_timestamp_micros};
use spacetime_client::SpacetimeClientError;
use std::time::{SystemTime, UNIX_EPOCH};
use crate::{
api_response::json_success_body, auth::AuthenticatedAccessToken, http_error::AppError,
request_context::RequestContext, state::AppState,
};
const JUMP_HOP_PROVIDER: &str = "jump-hop";
const JUMP_HOP_CREATION_PROVIDER: &str = "jump-hop-creation";
const JUMP_HOP_RUNTIME_PROVIDER: &str = "jump-hop-runtime";
const JUMP_HOP_TEMPLATE_ID: &str = "jump-hop";
const JUMP_HOP_TEMPLATE_NAME: &str = "跳一跳";
pub async fn create_jump_hop_session(
State(state): State<AppState>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
payload: Result<Json<JumpHopWorkspaceCreateRequest>, JsonRejection>,
) -> Result<Json<Value>, Response> {
let Json(payload) = jump_hop_json(payload, &request_context, JUMP_HOP_CREATION_PROVIDER)?;
validate_workspace_request(&request_context, &payload)?;
let owner_user_id = authenticated.claims().user_id().to_string();
let session_id = build_prefixed_uuid_id("jump-hop-session-");
let now = current_utc_micros();
let draft = build_jump_hop_draft(&payload);
let session = JumpHopSessionSnapshotResponse {
session_id,
owner_user_id,
status: JumpHopGenerationStatus::Draft,
draft: Some(draft),
created_at: format_timestamp_micros(now),
updated_at: format_timestamp_micros(now),
};
Ok(json_success_body(
Some(&request_context),
JumpHopSessionResponse {
session: state
.spacetime_client()
.create_jump_hop_session(session)
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_CREATION_PROVIDER,
map_jump_hop_client_error(error),
)
})?,
},
))
}
pub async fn get_jump_hop_session(
State(state): State<AppState>,
Path(session_id): Path<String>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
) -> Result<Json<Value>, Response> {
ensure_non_empty(&request_context, &session_id, "sessionId")?;
let owner_user_id = authenticated.claims().user_id().to_string();
let session = state
.spacetime_client()
.get_jump_hop_session(session_id, owner_user_id)
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_CREATION_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(
Some(&request_context),
JumpHopSessionResponse { session },
))
}
pub async fn execute_jump_hop_action(
State(state): State<AppState>,
Path(session_id): Path<String>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
payload: Result<Json<JumpHopActionRequest>, JsonRejection>,
) -> Result<Json<Value>, Response> {
ensure_non_empty(&request_context, &session_id, "sessionId")?;
let Json(payload) = jump_hop_json(payload, &request_context, JUMP_HOP_CREATION_PROVIDER)?;
let owner_user_id = authenticated.claims().user_id().to_string();
let response = state
.spacetime_client()
.execute_jump_hop_action(session_id, owner_user_id, payload)
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_CREATION_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(Some(&request_context), response))
}
pub async fn publish_jump_hop_work(
State(state): State<AppState>,
Path(profile_id): Path<String>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
) -> Result<Json<Value>, Response> {
ensure_non_empty(&request_context, &profile_id, "profileId")?;
let work = state
.spacetime_client()
.publish_jump_hop_work(profile_id, authenticated.claims().user_id().to_string())
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_CREATION_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(
Some(&request_context),
JumpHopWorkMutationResponse { item: work },
))
}
pub async fn get_jump_hop_runtime_work(
State(state): State<AppState>,
Path(profile_id): Path<String>,
Extension(request_context): Extension<RequestContext>,
) -> Result<Json<Value>, Response> {
ensure_non_empty(&request_context, &profile_id, "profileId")?;
let work = state
.spacetime_client()
.get_jump_hop_runtime_work(profile_id)
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_RUNTIME_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(
Some(&request_context),
JumpHopWorkDetailResponse { item: work },
))
}
pub async fn start_jump_hop_run(
State(state): State<AppState>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
payload: Result<Json<JumpHopStartRunRequest>, JsonRejection>,
) -> Result<Json<Value>, Response> {
let Json(payload) = jump_hop_json(payload, &request_context, JUMP_HOP_RUNTIME_PROVIDER)?;
ensure_non_empty(&request_context, &payload.profile_id, "profileId")?;
let run = state
.spacetime_client()
.start_jump_hop_run(payload, authenticated.claims().user_id().to_string())
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_RUNTIME_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(
Some(&request_context),
JumpHopRunResponse { run },
))
}
pub async fn jump_hop_run_jump(
State(state): State<AppState>,
Path(run_id): Path<String>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
payload: Result<Json<JumpHopJumpRequest>, JsonRejection>,
) -> Result<Json<Value>, Response> {
ensure_non_empty(&request_context, &run_id, "runId")?;
let Json(payload) = jump_hop_json(payload, &request_context, JUMP_HOP_RUNTIME_PROVIDER)?;
let run = state
.spacetime_client()
.jump_hop_run_jump(
run_id,
authenticated.claims().user_id().to_string(),
payload,
)
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_RUNTIME_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(
Some(&request_context),
JumpHopJumpResponse { run },
))
}
pub async fn restart_jump_hop_run(
State(state): State<AppState>,
Path(run_id): Path<String>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
payload: Result<Json<JumpHopRestartRunRequest>, JsonRejection>,
) -> Result<Json<Value>, Response> {
ensure_non_empty(&request_context, &run_id, "runId")?;
let Json(payload) = jump_hop_json(payload, &request_context, JUMP_HOP_RUNTIME_PROVIDER)?;
let run = state
.spacetime_client()
.restart_jump_hop_run(
run_id,
authenticated.claims().user_id().to_string(),
payload,
)
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_RUNTIME_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(
Some(&request_context),
JumpHopRunResponse { run },
))
}
pub async fn list_jump_hop_gallery(
State(state): State<AppState>,
Extension(request_context): Extension<RequestContext>,
) -> Result<Json<Value>, Response> {
let gallery = state
.spacetime_client()
.list_jump_hop_gallery()
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_RUNTIME_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(Some(&request_context), gallery))
}
pub async fn get_jump_hop_gallery_detail(
State(state): State<AppState>,
Path(public_work_code): Path<String>,
Extension(request_context): Extension<RequestContext>,
) -> Result<Json<Value>, Response> {
ensure_non_empty(&request_context, &public_work_code, "publicWorkCode")?;
let work = state
.spacetime_client()
.get_jump_hop_gallery_detail(public_work_code)
.await
.map_err(|error| {
jump_hop_error_response(
&request_context,
JUMP_HOP_RUNTIME_PROVIDER,
map_jump_hop_client_error(error),
)
})?;
Ok(json_success_body(
Some(&request_context),
JumpHopGalleryDetailResponse { item: work },
))
}
fn build_jump_hop_draft(payload: &JumpHopWorkspaceCreateRequest) -> JumpHopDraftResponse {
JumpHopDraftResponse {
template_id: JUMP_HOP_TEMPLATE_ID.to_string(),
template_name: JUMP_HOP_TEMPLATE_NAME.to_string(),
profile_id: None,
work_title: payload.work_title.trim().to_string(),
work_description: payload.work_description.trim().to_string(),
theme_tags: normalize_tags(payload.theme_tags.clone()),
difficulty: payload.difficulty.clone(),
style_preset: payload.style_preset.clone(),
character_prompt: payload.character_prompt.trim().to_string(),
tile_prompt: payload.tile_prompt.trim().to_string(),
end_mood_prompt: payload
.end_mood_prompt
.as_ref()
.map(|value| value.trim().to_string())
.filter(|value| !value.is_empty()),
character_asset: None,
tile_atlas_asset: None,
tile_assets: Vec::new(),
path: None,
cover_composite: None,
generation_status: JumpHopGenerationStatus::Draft,
}
}
fn validate_workspace_request(
request_context: &RequestContext,
payload: &JumpHopWorkspaceCreateRequest,
) -> Result<(), Response> {
ensure_non_empty(request_context, &payload.work_title, "workTitle")?;
ensure_non_empty(
request_context,
&payload.character_prompt,
"characterPrompt",
)?;
ensure_non_empty(request_context, &payload.tile_prompt, "tilePrompt")?;
if payload.template_id.trim() != JUMP_HOP_TEMPLATE_ID {
return Err(jump_hop_error_response(
request_context,
JUMP_HOP_CREATION_PROVIDER,
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
"provider": JUMP_HOP_PROVIDER,
"message": "templateId 必须为 jump-hop",
})),
));
}
Ok(())
}
fn ensure_non_empty(
request_context: &RequestContext,
value: &str,
field: &str,
) -> Result<(), Response> {
if value.trim().is_empty() {
return Err(jump_hop_error_response(
request_context,
JUMP_HOP_PROVIDER,
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
"provider": JUMP_HOP_PROVIDER,
"field": field,
"message": format!("{field} 不能为空"),
})),
));
}
Ok(())
}
fn normalize_tags(tags: Vec<String>) -> Vec<String> {
let mut normalized = Vec::new();
for tag in tags {
let tag = tag.trim();
if tag.is_empty() || normalized.iter().any(|item| item == tag) {
continue;
}
normalized.push(tag.to_string());
if normalized.len() >= 6 {
break;
}
}
normalized
}
fn jump_hop_json<T>(
payload: Result<Json<T>, JsonRejection>,
request_context: &RequestContext,
provider: &str,
) -> Result<Json<T>, Response> {
payload.map_err(|error| {
jump_hop_error_response(
request_context,
provider,
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
"provider": provider,
"message": error.to_string(),
})),
)
})
}
fn map_jump_hop_client_error(error: SpacetimeClientError) -> AppError {
let status = match &error {
SpacetimeClientError::Runtime(_) => StatusCode::BAD_REQUEST,
SpacetimeClientError::Procedure(message)
if message.contains("不存在")
|| message.contains("not found")
|| message.contains("does not exist") =>
{
StatusCode::NOT_FOUND
}
SpacetimeClientError::Procedure(message)
if message.contains("发布需要")
|| message.contains("不能为空")
|| message.contains("必须") =>
{
StatusCode::BAD_REQUEST
}
_ => StatusCode::BAD_GATEWAY,
};
AppError::from_status(status).with_details(json!({
"provider": "spacetimedb",
"message": error.to_string(),
}))
}
fn jump_hop_error_response(
request_context: &RequestContext,
provider: &str,
error: AppError,
) -> Response {
let mut response = error.into_response_with_context(Some(request_context));
response.headers_mut().insert(
HeaderName::from_static("x-genarrative-provider"),
header::HeaderValue::from_str(provider)
.unwrap_or_else(|_| header::HeaderValue::from_static("jump-hop")),
);
response
}
fn current_utc_micros() -> i64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.map(|duration| duration.as_micros().min(i64::MAX as u128) as i64)
.unwrap_or(0)
}

View File

@@ -39,10 +39,12 @@ mod custom_world_rpg_draft_prompts;
mod edutainment_baby_drawing; mod edutainment_baby_drawing;
mod edutainment_baby_object; mod edutainment_baby_object;
mod error_middleware; mod error_middleware;
pub(crate) mod generated_asset_sheets;
mod generated_image_assets; mod generated_image_assets;
mod health; mod health;
mod http_error; mod http_error;
mod hyper3d_generation; mod hyper3d_generation;
mod jump_hop;
mod llm; mod llm;
mod llm_model_routing; mod llm_model_routing;
mod login_options; mod login_options;

View File

@@ -16,7 +16,7 @@ use axum::{
}; };
use base64::{Engine as _, engine::general_purpose::STANDARD as BASE64_STANDARD}; use base64::{Engine as _, engine::general_purpose::STANDARD as BASE64_STANDARD};
use futures_util::{StreamExt, stream::FuturesUnordered}; use futures_util::{StreamExt, stream::FuturesUnordered};
use image::{GenericImageView, ImageFormat}; use image::ImageFormat;
use module_match3d::{ use module_match3d::{
MATCH3D_MESSAGE_ID_PREFIX, MATCH3D_PROFILE_ID_PREFIX, MATCH3D_RUN_ID_PREFIX, MATCH3D_MESSAGE_ID_PREFIX, MATCH3D_PROFILE_ID_PREFIX, MATCH3D_RUN_ID_PREFIX,
MATCH3D_SESSION_ID_PREFIX, MATCH3D_SESSION_ID_PREFIX,
@@ -98,11 +98,6 @@ const MATCH3D_ITEM_ASSETS_POINTS_PER_BATCH: u64 = 2;
const MATCH3D_MATERIAL_ITEM_BATCH_SIZE: usize = 5; const MATCH3D_MATERIAL_ITEM_BATCH_SIZE: usize = 5;
const MATCH3D_ITEM_VIEW_COUNT: usize = 5; const MATCH3D_ITEM_VIEW_COUNT: usize = 5;
const MATCH3D_MATERIAL_GRID_SIZE: u32 = 5; const MATCH3D_MATERIAL_GRID_SIZE: u32 = 5;
const MATCH3D_MATERIAL_FOREGROUND_DIFF_THRESHOLD: i32 = 36;
const MATCH3D_MATERIAL_FOREGROUND_ALPHA_THRESHOLD: i32 = 36;
const MATCH3D_MATERIAL_GREEN_SCREEN_MIN_SCORE: f32 = 0.34;
const MATCH3D_MATERIAL_GREEN_SCREEN_SOFT_SCORE: f32 = 0.18;
const MATCH3D_MATERIAL_HARD_GREEN_SCREEN_SCORE: f32 = 0.82;
const MATCH3D_MAX_GENERATED_ITEM_COUNT: usize = 25; const MATCH3D_MAX_GENERATED_ITEM_COUNT: usize = 25;
const MATCH3D_MATERIAL_VECTOR_ENGINE_GEMINI_MODEL: &str = "gemini-3-pro-image-preview"; const MATCH3D_MATERIAL_VECTOR_ENGINE_GEMINI_MODEL: &str = "gemini-3-pro-image-preview";
const MATCH3D_MATERIAL_VECTOR_ENGINE_GEMINI_ASPECT_RATIO: &str = "1:1"; const MATCH3D_MATERIAL_VECTOR_ENGINE_GEMINI_ASPECT_RATIO: &str = "1:1";

View File

@@ -532,7 +532,9 @@ fn build_config_from_message(
} }
} }
pub(super) fn resolve_config_or_default(config: Option<&Match3DCreatorConfigRecord>) -> Match3DConfigJson { pub(super) fn resolve_config_or_default(
config: Option<&Match3DCreatorConfigRecord>,
) -> Match3DConfigJson {
config config
.map(|config| Match3DConfigJson { .map(|config| Match3DConfigJson {
theme_text: config.theme_text.clone(), theme_text: config.theme_text.clone(),
@@ -595,7 +597,10 @@ fn build_match3d_assistant_reply(config: &Match3DConfigJson) -> String {
) )
} }
pub(super) fn build_match3d_assistant_reply_for_turn(config: &Match3DConfigJson, current_turn: u32) -> String { pub(super) fn build_match3d_assistant_reply_for_turn(
config: &Match3DConfigJson,
current_turn: u32,
) -> String {
match current_turn { match current_turn {
0 => MATCH3D_QUESTION_THEME.to_string(), 0 => MATCH3D_QUESTION_THEME.to_string(),
1 => MATCH3D_QUESTION_CLEAR_COUNT.to_string(), 1 => MATCH3D_QUESTION_CLEAR_COUNT.to_string(),

File diff suppressed because it is too large Load Diff

View File

@@ -134,9 +134,8 @@ pub(super) fn map_match3d_draft_response(
draft: Match3DResultDraftRecord, draft: Match3DResultDraftRecord,
) -> Match3DResultDraftResponse { ) -> Match3DResultDraftResponse {
// 中文注释session draft 自身也可能携带生成素材快照,不能只依赖 work detail 回读补齐 UI 背景和容器图。 // 中文注释session draft 自身也可能携带生成素材快照,不能只依赖 work detail 回读补齐 UI 背景和容器图。
let generated_item_assets = parse_match3d_generated_item_assets( let generated_item_assets =
draft.generated_item_assets_json.as_deref(), parse_match3d_generated_item_assets(draft.generated_item_assets_json.as_deref())
)
.into_iter() .into_iter()
.map(Match3DGeneratedItemAsset::from) .map(Match3DGeneratedItemAsset::from)
.collect::<Vec<_>>(); .collect::<Vec<_>>();

View File

@@ -1,5 +1,3 @@
use super::*;
use super::*; use super::*;
fn test_match3d_generated_item_asset(index: u32, name: &str) -> Match3DGeneratedItemAsset { fn test_match3d_generated_item_asset(index: u32, name: &str) -> Match3DGeneratedItemAsset {
@@ -208,8 +206,7 @@ use super::*;
let width = 500; let width = 500;
let height = 500; let height = 500;
let item_names = vec!["樱桃".to_string(), "苹果".to_string(), "香蕉".to_string()]; let item_names = vec!["樱桃".to_string(), "苹果".to_string(), "香蕉".to_string()];
let mut sheet = let mut sheet = image::RgbaImage::from_pixel(width, height, image::Rgba([255, 255, 255, 255]));
image::RgbaImage::from_pixel(width, height, image::Rgba([255, 255, 255, 255]));
for y in 1..5 { for y in 1..5 {
for x in 18..82 { for x in 18..82 {
sheet.put_pixel(x, y, image::Rgba([20, 80, 240, 255])); sheet.put_pixel(x, y, image::Rgba([20, 80, 240, 255]));
@@ -296,8 +293,7 @@ use super::*;
let width = 500; let width = 500;
let height = 500; let height = 500;
let item_names = vec!["葡萄".to_string()]; let item_names = vec!["葡萄".to_string()];
let mut sheet = let mut sheet = image::RgbaImage::from_pixel(width, height, image::Rgba([245, 245, 245, 255]));
image::RgbaImage::from_pixel(width, height, image::Rgba([245, 245, 245, 255]));
for y in 8..92 { for y in 8..92 {
for x in 8..92 { for x in 8..92 {
sheet.put_pixel(x, y, image::Rgba([0, 236, 18, 255])); sheet.put_pixel(x, y, image::Rgba([0, 236, 18, 255]));
@@ -437,8 +433,7 @@ use super::*;
fn match3d_material_view_edge_matte_removes_green_border_touching_png_edge() { fn match3d_material_view_edge_matte_removes_green_border_touching_png_edge() {
let width = 72; let width = 72;
let height = 72; let height = 72;
let mut view = let mut view = image::RgbaImage::from_pixel(width, height, image::Rgba([168, 246, 176, 255]));
image::RgbaImage::from_pixel(width, height, image::Rgba([168, 246, 176, 255]));
for y in 10..62 { for y in 10..62 {
for x in 10..62 { for x in 10..62 {
view.put_pixel(x, y, image::Rgba([0, 0, 0, 0])); view.put_pixel(x, y, image::Rgba([0, 0, 0, 0]));
@@ -551,8 +546,7 @@ use super::*;
fn match3d_container_image_postprocess_removes_plain_background() { fn match3d_container_image_postprocess_removes_plain_background() {
let width = 256; let width = 256;
let height = 256; let height = 256;
let mut image = let mut image = image::RgbaImage::from_pixel(width, height, image::Rgba([248, 248, 246, 255]));
image::RgbaImage::from_pixel(width, height, image::Rgba([248, 248, 246, 255]));
for y in 68..190 { for y in 68..190 {
for x in 38..218 { for x in 38..218 {
image.put_pixel(x, y, image::Rgba([160, 104, 54, 255])); image.put_pixel(x, y, image::Rgba([160, 104, 54, 255]));
@@ -591,8 +585,7 @@ use super::*;
fn match3d_background_image_postprocess_removes_transparent_pixels() { fn match3d_background_image_postprocess_removes_transparent_pixels() {
let width = 16; let width = 16;
let height = 16; let height = 16;
let mut image = let mut image = image::RgbaImage::from_pixel(width, height, image::Rgba([80, 140, 190, 255]));
image::RgbaImage::from_pixel(width, height, image::Rgba([80, 140, 190, 255]));
image.put_pixel(0, 0, image::Rgba([0, 0, 0, 0])); image.put_pixel(0, 0, image::Rgba([0, 0, 0, 0]));
image.put_pixel(8, 8, image::Rgba([240, 120, 40, 128])); image.put_pixel(8, 8, image::Rgba([240, 120, 40, 128]));
@@ -817,8 +810,7 @@ use super::*;
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let plan = let plan = build_match3d_item_asset_append_plan(vec!["新物品".to_string()], &existing_assets);
build_match3d_item_asset_append_plan(vec!["新物品".to_string()], &existing_assets);
assert_eq!(plan.requested_item_names, vec!["新物品"]); assert_eq!(plan.requested_item_names, vec!["新物品"]);
assert_eq!( assert_eq!(
@@ -887,8 +879,7 @@ use super::*;
generated_asset.model_src = None; generated_asset.model_src = None;
generated_asset.model_object_key = None; generated_asset.model_object_key = None;
let merged = let merged = merge_regenerated_match3d_item_asset(Some(current_asset.clone()), generated_asset);
merge_regenerated_match3d_item_asset(Some(current_asset.clone()), generated_asset);
assert_eq!(merged.item_id, "match3d-item-1"); assert_eq!(merged.item_id, "match3d-item-1");
assert_eq!(merged.item_name, "草莓"); assert_eq!(merged.item_name, "草莓");
@@ -1034,8 +1025,7 @@ use super::*;
let config = config("水果", 3, 3); let config = config("水果", 3, 3);
let background_prompt = let background_prompt =
build_match3d_background_generation_prompt(&config, "果园绿色竖屏纯背景"); build_match3d_background_generation_prompt(&config, "果园绿色竖屏纯背景");
let container_prompt = let container_prompt = build_match3d_container_generation_prompt(&config, "果园绿色竖屏纯背景");
build_match3d_container_generation_prompt(&config, "果园绿色竖屏纯背景");
assert!(background_prompt.contains("9:16")); assert!(background_prompt.contains("9:16"));
assert!(background_prompt.contains("纯背景图")); assert!(background_prompt.contains("纯背景图"));
@@ -1063,9 +1053,7 @@ use super::*;
fn match3d_background_asset_requires_background_and_container_images() { fn match3d_background_asset_requires_background_and_container_images() {
let background_only = Match3DGeneratedBackgroundAsset { let background_only = Match3DGeneratedBackgroundAsset {
prompt: "果园背景".to_string(), prompt: "果园背景".to_string(),
image_src: Some( image_src: Some("/generated-match3d-assets/session/profile/background/bg.png".to_string()),
"/generated-match3d-assets/session/profile/background/bg.png".to_string(),
),
image_object_key: None, image_object_key: None,
container_prompt: None, container_prompt: None,
container_image_src: None, container_image_src: None,
@@ -1108,14 +1096,12 @@ use super::*;
background_asset: Some(Match3DGeneratedBackgroundAsset { background_asset: Some(Match3DGeneratedBackgroundAsset {
prompt: "果园背景".to_string(), prompt: "果园背景".to_string(),
image_src: Some( image_src: Some(
"/generated-match3d-assets/session/profile/background/background.png" "/generated-match3d-assets/session/profile/background/background.png".to_string(),
.to_string(),
), ),
image_object_key: None, image_object_key: None,
container_prompt: Some("果园容器".to_string()), container_prompt: Some("果园容器".to_string()),
container_image_src: Some( container_image_src: Some(
"/generated-match3d-assets/session/profile/ui-container/container.png" "/generated-match3d-assets/session/profile/ui-container/container.png".to_string(),
.to_string(),
), ),
container_image_object_key: None, container_image_object_key: None,
status: "image_ready".to_string(), status: "image_ready".to_string(),
@@ -1210,21 +1196,17 @@ use super::*;
background_asset: Some(Match3DGeneratedBackgroundAsset { background_asset: Some(Match3DGeneratedBackgroundAsset {
prompt: "果园背景".to_string(), prompt: "果园背景".to_string(),
image_src: Some( image_src: Some(
"/generated-match3d-assets/session/profile/background/background.png" "/generated-match3d-assets/session/profile/background/background.png".to_string(),
.to_string(),
), ),
image_object_key: Some( image_object_key: Some(
"generated-match3d-assets/session/profile/background/background.png" "generated-match3d-assets/session/profile/background/background.png".to_string(),
.to_string(),
), ),
container_prompt: Some("果园容器".to_string()), container_prompt: Some("果园容器".to_string()),
container_image_src: Some( container_image_src: Some(
"/generated-match3d-assets/session/profile/ui-container/container.png" "/generated-match3d-assets/session/profile/ui-container/container.png".to_string(),
.to_string(),
), ),
container_image_object_key: Some( container_image_object_key: Some(
"generated-match3d-assets/session/profile/ui-container/container.png" "generated-match3d-assets/session/profile/ui-container/container.png".to_string(),
.to_string(),
), ),
status: "image_ready".to_string(), status: "image_ready".to_string(),
error: None, error: None,
@@ -1331,8 +1313,7 @@ use super::*;
item_name: "草莓".to_string(), item_name: "草莓".to_string(),
item_size: Some(MATCH3D_ITEM_SIZE_SMALL.to_string()), item_size: Some(MATCH3D_ITEM_SIZE_SMALL.to_string()),
image_src: Some( image_src: Some(
"/generated-match3d-assets/session/profile/items/strawberry/view-01.png" "/generated-match3d-assets/session/profile/items/strawberry/view-01.png".to_string(),
.to_string(),
), ),
image_object_key: Some( image_object_key: Some(
"generated-match3d-assets/session/profile/items/strawberry/view-01.png".to_string(), "generated-match3d-assets/session/profile/items/strawberry/view-01.png".to_string(),
@@ -1352,21 +1333,17 @@ use super::*;
background_asset: Some(Match3DGeneratedBackgroundAsset { background_asset: Some(Match3DGeneratedBackgroundAsset {
prompt: "果园背景".to_string(), prompt: "果园背景".to_string(),
image_src: Some( image_src: Some(
"/generated-match3d-assets/session/profile/background/background.png" "/generated-match3d-assets/session/profile/background/background.png".to_string(),
.to_string(),
), ),
image_object_key: Some( image_object_key: Some(
"generated-match3d-assets/session/profile/background/background.png" "generated-match3d-assets/session/profile/background/background.png".to_string(),
.to_string(),
), ),
container_prompt: Some("果园容器".to_string()), container_prompt: Some("果园容器".to_string()),
container_image_src: Some( container_image_src: Some(
"/generated-match3d-assets/session/profile/ui-container/container.png" "/generated-match3d-assets/session/profile/ui-container/container.png".to_string(),
.to_string(),
), ),
container_image_object_key: Some( container_image_object_key: Some(
"generated-match3d-assets/session/profile/ui-container/container.png" "generated-match3d-assets/session/profile/ui-container/container.png".to_string(),
.to_string(),
), ),
status: "image_ready".to_string(), status: "image_ready".to_string(),
error: None, error: None,
@@ -1411,8 +1388,7 @@ use super::*;
item_name: "草莓".to_string(), item_name: "草莓".to_string(),
item_size: Some(MATCH3D_ITEM_SIZE_SMALL.to_string()), item_size: Some(MATCH3D_ITEM_SIZE_SMALL.to_string()),
image_src: Some( image_src: Some(
"/generated-match3d-assets/session/profile/items/strawberry/view-01.png" "/generated-match3d-assets/session/profile/items/strawberry/view-01.png".to_string(),
.to_string(),
), ),
image_object_key: Some( image_object_key: Some(
"generated-match3d-assets/session/profile/items/strawberry/view-01.png".to_string(), "generated-match3d-assets/session/profile/items/strawberry/view-01.png".to_string(),
@@ -1432,21 +1408,17 @@ use super::*;
background_asset: Some(Match3DGeneratedBackgroundAsset { background_asset: Some(Match3DGeneratedBackgroundAsset {
prompt: "果园背景".to_string(), prompt: "果园背景".to_string(),
image_src: Some( image_src: Some(
"/generated-match3d-assets/session/profile/background/background.png" "/generated-match3d-assets/session/profile/background/background.png".to_string(),
.to_string(),
), ),
image_object_key: Some( image_object_key: Some(
"generated-match3d-assets/session/profile/background/background.png" "generated-match3d-assets/session/profile/background/background.png".to_string(),
.to_string(),
), ),
container_prompt: Some("果园容器".to_string()), container_prompt: Some("果园容器".to_string()),
container_image_src: Some( container_image_src: Some(
"/generated-match3d-assets/session/profile/ui-container/container.png" "/generated-match3d-assets/session/profile/ui-container/container.png".to_string(),
.to_string(),
), ),
container_image_object_key: Some( container_image_object_key: Some(
"generated-match3d-assets/session/profile/ui-container/container.png" "generated-match3d-assets/session/profile/ui-container/container.png".to_string(),
.to_string(),
), ),
status: "image_ready".to_string(), status: "image_ready".to_string(),
error: None, error: None,
@@ -1591,13 +1563,9 @@ use super::*;
item_name: "苹果".to_string(), item_name: "苹果".to_string(),
item_size: Some(MATCH3D_ITEM_SIZE_MEDIUM.to_string()), item_size: Some(MATCH3D_ITEM_SIZE_MEDIUM.to_string()),
image_src: Some("/generated-match3d-assets/s/p/items/i2/image.png".to_string()), image_src: Some("/generated-match3d-assets/s/p/items/i2/image.png".to_string()),
image_object_key: Some( image_object_key: Some("generated-match3d-assets/s/p/items/i2/image.png".to_string()),
"generated-match3d-assets/s/p/items/i2/image.png".to_string(),
),
image_views: Vec::new(), image_views: Vec::new(),
model_src: Some( model_src: Some("/generated-match3d-assets/s/p/items/i2/model/model.glb".to_string()),
"/generated-match3d-assets/s/p/items/i2/model/model.glb".to_string(),
),
model_object_key: Some( model_object_key: Some(
"generated-match3d-assets/s/p/items/i2/model/model.glb".to_string(), "generated-match3d-assets/s/p/items/i2/model/model.glb".to_string(),
), ),
@@ -1619,9 +1587,7 @@ use super::*;
item_name: "草莓".to_string(), item_name: "草莓".to_string(),
item_size: Some(MATCH3D_ITEM_SIZE_SMALL.to_string()), item_size: Some(MATCH3D_ITEM_SIZE_SMALL.to_string()),
image_src: Some("/generated-match3d-assets/s/p/items/i1/image.png".to_string()), image_src: Some("/generated-match3d-assets/s/p/items/i1/image.png".to_string()),
image_object_key: Some( image_object_key: Some("generated-match3d-assets/s/p/items/i1/image.png".to_string()),
"generated-match3d-assets/s/p/items/i1/image.png".to_string(),
),
image_views: Vec::new(), image_views: Vec::new(),
model_src: None, model_src: None,
model_object_key: None, model_object_key: None,
@@ -1652,9 +1618,7 @@ use super::*;
item_name: "草莓".to_string(), item_name: "草莓".to_string(),
item_size: Some(MATCH3D_ITEM_SIZE_SMALL.to_string()), item_size: Some(MATCH3D_ITEM_SIZE_SMALL.to_string()),
image_src: Some("/generated-match3d-assets/s/p/items/i1/image.png".to_string()), image_src: Some("/generated-match3d-assets/s/p/items/i1/image.png".to_string()),
image_object_key: Some( image_object_key: Some("generated-match3d-assets/s/p/items/i1/image.png".to_string()),
"generated-match3d-assets/s/p/items/i1/image.png".to_string(),
),
image_views: Vec::new(), image_views: Vec::new(),
model_src: None, model_src: None,
model_object_key: None, model_object_key: None,
@@ -1676,9 +1640,7 @@ use super::*;
item_name: "苹果".to_string(), item_name: "苹果".to_string(),
item_size: Some(MATCH3D_ITEM_SIZE_MEDIUM.to_string()), item_size: Some(MATCH3D_ITEM_SIZE_MEDIUM.to_string()),
image_src: Some("/generated-match3d-assets/s/p/items/i2/image.png".to_string()), image_src: Some("/generated-match3d-assets/s/p/items/i2/image.png".to_string()),
image_object_key: Some( image_object_key: Some("generated-match3d-assets/s/p/items/i2/image.png".to_string()),
"generated-match3d-assets/s/p/items/i2/image.png".to_string(),
),
image_views: Vec::new(), image_views: Vec::new(),
model_src: None, model_src: None,
model_object_key: None, model_object_key: None,
@@ -1830,9 +1792,7 @@ use super::*;
let assets = vec![Match3DGeneratedItemAsset { let assets = vec![Match3DGeneratedItemAsset {
background_asset: Some(Match3DGeneratedBackgroundAsset { background_asset: Some(Match3DGeneratedBackgroundAsset {
prompt: "水果厨房背景".to_string(), prompt: "水果厨房背景".to_string(),
image_src: Some( image_src: Some("/generated-match3d-assets/session/profile/background.png".to_string()),
"/generated-match3d-assets/session/profile/background.png".to_string(),
),
image_object_key: Some( image_object_key: Some(
"generated-match3d-assets/session/profile/background.png".to_string(), "generated-match3d-assets/session/profile/background.png".to_string(),
), ),

View File

@@ -26,6 +26,7 @@ pub(super) async fn generate_match3d_material_sheet(
Ok(Match3DMaterialSheet { Ok(Match3DMaterialSheet {
task_id: generated.task_id, task_id: generated.task_id,
prompt,
image, image,
}) })
} }

View File

@@ -587,7 +587,10 @@ async fn load_match3d_container_reference_image() -> Result<OpenAiReferenceImage
}) })
} }
pub(super) fn build_match3d_background_generation_prompt(config: &Match3DConfigJson, prompt: &str) -> String { pub(super) fn build_match3d_background_generation_prompt(
config: &Match3DConfigJson,
prompt: &str,
) -> String {
let style_clause = resolve_match3d_asset_style_prompt(config) let style_clause = resolve_match3d_asset_style_prompt(config)
.map(|style| format!("整体美术风格参考:{style}")) .map(|style| format!("整体美术风格参考:{style}"))
.unwrap_or_default(); .unwrap_or_default();
@@ -596,7 +599,10 @@ pub(super) fn build_match3d_background_generation_prompt(config: &Match3DConfigJ
) )
} }
pub(super) fn build_match3d_container_generation_prompt(config: &Match3DConfigJson, prompt: &str) -> String { pub(super) fn build_match3d_container_generation_prompt(
config: &Match3DConfigJson,
prompt: &str,
) -> String {
let style_clause = resolve_match3d_asset_style_prompt(config) let style_clause = resolve_match3d_asset_style_prompt(config)
.map(|style| format!("整体美术风格参考:{style}")) .map(|style| format!("整体美术风格参考:{style}"))
.unwrap_or_default(); .unwrap_or_default();
@@ -1183,7 +1189,9 @@ pub(super) async fn persist_match3d_generated_bytes(
}) })
} }
pub(super) fn require_match3d_oss_client(state: &AppState) -> Result<&platform_oss::OssClient, AppError> { pub(super) fn require_match3d_oss_client(
state: &AppState,
) -> Result<&platform_oss::OssClient, AppError> {
state state
.oss_client() .oss_client()
.ok_or_else(|| match3d_oss_config_error(&state.config)) .ok_or_else(|| match3d_oss_config_error(&state.config))

View File

@@ -7,6 +7,7 @@ pub mod custom_world;
pub mod edutainment; pub mod edutainment;
pub mod health; pub mod health;
pub mod internal; pub mod internal;
pub mod jump_hop;
pub mod match3d; pub mod match3d;
pub mod platform; pub mod platform;
pub mod profile; pub mod profile;

View File

@@ -0,0 +1,76 @@
use axum::{
Router, middleware,
routing::{get, post},
};
use crate::{
auth::require_bearer_auth,
jump_hop::{
create_jump_hop_session, execute_jump_hop_action, get_jump_hop_gallery_detail,
get_jump_hop_runtime_work, get_jump_hop_session, jump_hop_run_jump, list_jump_hop_gallery,
publish_jump_hop_work, restart_jump_hop_run, start_jump_hop_run,
},
state::AppState,
};
pub fn router(state: AppState) -> Router<AppState> {
Router::new()
.route(
"/api/creation/jump-hop/sessions",
post(create_jump_hop_session).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/jump-hop/sessions/{session_id}",
get(get_jump_hop_session).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/jump-hop/sessions/{session_id}/actions",
post(execute_jump_hop_action).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/jump-hop/works/{profile_id}/publish",
post(publish_jump_hop_work).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/jump-hop/works/{profile_id}",
get(get_jump_hop_runtime_work),
)
.route(
"/api/runtime/jump-hop/runs",
post(start_jump_hop_run).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/jump-hop/runs/{run_id}/jump",
post(jump_hop_run_jump).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/jump-hop/runs/{run_id}/restart",
post(restart_jump_hop_run).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route("/api/runtime/jump-hop/gallery", get(list_jump_hop_gallery))
.route(
"/api/runtime/jump-hop/gallery/{public_work_code}",
get(get_jump_hop_gallery_detail),
)
}

View File

@@ -199,11 +199,9 @@ fn cpu_usage_ratio_between_samples(
#[cfg(windows)] #[cfg(windows)]
fn collect_process_metrics() -> Result<ProcessMetricsSnapshot, String> { fn collect_process_metrics() -> Result<ProcessMetricsSnapshot, String> {
use windows_sys::Win32::{ use windows_sys::Win32::System::{
System::{
ProcessStatus::{GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS_EX}, ProcessStatus::{GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS_EX},
Threading::{GetCurrentProcess, GetCurrentProcessId, GetProcessHandleCount}, Threading::{GetCurrentProcess, GetCurrentProcessId, GetProcessHandleCount},
},
}; };
let handle = unsafe { GetCurrentProcess() }; let handle = unsafe { GetCurrentProcess() };
@@ -212,11 +210,7 @@ fn collect_process_metrics() -> Result<ProcessMetricsSnapshot, String> {
..Default::default() ..Default::default()
}; };
let ok = unsafe { let ok = unsafe {
GetProcessMemoryInfo( GetProcessMemoryInfo(handle, std::ptr::addr_of_mut!(counters).cast(), counters.cb)
handle,
std::ptr::addr_of_mut!(counters).cast(),
counters.cb,
)
}; };
if ok == 0 { if ok == 0 {
return Err("GetProcessMemoryInfo returned false".to_string()); return Err("GetProcessMemoryInfo returned false".to_string());
@@ -244,10 +238,7 @@ fn collect_process_metrics() -> Result<ProcessMetricsSnapshot, String> {
#[cfg(windows)] #[cfg(windows)]
fn windows_process_cpu_time_seconds(handle: windows_sys::Win32::Foundation::HANDLE) -> Option<f64> { fn windows_process_cpu_time_seconds(handle: windows_sys::Win32::Foundation::HANDLE) -> Option<f64> {
use windows_sys::Win32::{ use windows_sys::Win32::{Foundation::FILETIME, System::Threading::GetProcessTimes};
Foundation::FILETIME,
System::Threading::GetProcessTimes,
};
let mut creation_time = FILETIME::default(); let mut creation_time = FILETIME::default();
let mut exit_time = FILETIME::default(); let mut exit_time = FILETIME::default();
@@ -337,8 +328,8 @@ fn collect_process_metrics() -> Result<ProcessMetricsSnapshot, String> {
.ok_or_else(|| "missing VmSize/statm size field".to_string())?; .ok_or_else(|| "missing VmSize/statm size field".to_string())?;
let private_bytes = parse_status_kb(&status, "VmData:").map(|value| value * 1024); let private_bytes = parse_status_kb(&status, "VmData:").map(|value| value * 1024);
let cpu_time_seconds = linux_cpu_time_seconds(&stat)?; let cpu_time_seconds = linux_cpu_time_seconds(&stat)?;
let thread_count = parse_status_u64(&status, "Threads:") let thread_count =
.ok_or_else(|| "missing Threads field".to_string())?; parse_status_u64(&status, "Threads:").ok_or_else(|| "missing Threads field".to_string())?;
Ok(ProcessMetricsSnapshot { Ok(ProcessMetricsSnapshot {
rss_bytes, rss_bytes,
@@ -427,11 +418,7 @@ fn parse_status_u64(status: &str, key: &str) -> Option<u64> {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn parse_statm_pages(statm: &str, index: usize) -> Option<u64> { fn parse_statm_pages(statm: &str, index: usize) -> Option<u64> {
statm statm.split_whitespace().nth(index)?.parse::<u64>().ok()
.split_whitespace()
.nth(index)?
.parse::<u64>()
.ok()
} }
#[cfg(not(any(windows, target_os = "linux")))] #[cfg(not(any(windows, target_os = "linux")))]

View File

@@ -2061,7 +2061,6 @@ fn map_sms_provider_error_to_phone_error(error: SmsProviderError) -> PhoneAuthEr
SmsProviderError::InvalidConfig(message) => { SmsProviderError::InvalidConfig(message) => {
PhoneAuthError::SmsProviderInvalidConfig(message) PhoneAuthError::SmsProviderInvalidConfig(message)
} }
SmsProviderError::InvalidVerifyCode => PhoneAuthError::InvalidVerifyCode,
SmsProviderError::Upstream(message) => PhoneAuthError::SmsProviderUpstream(message), SmsProviderError::Upstream(message) => PhoneAuthError::SmsProviderUpstream(message),
} }
} }

View File

@@ -0,0 +1,14 @@
[package]
name = "module-jump-hop"
edition.workspace = true
version.workspace = true
license.workspace = true
[features]
default = []
spacetime-types = ["dep:spacetimedb"]
[dependencies]
serde = { workspace = true }
shared-kernel = { workspace = true }
spacetimedb = { workspace = true, optional = true }

View File

@@ -0,0 +1,395 @@
use shared_kernel::normalize_required_string;
use crate::{
JumpHopDifficulty, JumpHopError, JumpHopJumpResultKind, JumpHopLastJump, JumpHopPath,
JumpHopPlatform, JumpHopRunSnapshot, JumpHopRunStatus, JumpHopScoring, JumpHopTileType,
};
pub fn generate_jump_hop_path(seed: &str, difficulty: JumpHopDifficulty) -> JumpHopPath {
let config = difficulty_config(difficulty);
let mut rng = DeterministicRng::new(seed, difficulty.as_str());
let platform_count = rng.range_u32(config.min_platforms, config.max_platforms) as usize;
let mut platforms = Vec::with_capacity(platform_count);
let mut x = 0.0f32;
let mut y = 0.0f32;
for index in 0..platform_count {
let tile_type = if index == 0 {
JumpHopTileType::Start
} else if index + 1 == platform_count {
JumpHopTileType::Finish
} else if index % 7 == 0 {
JumpHopTileType::Bonus
} else if index % 5 == 0 {
JumpHopTileType::Target
} else if index % 4 == 0 {
JumpHopTileType::Accent
} else {
JumpHopTileType::Normal
};
let width = rng.range_f32(config.min_width, config.max_width);
let height = width * rng.range_f32(0.86, 1.04);
let landing_radius = width * config.landing_radius_factor;
let perfect_radius = landing_radius * config.perfect_radius_factor;
platforms.push(JumpHopPlatform {
platform_id: format!("jump-hop-platform-{index:03}"),
tile_type,
x,
y,
width,
height,
landing_radius,
perfect_radius,
score_value: if tile_type == JumpHopTileType::Bonus {
180
} else {
100
},
});
if index + 1 < platform_count {
let distance = rng.range_f32(config.min_gap, config.max_gap);
let direction = if rng.next_u32() % 2 == 0 { 1.0 } else { -1.0 };
x += distance * 0.62 * direction;
y += distance;
}
}
JumpHopPath {
seed: seed.trim().to_string(),
difficulty,
finish_index: platform_count.saturating_sub(1) as u32,
platforms,
camera_preset: "portrait-isometric-9x16".to_string(),
scoring: JumpHopScoring {
charge_to_distance_ratio: config.charge_to_distance_ratio,
max_charge_ms: config.max_charge_ms,
hit_bonus: 20,
perfect_bonus: 60,
},
}
}
pub fn start_run(
run_id: String,
owner_user_id: String,
profile_id: String,
path: JumpHopPath,
started_at_ms: u64,
) -> Result<JumpHopRunSnapshot, JumpHopError> {
let run_id = normalize_required_string(run_id).ok_or(JumpHopError::MissingRunId)?;
let owner_user_id =
normalize_required_string(owner_user_id).ok_or(JumpHopError::MissingOwnerUserId)?;
let profile_id = normalize_required_string(profile_id).ok_or(JumpHopError::MissingProfileId)?;
if path.platforms.is_empty() {
return Err(JumpHopError::EmptyPath);
}
Ok(JumpHopRunSnapshot {
run_id,
profile_id,
owner_user_id,
status: JumpHopRunStatus::Playing,
current_platform_index: 0,
score: 0,
combo: 0,
last_jump: None,
started_at_ms,
finished_at_ms: None,
path,
})
}
pub fn apply_jump(
run: &JumpHopRunSnapshot,
charge_ms: u32,
jumped_at_ms: u64,
) -> Result<JumpHopRunSnapshot, JumpHopError> {
if run.status != JumpHopRunStatus::Playing {
return Err(JumpHopError::RunNotPlaying);
}
let current_index = run.current_platform_index as usize;
let next_index = current_index + 1;
let current = run
.path
.platforms
.get(current_index)
.ok_or(JumpHopError::EmptyPath)?;
let target = run
.path
.platforms
.get(next_index)
.ok_or(JumpHopError::NoNextPlatform)?;
let capped_charge = charge_ms.min(run.path.scoring.max_charge_ms);
let jump_distance = capped_charge as f32 * run.path.scoring.charge_to_distance_ratio;
let vector_x = target.x - current.x;
let vector_y = target.y - current.y;
let target_distance = vector_x.hypot(vector_y).max(0.0001);
let unit_x = vector_x / target_distance;
let unit_y = vector_y / target_distance;
let landed_x = current.x + unit_x * jump_distance;
let landed_y = current.y + unit_y * jump_distance;
let landing_error = (landed_x - target.x).hypot(landed_y - target.y);
let mut next = run.clone();
let result = if landing_error <= target.perfect_radius {
if next_index as u32 == run.path.finish_index {
JumpHopJumpResultKind::Finish
} else {
JumpHopJumpResultKind::Perfect
}
} else if landing_error <= target.landing_radius {
if next_index as u32 == run.path.finish_index {
JumpHopJumpResultKind::Finish
} else {
JumpHopJumpResultKind::Hit
}
} else {
JumpHopJumpResultKind::Miss
};
next.last_jump = Some(JumpHopLastJump {
charge_ms: capped_charge,
jump_distance,
target_platform_index: next_index as u32,
landed_x,
landed_y,
result,
});
if result == JumpHopJumpResultKind::Miss {
next.status = JumpHopRunStatus::Failed;
next.combo = 0;
next.finished_at_ms = Some(jumped_at_ms);
return Ok(next);
}
next.current_platform_index = next_index as u32;
next.combo = next.combo.saturating_add(1);
next.score = next.score.saturating_add(target.score_value);
if matches!(
result,
JumpHopJumpResultKind::Perfect | JumpHopJumpResultKind::Finish
) {
next.score = next
.score
.saturating_add(run.path.scoring.perfect_bonus)
.saturating_add(next.combo.saturating_mul(run.path.scoring.hit_bonus));
} else {
next.score = next.score.saturating_add(run.path.scoring.hit_bonus);
}
if result == JumpHopJumpResultKind::Finish {
next.status = JumpHopRunStatus::Cleared;
next.finished_at_ms = Some(jumped_at_ms);
}
Ok(next)
}
pub fn restart_run(
run: &JumpHopRunSnapshot,
next_run_id: String,
restarted_at_ms: u64,
) -> Result<JumpHopRunSnapshot, JumpHopError> {
start_run(
next_run_id,
run.owner_user_id.clone(),
run.profile_id.clone(),
run.path.clone(),
restarted_at_ms,
)
}
struct DifficultyConfig {
min_platforms: u32,
max_platforms: u32,
min_gap: f32,
max_gap: f32,
min_width: f32,
max_width: f32,
landing_radius_factor: f32,
perfect_radius_factor: f32,
charge_to_distance_ratio: f32,
max_charge_ms: u32,
}
fn difficulty_config(difficulty: JumpHopDifficulty) -> DifficultyConfig {
match difficulty {
JumpHopDifficulty::Easy => DifficultyConfig {
min_platforms: 12,
max_platforms: 14,
min_gap: 1.0,
max_gap: 1.45,
min_width: 0.9,
max_width: 1.08,
landing_radius_factor: 0.62,
perfect_radius_factor: 0.32,
charge_to_distance_ratio: 0.004,
max_charge_ms: 700,
},
JumpHopDifficulty::Standard => DifficultyConfig {
min_platforms: 16,
max_platforms: 18,
min_gap: 1.22,
max_gap: 1.78,
min_width: 0.82,
max_width: 1.0,
landing_radius_factor: 0.54,
perfect_radius_factor: 0.26,
charge_to_distance_ratio: 0.004,
max_charge_ms: 780,
},
JumpHopDifficulty::Advanced => DifficultyConfig {
min_platforms: 20,
max_platforms: 24,
min_gap: 1.45,
max_gap: 2.05,
min_width: 0.72,
max_width: 0.94,
landing_radius_factor: 0.48,
perfect_radius_factor: 0.22,
charge_to_distance_ratio: 0.004,
max_charge_ms: 860,
},
JumpHopDifficulty::Challenge => DifficultyConfig {
min_platforms: 26,
max_platforms: 32,
min_gap: 1.7,
max_gap: 2.35,
min_width: 0.66,
max_width: 0.88,
landing_radius_factor: 0.42,
perfect_radius_factor: 0.18,
charge_to_distance_ratio: 0.004,
max_charge_ms: 950,
},
}
}
struct DeterministicRng {
state: u64,
}
impl DeterministicRng {
fn new(seed: &str, salt: &str) -> Self {
let mut state = 0xcbf2_9ce4_8422_2325u64;
for byte in seed.bytes().chain(salt.bytes()) {
state ^= u64::from(byte);
state = state.wrapping_mul(0x1000_0000_01b3);
}
Self { state }
}
fn next_u32(&mut self) -> u32 {
self.state = self
.state
.wrapping_mul(6_364_136_223_846_793_005)
.wrapping_add(1);
(self.state >> 32) as u32
}
fn range_u32(&mut self, min: u32, max: u32) -> u32 {
if max <= min {
return min;
}
min + self.next_u32() % (max - min + 1)
}
fn range_f32(&mut self, min: f32, max: f32) -> f32 {
if max <= min {
return min;
}
let unit = self.next_u32() as f32 / u32::MAX as f32;
min + (max - min) * unit
}
}
#[cfg(test)]
mod tests {
use crate::{
JumpHopDifficulty, JumpHopJumpResultKind, JumpHopRunStatus, apply_jump,
generate_jump_hop_path, restart_run, start_run,
};
#[test]
fn path_generation_is_seeded_and_uses_difficulty_ranges() {
let first = generate_jump_hop_path("seed-a", JumpHopDifficulty::Standard);
let second = generate_jump_hop_path("seed-a", JumpHopDifficulty::Standard);
let challenge = generate_jump_hop_path("seed-a", JumpHopDifficulty::Challenge);
assert_eq!(first, second);
assert!((16..=18).contains(&first.platforms.len()));
assert!((26..=32).contains(&challenge.platforms.len()));
assert_eq!(first.platforms.first().unwrap().tile_type.as_str(), "start");
assert_eq!(first.platforms.last().unwrap().tile_type.as_str(), "finish");
}
#[test]
fn jump_resolution_distinguishes_perfect_hit_and_miss() {
let path = generate_jump_hop_path("seed-b", JumpHopDifficulty::Easy);
let run = start_run(
"run-1".to_string(),
"user-1".to_string(),
"profile-1".to_string(),
path,
100,
)
.expect("run should start");
let target = &run.path.platforms[1];
let distance = target.x.hypot(target.y);
let perfect_charge = (distance / run.path.scoring.charge_to_distance_ratio) as u32;
let perfect = apply_jump(&run, perfect_charge, 200).expect("jump should resolve");
assert_eq!(
perfect.last_jump.as_ref().unwrap().result,
JumpHopJumpResultKind::Perfect
);
assert_eq!(perfect.status, JumpHopRunStatus::Playing);
assert_eq!(perfect.current_platform_index, 1);
let hit = apply_jump(&run, perfect_charge.saturating_add(80), 200)
.expect("jump should resolve");
assert_eq!(
hit.last_jump.as_ref().unwrap().result,
JumpHopJumpResultKind::Hit
);
let miss = apply_jump(&run, perfect_charge.saturating_add(900), 200)
.expect("jump should resolve");
assert_eq!(miss.status, JumpHopRunStatus::Failed);
assert_eq!(
miss.last_jump.as_ref().unwrap().result,
JumpHopJumpResultKind::Miss
);
}
#[test]
fn restart_returns_to_first_platform_and_playing_state() {
let path = generate_jump_hop_path("seed-c", JumpHopDifficulty::Easy);
let mut run = start_run(
"run-1".to_string(),
"user-1".to_string(),
"profile-1".to_string(),
path,
100,
)
.expect("run should start");
run.status = JumpHopRunStatus::Failed;
run.current_platform_index = 3;
run.score = 300;
run.combo = 2;
run.finished_at_ms = Some(200);
let restarted = restart_run(&run, "run-2".to_string(), 300).expect("run should restart");
assert_eq!(restarted.run_id, "run-2");
assert_eq!(restarted.status, JumpHopRunStatus::Playing);
assert_eq!(restarted.current_platform_index, 0);
assert_eq!(restarted.score, 0);
assert_eq!(restarted.combo, 0);
assert!(restarted.last_jump.is_none());
assert_eq!(restarted.started_at_ms, 300);
assert!(restarted.finished_at_ms.is_none());
}
}

View File

@@ -0,0 +1,18 @@
use shared_kernel::normalize_required_string;
use crate::JumpHopDifficulty;
pub fn parse_jump_hop_difficulty(value: &str) -> JumpHopDifficulty {
match value.trim().to_ascii_lowercase().as_str() {
"easy" | "轻松" => JumpHopDifficulty::Easy,
"advanced" | "进阶" => JumpHopDifficulty::Advanced,
"challenge" | "挑战" => JumpHopDifficulty::Challenge,
_ => JumpHopDifficulty::Standard,
}
}
pub fn normalize_jump_hop_seed(seed: &str, fallback: &str) -> String {
normalize_required_string(seed)
.or_else(|| normalize_required_string(fallback))
.unwrap_or_else(|| "jump-hop".to_string())
}

View File

@@ -0,0 +1,151 @@
use serde::{Deserialize, Serialize};
#[cfg(feature = "spacetime-types")]
use spacetimedb::SpacetimeType;
pub const JUMP_HOP_SESSION_ID_PREFIX: &str = "jump-hop-session-";
pub const JUMP_HOP_PROFILE_ID_PREFIX: &str = "jump-hop-profile-";
pub const JUMP_HOP_WORK_ID_PREFIX: &str = "jump-hop-work-";
pub const JUMP_HOP_RUN_ID_PREFIX: &str = "jump-hop-run-";
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum JumpHopDifficulty {
Easy,
Standard,
Advanced,
Challenge,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum JumpHopTileType {
Start,
Normal,
Target,
Finish,
Bonus,
Accent,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum JumpHopRunStatus {
Playing,
Failed,
Cleared,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum JumpHopJumpResultKind {
Miss,
Hit,
Perfect,
Finish,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct JumpHopScoring {
pub charge_to_distance_ratio: f32,
pub max_charge_ms: u32,
pub hit_bonus: u32,
pub perfect_bonus: u32,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct JumpHopPlatform {
pub platform_id: String,
pub tile_type: JumpHopTileType,
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub landing_radius: f32,
pub perfect_radius: f32,
pub score_value: u32,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct JumpHopPath {
pub seed: String,
pub difficulty: JumpHopDifficulty,
pub platforms: Vec<JumpHopPlatform>,
pub finish_index: u32,
pub camera_preset: String,
pub scoring: JumpHopScoring,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct JumpHopLastJump {
pub charge_ms: u32,
pub jump_distance: f32,
pub target_platform_index: u32,
pub landed_x: f32,
pub landed_y: f32,
pub result: JumpHopJumpResultKind,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct JumpHopRunSnapshot {
pub run_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub status: JumpHopRunStatus,
pub current_platform_index: u32,
pub score: u32,
pub combo: u32,
pub last_jump: Option<JumpHopLastJump>,
pub started_at_ms: u64,
pub finished_at_ms: Option<u64>,
pub path: JumpHopPath,
}
impl JumpHopDifficulty {
pub fn as_str(self) -> &'static str {
match self {
Self::Easy => "easy",
Self::Standard => "standard",
Self::Advanced => "advanced",
Self::Challenge => "challenge",
}
}
}
impl JumpHopTileType {
pub fn as_str(self) -> &'static str {
match self {
Self::Start => "start",
Self::Normal => "normal",
Self::Target => "target",
Self::Finish => "finish",
Self::Bonus => "bonus",
Self::Accent => "accent",
}
}
}
impl JumpHopRunStatus {
pub fn as_str(self) -> &'static str {
match self {
Self::Playing => "playing",
Self::Failed => "failed",
Self::Cleared => "cleared",
}
}
}
impl JumpHopJumpResultKind {
pub fn as_str(self) -> &'static str {
match self {
Self::Miss => "miss",
Self::Hit => "hit",
Self::Perfect => "perfect",
Self::Finish => "finish",
}
}
}

View File

@@ -0,0 +1,27 @@
use std::fmt::{self, Display};
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum JumpHopError {
MissingRunId,
MissingProfileId,
MissingOwnerUserId,
EmptyPath,
RunNotPlaying,
NoNextPlatform,
}
impl Display for JumpHopError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let message = match self {
Self::MissingRunId => "缺少 runId",
Self::MissingProfileId => "缺少 profileId",
Self::MissingOwnerUserId => "owner_user_id 缺失",
Self::EmptyPath => "跳一跳路径为空",
Self::RunNotPlaying => "当前运行态不是 playing",
Self::NoNextPlatform => "没有下一块平台",
};
write!(f, "{message}")
}
}
impl std::error::Error for JumpHopError {}

View File

@@ -0,0 +1,23 @@
//! 跳一跳领域事件。
//!
//! 事件只表达已发生的领域事实,是否持久化、投影或广播由 SpacetimeDB adapter 决定。
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum JumpHopDomainEvent {
DraftCompiled {
profile_id: String,
owner_user_id: String,
occurred_at_micros: i64,
},
WorkPublished {
profile_id: String,
owner_user_id: String,
occurred_at_micros: i64,
},
RunSettled {
run_id: String,
owner_user_id: String,
status: String,
occurred_at_micros: i64,
},
}

View File

@@ -0,0 +1,11 @@
mod application;
mod commands;
mod domain;
mod errors;
mod events;
pub use application::*;
pub use commands::*;
pub use domain::*;
pub use errors::*;
pub use events::*;

View File

@@ -94,6 +94,17 @@ pub fn default_creation_entry_type_snapshots(
40, 40,
updated_at_micros, updated_at_micros,
), ),
build_default_creation_entry_type_snapshot(
"jump-hop",
"跳一跳",
"俯视角跳跃闯关",
"可创建",
"/creation-type-references/puzzle.webp",
true,
true,
45,
updated_at_micros,
),
build_default_creation_entry_type_snapshot( build_default_creation_entry_type_snapshot(
"square-hole", "square-hole",
"方洞", "方洞",

View File

@@ -0,0 +1,401 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum JumpHopDifficulty {
Easy,
Standard,
Advanced,
Challenge,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum JumpHopStylePreset {
MinimalBlocks,
PaperToy,
NeonGlass,
ForestStone,
FutureMetal,
Custom,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum JumpHopGenerationStatus {
Draft,
Generating,
Ready,
Failed,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum JumpHopTileType {
Start,
Normal,
Target,
Finish,
Bonus,
Accent,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum JumpHopActionType {
CompileDraft,
RegenerateCharacter,
RegenerateTiles,
UpdateWorkMeta,
UpdateDifficulty,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum JumpHopRunStatus {
Playing,
Failed,
Cleared,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum JumpHopJumpResult {
Miss,
Hit,
Perfect,
Finish,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopWorkspaceCreateRequest {
pub template_id: String,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub difficulty: JumpHopDifficulty,
pub style_preset: JumpHopStylePreset,
pub character_prompt: String,
pub tile_prompt: String,
#[serde(default)]
pub end_mood_prompt: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopActionRequest {
pub action_type: JumpHopActionType,
#[serde(default)]
pub work_title: Option<String>,
#[serde(default)]
pub work_description: Option<String>,
#[serde(default)]
pub theme_tags: Option<Vec<String>>,
#[serde(default)]
pub difficulty: Option<JumpHopDifficulty>,
#[serde(default)]
pub style_preset: Option<JumpHopStylePreset>,
#[serde(default)]
pub character_prompt: Option<String>,
#[serde(default)]
pub tile_prompt: Option<String>,
#[serde(default)]
pub end_mood_prompt: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopCharacterAsset {
pub asset_id: String,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub generation_provider: String,
pub prompt: String,
pub width: u32,
pub height: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopTileAsset {
pub tile_type: JumpHopTileType,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub source_atlas_cell: String,
pub visual_width: u32,
pub visual_height: u32,
pub top_surface_radius: f32,
pub landing_radius: f32,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopScoring {
pub charge_to_distance_ratio: f32,
pub max_charge_ms: u32,
pub hit_bonus: u32,
pub perfect_bonus: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopPlatform {
pub platform_id: String,
pub tile_type: JumpHopTileType,
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub landing_radius: f32,
pub perfect_radius: f32,
pub score_value: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopPath {
pub seed: String,
pub difficulty: JumpHopDifficulty,
pub platforms: Vec<JumpHopPlatform>,
pub finish_index: u32,
pub camera_preset: String,
pub scoring: JumpHopScoring,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopLastJump {
pub charge_ms: u32,
pub jump_distance: f32,
pub target_platform_index: u32,
pub landed_x: f32,
pub landed_y: f32,
pub result: JumpHopJumpResult,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopDraftResponse {
pub template_id: String,
pub template_name: String,
#[serde(default)]
pub profile_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub difficulty: JumpHopDifficulty,
pub style_preset: JumpHopStylePreset,
pub character_prompt: String,
pub tile_prompt: String,
#[serde(default)]
pub end_mood_prompt: Option<String>,
#[serde(default)]
pub character_asset: Option<JumpHopCharacterAsset>,
#[serde(default)]
pub tile_atlas_asset: Option<JumpHopCharacterAsset>,
#[serde(default)]
pub tile_assets: Vec<JumpHopTileAsset>,
#[serde(default)]
pub path: Option<JumpHopPath>,
#[serde(default)]
pub cover_composite: Option<String>,
pub generation_status: JumpHopGenerationStatus,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopSessionSnapshotResponse {
pub session_id: String,
pub owner_user_id: String,
pub status: JumpHopGenerationStatus,
#[serde(default)]
pub draft: Option<JumpHopDraftResponse>,
pub created_at: String,
pub updated_at: String,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopSessionResponse {
pub session: JumpHopSessionSnapshotResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopActionResponse {
pub action_type: JumpHopActionType,
pub session: JumpHopSessionSnapshotResponse,
#[serde(default)]
pub work: Option<JumpHopWorkProfileResponse>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopWorkSummaryResponse {
pub runtime_kind: String,
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
#[serde(default)]
pub source_session_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub difficulty: JumpHopDifficulty,
pub style_preset: JumpHopStylePreset,
#[serde(default)]
pub cover_image_src: Option<String>,
pub publication_status: String,
pub play_count: u32,
pub updated_at: String,
#[serde(default)]
pub published_at: Option<String>,
pub publish_ready: bool,
pub generation_status: JumpHopGenerationStatus,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopWorkProfileResponse {
#[serde(flatten)]
pub summary: JumpHopWorkSummaryResponse,
pub draft: JumpHopDraftResponse,
pub path: JumpHopPath,
pub character_asset: JumpHopCharacterAsset,
pub tile_atlas_asset: JumpHopCharacterAsset,
pub tile_assets: Vec<JumpHopTileAsset>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopWorksResponse {
pub items: Vec<JumpHopWorkSummaryResponse>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopWorkDetailResponse {
pub item: JumpHopWorkProfileResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopWorkMutationResponse {
pub item: JumpHopWorkProfileResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopGalleryCardResponse {
pub public_work_code: String,
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
#[serde(default)]
pub cover_image_src: Option<String>,
pub theme_tags: Vec<String>,
pub difficulty: JumpHopDifficulty,
pub style_preset: JumpHopStylePreset,
pub publication_status: String,
pub play_count: u32,
pub updated_at: String,
#[serde(default)]
pub published_at: Option<String>,
pub generation_status: JumpHopGenerationStatus,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopGalleryResponse {
pub items: Vec<JumpHopGalleryCardResponse>,
pub has_more: bool,
#[serde(default)]
pub next_cursor: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopGalleryDetailResponse {
pub item: JumpHopWorkProfileResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopRuntimeRunSnapshotResponse {
pub run_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub status: JumpHopRunStatus,
pub current_platform_index: u32,
pub score: u32,
pub combo: u32,
pub path: JumpHopPath,
#[serde(default)]
pub last_jump: Option<JumpHopLastJump>,
pub started_at_ms: u64,
#[serde(default)]
pub finished_at_ms: Option<u64>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopRunResponse {
pub run: JumpHopRuntimeRunSnapshotResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopStartRunRequest {
pub profile_id: String,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopJumpRequest {
pub charge_ms: u32,
pub client_event_id: String,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopRestartRunRequest {
pub client_action_id: String,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopJumpResponse {
pub run: JumpHopRuntimeRunSnapshotResponse,
}
#[cfg(test)]
mod tests {
use super::*;
use serde_json::json;
#[test]
fn jump_hop_workspace_request_uses_camel_case() {
let payload = serde_json::to_value(JumpHopWorkspaceCreateRequest {
template_id: "jump-hop".to_string(),
work_title: "跳一跳".to_string(),
work_description: "俯视角跳跃闯关".to_string(),
theme_tags: vec!["休闲".to_string()],
difficulty: JumpHopDifficulty::Easy,
style_preset: JumpHopStylePreset::MinimalBlocks,
character_prompt: "角色".to_string(),
tile_prompt: "地块".to_string(),
end_mood_prompt: None,
})
.expect("payload should serialize");
assert_eq!(payload["templateId"], json!("jump-hop"));
assert_eq!(payload["difficulty"], json!("easy"));
assert_eq!(payload["stylePreset"], json!("minimal-blocks"));
}
}

View File

@@ -12,6 +12,7 @@ pub mod creation_audio;
pub mod creation_entry_config; pub mod creation_entry_config;
pub mod creative_agent; pub mod creative_agent;
pub mod hyper3d; pub mod hyper3d;
pub mod jump_hop;
pub mod llm; pub mod llm;
pub mod match3d_agent; pub mod match3d_agent;
pub mod match3d_runtime; pub mod match3d_runtime;

View File

@@ -11,6 +11,7 @@ module-big-fish = { workspace = true }
module-combat = { workspace = true } module-combat = { workspace = true }
module-custom-world = { workspace = true } module-custom-world = { workspace = true }
module-inventory = { workspace = true } module-inventory = { workspace = true }
module-jump-hop = { workspace = true }
module-match3d = { workspace = true } module-match3d = { workspace = true }
module-npc = { workspace = true } module-npc = { workspace = true }
module-puzzle = { workspace = true } module-puzzle = { workspace = true }

File diff suppressed because it is too large Load Diff

View File

@@ -38,6 +38,16 @@ pub use mapper::{
Match3DRunClickRecordInput, Match3DRunRecord, Match3DRunRestartRecordInput, Match3DRunClickRecordInput, Match3DRunRecord, Match3DRunRestartRecordInput,
Match3DRunStartRecordInput, Match3DRunStopRecordInput, Match3DRunTimeUpRecordInput, Match3DRunStartRecordInput, Match3DRunStopRecordInput, Match3DRunTimeUpRecordInput,
Match3DTraySlotRecord, Match3DWorkProfileRecord, Match3DWorkUpdateRecordInput, Match3DTraySlotRecord, Match3DWorkProfileRecord, Match3DWorkUpdateRecordInput,
JumpHopActionRequest, JumpHopActionResponse, JumpHopActionType, JumpHopCharacterAsset,
JumpHopDifficulty, JumpHopDraftResponse, JumpHopGalleryCardResponse,
JumpHopGalleryDetailResponse, JumpHopGalleryResponse, JumpHopGenerationStatus,
JumpHopJumpRequest, JumpHopJumpResponse, JumpHopJumpResult, JumpHopLastJump, JumpHopPath,
JumpHopPlatform, JumpHopRestartRunRequest, JumpHopRunResponse, JumpHopRunStatus,
JumpHopRuntimeRunSnapshotResponse, JumpHopScoring, JumpHopSessionResponse,
JumpHopSessionSnapshotResponse, JumpHopStartRunRequest, JumpHopStylePreset, JumpHopTileAsset,
JumpHopTileType, JumpHopWorkDetailResponse, JumpHopWorkMutationResponse,
JumpHopWorkProfileResponse, JumpHopWorkSummaryResponse, JumpHopWorksResponse,
JumpHopWorkspaceCreateRequest,
NpcBattleInteractionRecord, NpcInteractionRecord, NpcStateRecord, NpcBattleInteractionRecord, NpcInteractionRecord, NpcStateRecord,
PuzzleAgentMessageFinalizeRecordInput, PuzzleAgentMessageRecord, PuzzleAgentMessageFinalizeRecordInput, PuzzleAgentMessageRecord,
PuzzleAgentMessageSubmitRecordInput, PuzzleAgentSessionCreateRecordInput, PuzzleAgentMessageSubmitRecordInput, PuzzleAgentSessionCreateRecordInput,
@@ -86,6 +96,7 @@ pub mod big_fish;
pub mod combat; pub mod combat;
pub mod custom_world; pub mod custom_world;
pub mod inventory; pub mod inventory;
pub mod jump_hop;
pub mod match3d; pub mod match3d;
pub mod npc; pub mod npc;
pub mod puzzle; pub mod puzzle;
@@ -551,6 +562,7 @@ impl SpacetimeClient {
let mut subscriptions = Vec::new(); let mut subscriptions = Vec::new();
for query in [ for query in [
"SELECT * FROM puzzle_gallery_card_view", "SELECT * FROM puzzle_gallery_card_view",
"SELECT * FROM jump_hop_gallery_card_view",
"SELECT * FROM custom_world_gallery_entry", "SELECT * FROM custom_world_gallery_entry",
"SELECT * FROM match_3_d_gallery_view", "SELECT * FROM match_3_d_gallery_view",
"SELECT * FROM square_hole_gallery_view", "SELECT * FROM square_hole_gallery_view",
@@ -565,6 +577,7 @@ impl SpacetimeClient {
for query in [ for query in [
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'puzzle'", "SELECT * FROM public_work_play_daily_stat WHERE source_type = 'puzzle'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'jump-hop'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'custom-world'", "SELECT * FROM public_work_play_daily_stat WHERE source_type = 'custom-world'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'match3d'", "SELECT * FROM public_work_play_daily_stat WHERE source_type = 'match3d'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'square-hole'", "SELECT * FROM public_work_play_daily_stat WHERE source_type = 'square-hole'",

View File

@@ -9,6 +9,7 @@ mod combat;
mod common; mod common;
mod custom_world; mod custom_world;
mod inventory; mod inventory;
mod jump_hop;
mod match3d; mod match3d;
mod npc; mod npc;
mod puzzle; mod puzzle;
@@ -35,6 +36,18 @@ pub use self::combat::{
BarkBattleDraftConfigRecord, BarkBattleRunRecord, BarkBattleRuntimeConfigRecord, BarkBattleDraftConfigRecord, BarkBattleRunRecord, BarkBattleRuntimeConfigRecord,
ResolveCombatActionRecord, ResolveCombatActionRecord,
}; };
pub use self::jump_hop::{
JumpHopActionRequest, JumpHopActionResponse, JumpHopActionType, JumpHopCharacterAsset,
JumpHopDifficulty, JumpHopDraftResponse, JumpHopGalleryCardResponse,
JumpHopGalleryDetailResponse, JumpHopGalleryResponse, JumpHopGenerationStatus,
JumpHopJumpRequest, JumpHopJumpResponse, JumpHopJumpResult, JumpHopLastJump, JumpHopPath,
JumpHopPlatform, JumpHopRestartRunRequest, JumpHopRunResponse, JumpHopRunStatus,
JumpHopRuntimeRunSnapshotResponse, JumpHopScoring, JumpHopSessionResponse,
JumpHopSessionSnapshotResponse, JumpHopStartRunRequest, JumpHopStylePreset, JumpHopTileAsset,
JumpHopTileType, JumpHopWorkDetailResponse, JumpHopWorkMutationResponse,
JumpHopWorkProfileResponse, JumpHopWorkSummaryResponse, JumpHopWorksResponse,
JumpHopWorkspaceCreateRequest,
};
pub use self::common::{ pub use self::common::{
BigFishAgentMessageRecord, BigFishAnchorItemRecord, BigFishAnchorPackRecord, BigFishAgentMessageRecord, BigFishAnchorItemRecord, BigFishAnchorPackRecord,
BigFishBackgroundBlueprintRecord, BigFishDraftCompileRecordInput, BigFishBackgroundBlueprintRecord, BigFishDraftCompileRecordInput,
@@ -139,6 +152,11 @@ pub(crate) use self::inventory::{
map_runtime_inventory_state_procedure_result, map_runtime_item_reward_item_snapshot, map_runtime_inventory_state_procedure_result, map_runtime_item_reward_item_snapshot,
map_runtime_item_reward_item_snapshot_back, map_runtime_item_reward_item_snapshot_back,
}; };
pub(crate) use self::jump_hop::{
map_jump_hop_agent_session_procedure_result, map_jump_hop_gallery_card_view_row,
map_jump_hop_run_procedure_result, map_jump_hop_work_procedure_result,
map_jump_hop_works_procedure_result,
};
pub(crate) use self::match3d::{ pub(crate) use self::match3d::{
map_match3d_agent_session_procedure_result, map_match3d_click_item_procedure_result, map_match3d_agent_session_procedure_result, map_match3d_click_item_procedure_result,
map_match3d_gallery_view_row, map_match3d_run_procedure_result, map_match3d_gallery_view_row, map_match3d_run_procedure_result,
@@ -158,9 +176,9 @@ pub(crate) use self::runtime::{
build_creation_entry_config_record_from_rows, map_creation_entry_config_procedure_result, build_creation_entry_config_record_from_rows, map_creation_entry_config_procedure_result,
map_runtime_setting_procedure_result, map_runtime_snapshot_delete_procedure_result, map_runtime_setting_procedure_result, map_runtime_snapshot_delete_procedure_result,
map_runtime_snapshot_procedure_result, map_runtime_snapshot_required_procedure_result, map_runtime_snapshot_procedure_result, map_runtime_snapshot_required_procedure_result,
map_runtime_tracking_event_procedure_result, map_runtime_tracking_scope_kind, map_runtime_tracking_event_batch_procedure_result, map_runtime_tracking_event_procedure_result,
map_runtime_tracking_scope_kind_back, parse_json_array, parse_json_string_array, map_runtime_tracking_scope_kind, map_runtime_tracking_scope_kind_back, parse_json_array,
parse_json_value, parse_supported_actions_json, parse_json_string_array, parse_json_value, parse_supported_actions_json,
}; };
pub(crate) use self::runtime_profile::{ pub(crate) use self::runtime_profile::{
map_analytics_metric_query_procedure_result, map_runtime_profile_dashboard_procedure_result, map_analytics_metric_query_procedure_result, map_runtime_profile_dashboard_procedure_result,

View File

@@ -0,0 +1,344 @@
use super::*;
pub use shared_contracts::jump_hop::{
JumpHopActionRequest, JumpHopActionResponse, JumpHopActionType, JumpHopCharacterAsset,
JumpHopDifficulty, JumpHopDraftResponse, JumpHopGalleryCardResponse,
JumpHopGalleryDetailResponse, JumpHopGalleryResponse, JumpHopGenerationStatus,
JumpHopJumpRequest, JumpHopJumpResponse, JumpHopJumpResult, JumpHopLastJump, JumpHopPath,
JumpHopPlatform, JumpHopRestartRunRequest, JumpHopRunResponse, JumpHopRunStatus,
JumpHopRuntimeRunSnapshotResponse, JumpHopScoring, JumpHopSessionResponse,
JumpHopSessionSnapshotResponse, JumpHopStartRunRequest, JumpHopStylePreset, JumpHopTileAsset,
JumpHopTileType, JumpHopWorkDetailResponse, JumpHopWorkMutationResponse,
JumpHopWorkProfileResponse, JumpHopWorkSummaryResponse, JumpHopWorksResponse,
JumpHopWorkspaceCreateRequest,
};
pub(crate) fn map_jump_hop_agent_session_procedure_result(
result: JumpHopAgentSessionProcedureResult,
) -> Result<JumpHopSessionSnapshotResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let session = result
.session
.ok_or_else(|| SpacetimeClientError::missing_snapshot("jump hop agent session 快照"))?;
Ok(map_jump_hop_session_snapshot(session))
}
pub(crate) fn map_jump_hop_work_procedure_result(
result: JumpHopWorkProcedureResult,
) -> Result<JumpHopWorkProfileResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let work = result
.work
.ok_or_else(|| SpacetimeClientError::missing_snapshot("jump hop work 快照"))?;
map_jump_hop_work_snapshot(work)
}
pub(crate) fn map_jump_hop_works_procedure_result(
result: JumpHopWorksProcedureResult,
) -> Result<Vec<JumpHopWorkProfileResponse>, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
result
.items
.into_iter()
.map(map_jump_hop_work_snapshot)
.collect()
}
pub(crate) fn map_jump_hop_run_procedure_result(
result: JumpHopRunProcedureResult,
) -> Result<JumpHopRuntimeRunSnapshotResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let run = result
.run
.ok_or_else(|| SpacetimeClientError::missing_snapshot("jump hop run 快照"))?;
Ok(map_jump_hop_run_snapshot(run))
}
pub(crate) fn map_jump_hop_gallery_card_view_row(
row: JumpHopGalleryCardViewRow,
) -> JumpHopGalleryCardResponse {
JumpHopGalleryCardResponse {
public_work_code: row.public_work_code,
work_id: row.work_id,
profile_id: row.profile_id,
owner_user_id: row.owner_user_id,
author_display_name: row.author_display_name,
work_title: row.work_title,
work_description: row.work_description,
cover_image_src: empty_string_to_none(row.cover_image_src),
theme_tags: row.theme_tags,
difficulty: parse_difficulty(&row.difficulty),
style_preset: parse_style_preset(&row.style_preset),
publication_status: normalize_publication_status(&row.publication_status).to_string(),
play_count: row.play_count,
updated_at: format_timestamp_micros(row.updated_at_micros),
published_at: row.published_at_micros.map(format_timestamp_micros),
generation_status: parse_generation_status(&row.generation_status),
}
}
fn map_jump_hop_session_snapshot(
snapshot: JumpHopAgentSessionSnapshot,
) -> JumpHopSessionSnapshotResponse {
JumpHopSessionSnapshotResponse {
session_id: snapshot.session_id,
owner_user_id: snapshot.owner_user_id,
status: snapshot
.draft
.as_ref()
.map(|draft| parse_generation_status(&draft.generation_status))
.unwrap_or(JumpHopGenerationStatus::Draft),
draft: snapshot.draft.map(map_jump_hop_draft_snapshot),
created_at: format_timestamp_micros(snapshot.created_at_micros),
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
}
}
fn map_jump_hop_work_snapshot(
snapshot: JumpHopWorkSnapshot,
) -> Result<JumpHopWorkProfileResponse, SpacetimeClientError> {
let draft = JumpHopDraftResponse {
template_id: "jump-hop".to_string(),
template_name: "跳一跳".to_string(),
profile_id: Some(snapshot.profile_id.clone()),
work_title: snapshot.work_title.clone(),
work_description: snapshot.work_description.clone(),
theme_tags: snapshot.theme_tags.clone(),
difficulty: parse_difficulty(&snapshot.difficulty),
style_preset: parse_style_preset(&snapshot.style_preset),
character_prompt: snapshot.character_prompt.clone(),
tile_prompt: snapshot.tile_prompt.clone(),
end_mood_prompt: snapshot.end_mood_prompt.clone(),
character_asset: snapshot.character_asset.clone().map(map_character_asset),
tile_atlas_asset: snapshot.tile_atlas_asset.clone().map(map_character_asset),
tile_assets: snapshot
.tile_assets
.clone()
.into_iter()
.map(map_tile_asset)
.collect(),
path: Some(map_jump_hop_path(snapshot.path.clone())),
cover_composite: snapshot.cover_composite.clone(),
generation_status: parse_generation_status(&snapshot.generation_status),
};
let character_asset = draft
.character_asset
.clone()
.ok_or_else(|| SpacetimeClientError::missing_snapshot("jump hop character asset"))?;
let tile_atlas_asset = draft
.tile_atlas_asset
.clone()
.ok_or_else(|| SpacetimeClientError::missing_snapshot("jump hop tile atlas asset"))?;
Ok(JumpHopWorkProfileResponse {
summary: JumpHopWorkSummaryResponse {
runtime_kind: "jump-hop".to_string(),
work_id: snapshot.work_id,
profile_id: snapshot.profile_id,
owner_user_id: snapshot.owner_user_id,
source_session_id: empty_string_to_none(snapshot.source_session_id),
work_title: snapshot.work_title,
work_description: snapshot.work_description,
theme_tags: snapshot.theme_tags,
difficulty: parse_difficulty(&snapshot.difficulty),
style_preset: parse_style_preset(&snapshot.style_preset),
cover_image_src: empty_string_to_none(snapshot.cover_image_src),
publication_status: normalize_publication_status(&snapshot.publication_status)
.to_string(),
play_count: snapshot.play_count,
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
published_at: snapshot.published_at_micros.map(format_timestamp_micros),
publish_ready: snapshot.publish_ready,
generation_status: parse_generation_status(&snapshot.generation_status),
},
draft,
path: map_jump_hop_path(snapshot.path),
character_asset,
tile_atlas_asset,
tile_assets: snapshot.tile_assets.into_iter().map(map_tile_asset).collect(),
})
}
fn map_jump_hop_draft_snapshot(snapshot: JumpHopDraftSnapshot) -> JumpHopDraftResponse {
JumpHopDraftResponse {
template_id: snapshot.template_id,
template_name: snapshot.template_name,
profile_id: snapshot.profile_id,
work_title: snapshot.work_title,
work_description: snapshot.work_description,
theme_tags: snapshot.theme_tags,
difficulty: parse_difficulty(&snapshot.difficulty),
style_preset: parse_style_preset(&snapshot.style_preset),
character_prompt: snapshot.character_prompt,
tile_prompt: snapshot.tile_prompt,
end_mood_prompt: snapshot.end_mood_prompt,
character_asset: snapshot.character_asset.map(map_character_asset),
tile_atlas_asset: snapshot.tile_atlas_asset.map(map_character_asset),
tile_assets: snapshot.tile_assets.into_iter().map(map_tile_asset).collect(),
path: snapshot.path.map(map_jump_hop_path),
cover_composite: snapshot.cover_composite,
generation_status: parse_generation_status(&snapshot.generation_status),
}
}
fn map_character_asset(snapshot: JumpHopCharacterAssetSnapshot) -> JumpHopCharacterAsset {
JumpHopCharacterAsset {
asset_id: snapshot.asset_id,
image_src: snapshot.image_src,
image_object_key: snapshot.image_object_key,
asset_object_id: snapshot.asset_object_id,
generation_provider: snapshot.generation_provider,
prompt: snapshot.prompt,
width: snapshot.width,
height: snapshot.height,
}
}
fn map_tile_asset(snapshot: JumpHopTileAssetSnapshot) -> JumpHopTileAsset {
JumpHopTileAsset {
tile_type: parse_tile_type(&snapshot.tile_type),
image_src: snapshot.image_src,
image_object_key: snapshot.image_object_key,
asset_object_id: snapshot.asset_object_id,
source_atlas_cell: snapshot.source_atlas_cell,
visual_width: snapshot.visual_width,
visual_height: snapshot.visual_height,
top_surface_radius: snapshot.top_surface_radius,
landing_radius: snapshot.landing_radius,
}
}
fn map_jump_hop_path(snapshot: crate::module_bindings::JumpHopPath) -> JumpHopPath {
JumpHopPath {
seed: snapshot.seed,
difficulty: parse_domain_difficulty(snapshot.difficulty),
platforms: snapshot
.platforms
.into_iter()
.map(|platform| JumpHopPlatform {
platform_id: platform.platform_id,
tile_type: parse_domain_tile_type(platform.tile_type),
x: platform.x,
y: platform.y,
width: platform.width,
height: platform.height,
landing_radius: platform.landing_radius,
perfect_radius: platform.perfect_radius,
score_value: platform.score_value,
})
.collect(),
finish_index: snapshot.finish_index,
camera_preset: snapshot.camera_preset,
scoring: JumpHopScoring {
charge_to_distance_ratio: snapshot.scoring.charge_to_distance_ratio,
max_charge_ms: snapshot.scoring.max_charge_ms,
hit_bonus: snapshot.scoring.hit_bonus,
perfect_bonus: snapshot.scoring.perfect_bonus,
},
}
}
fn map_jump_hop_run_snapshot(snapshot: JumpHopRunSnapshot) -> JumpHopRuntimeRunSnapshotResponse {
JumpHopRuntimeRunSnapshotResponse {
run_id: snapshot.run_id,
profile_id: snapshot.profile_id,
owner_user_id: snapshot.owner_user_id,
status: match snapshot.status {
crate::module_bindings::JumpHopRunStatus::Failed => JumpHopRunStatus::Failed,
crate::module_bindings::JumpHopRunStatus::Cleared => JumpHopRunStatus::Cleared,
crate::module_bindings::JumpHopRunStatus::Playing => JumpHopRunStatus::Playing,
},
current_platform_index: snapshot.current_platform_index,
score: snapshot.score,
combo: snapshot.combo,
path: map_jump_hop_path(snapshot.path),
last_jump: snapshot.last_jump.map(|jump| JumpHopLastJump {
charge_ms: jump.charge_ms,
jump_distance: jump.jump_distance,
target_platform_index: jump.target_platform_index,
landed_x: jump.landed_x,
landed_y: jump.landed_y,
result: match jump.result {
crate::module_bindings::JumpHopJumpResultKind::Miss => JumpHopJumpResult::Miss,
crate::module_bindings::JumpHopJumpResultKind::Hit => JumpHopJumpResult::Hit,
crate::module_bindings::JumpHopJumpResultKind::Finish => JumpHopJumpResult::Finish,
crate::module_bindings::JumpHopJumpResultKind::Perfect => JumpHopJumpResult::Perfect,
},
}),
started_at_ms: snapshot.started_at_ms,
finished_at_ms: snapshot.finished_at_ms,
}
}
fn parse_difficulty(value: &str) -> JumpHopDifficulty {
match value {
"easy" => JumpHopDifficulty::Easy,
"advanced" => JumpHopDifficulty::Advanced,
"challenge" => JumpHopDifficulty::Challenge,
_ => JumpHopDifficulty::Standard,
}
}
fn parse_domain_difficulty(value: crate::module_bindings::JumpHopDifficulty) -> JumpHopDifficulty {
match value {
crate::module_bindings::JumpHopDifficulty::Easy => JumpHopDifficulty::Easy,
crate::module_bindings::JumpHopDifficulty::Advanced => JumpHopDifficulty::Advanced,
crate::module_bindings::JumpHopDifficulty::Challenge => JumpHopDifficulty::Challenge,
crate::module_bindings::JumpHopDifficulty::Standard => JumpHopDifficulty::Standard,
}
}
fn parse_style_preset(value: &str) -> JumpHopStylePreset {
match value {
"paper-toy" => JumpHopStylePreset::PaperToy,
"neon-glass" => JumpHopStylePreset::NeonGlass,
"forest-stone" => JumpHopStylePreset::ForestStone,
"future-metal" => JumpHopStylePreset::FutureMetal,
"custom" => JumpHopStylePreset::Custom,
_ => JumpHopStylePreset::MinimalBlocks,
}
}
fn parse_tile_type(value: &str) -> JumpHopTileType {
match value {
"start" => JumpHopTileType::Start,
"target" => JumpHopTileType::Target,
"finish" => JumpHopTileType::Finish,
"bonus" => JumpHopTileType::Bonus,
"accent" => JumpHopTileType::Accent,
_ => JumpHopTileType::Normal,
}
}
fn parse_domain_tile_type(value: crate::module_bindings::JumpHopTileType) -> JumpHopTileType {
match value {
crate::module_bindings::JumpHopTileType::Start => JumpHopTileType::Start,
crate::module_bindings::JumpHopTileType::Target => JumpHopTileType::Target,
crate::module_bindings::JumpHopTileType::Finish => JumpHopTileType::Finish,
crate::module_bindings::JumpHopTileType::Bonus => JumpHopTileType::Bonus,
crate::module_bindings::JumpHopTileType::Accent => JumpHopTileType::Accent,
crate::module_bindings::JumpHopTileType::Normal => JumpHopTileType::Normal,
}
}
fn parse_generation_status(value: &str) -> JumpHopGenerationStatus {
match value {
"generating" => JumpHopGenerationStatus::Generating,
"ready" => JumpHopGenerationStatus::Ready,
"failed" => JumpHopGenerationStatus::Failed,
_ => JumpHopGenerationStatus::Draft,
}
}
fn normalize_publication_status(value: &str) -> &str {
match value {
"Published" | "published" => "published",
_ => "draft",
}
}

View File

@@ -213,6 +213,16 @@ pub(crate) fn map_runtime_tracking_event_procedure_result(
Ok(()) Ok(())
} }
pub(crate) fn map_runtime_tracking_event_batch_procedure_result(
result: RuntimeTrackingEventBatchProcedureResult,
) -> Result<u32, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
Ok(result.accepted_count)
}
pub(crate) fn map_runtime_snapshot_procedure_result( pub(crate) fn map_runtime_snapshot_procedure_result(
result: RuntimeSnapshotProcedureResult, result: RuntimeSnapshotProcedureResult,
) -> Result<Option<RuntimeSnapshotRecord>, SpacetimeClientError> { ) -> Result<Option<RuntimeSnapshotRecord>, SpacetimeClientError> {

View File

@@ -1,7 +1,7 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
// This was generated using spacetimedb cli version 2.2.0 (commit eb11e2f5c41dce6979715ad407996270d61329f6). // This was generated using spacetimedb cli version 2.1.0 (commit 6981f48b4bc1a71c8dd9bdfe5a2c343f6370243d).
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
@@ -199,6 +199,7 @@ pub mod click_match_3_d_item_procedure;
pub mod combat_outcome_type; pub mod combat_outcome_type;
pub mod compile_big_fish_draft_procedure; pub mod compile_big_fish_draft_procedure;
pub mod compile_custom_world_published_profile_procedure; pub mod compile_custom_world_published_profile_procedure;
pub mod compile_jump_hop_draft_procedure;
pub mod compile_match_3_d_draft_procedure; pub mod compile_match_3_d_draft_procedure;
pub mod compile_puzzle_agent_draft_procedure; pub mod compile_puzzle_agent_draft_procedure;
pub mod compile_square_hole_draft_procedure; pub mod compile_square_hole_draft_procedure;
@@ -218,6 +219,7 @@ pub mod create_battle_state_and_return_procedure;
pub mod create_battle_state_reducer; pub mod create_battle_state_reducer;
pub mod create_big_fish_session_procedure; pub mod create_big_fish_session_procedure;
pub mod create_custom_world_agent_session_procedure; pub mod create_custom_world_agent_session_procedure;
pub mod create_jump_hop_agent_session_procedure;
pub mod create_match_3_d_agent_session_procedure; pub mod create_match_3_d_agent_session_procedure;
pub mod create_profile_recharge_order_and_return_procedure; pub mod create_profile_recharge_order_and_return_procedure;
pub mod create_puzzle_agent_session_procedure; pub mod create_puzzle_agent_session_procedure;
@@ -349,6 +351,9 @@ pub mod get_custom_world_agent_session_procedure;
pub mod get_custom_world_gallery_detail_by_code_procedure; pub mod get_custom_world_gallery_detail_by_code_procedure;
pub mod get_custom_world_gallery_detail_procedure; pub mod get_custom_world_gallery_detail_procedure;
pub mod get_custom_world_library_detail_procedure; pub mod get_custom_world_library_detail_procedure;
pub mod get_jump_hop_agent_session_procedure;
pub mod get_jump_hop_run_procedure;
pub mod get_jump_hop_work_profile_procedure;
pub mod get_match_3_d_agent_session_procedure; pub mod get_match_3_d_agent_session_procedure;
pub mod get_match_3_d_run_procedure; pub mod get_match_3_d_run_procedure;
pub mod get_match_3_d_work_detail_procedure; pub mod get_match_3_d_work_detail_procedure;
@@ -393,11 +398,55 @@ pub mod inventory_mutation_type;
pub mod inventory_slot_snapshot_type; pub mod inventory_slot_snapshot_type;
pub mod inventory_slot_table; pub mod inventory_slot_table;
pub mod inventory_slot_type; pub mod inventory_slot_type;
pub mod jump_hop_agent_session_create_input_type;
pub mod jump_hop_agent_session_get_input_type;
pub mod jump_hop_agent_session_procedure_result_type;
pub mod jump_hop_agent_session_row_type;
pub mod jump_hop_agent_session_snapshot_type;
pub mod jump_hop_agent_session_table;
pub mod jump_hop_character_asset_snapshot_type;
pub mod jump_hop_creator_config_snapshot_type;
pub mod jump_hop_difficulty_type;
pub mod jump_hop_draft_compile_input_type;
pub mod jump_hop_draft_snapshot_type;
pub mod jump_hop_event_row_type;
pub mod jump_hop_event_table;
pub mod jump_hop_gallery_card_view_row_type;
pub mod jump_hop_gallery_card_view_table;
pub mod jump_hop_gallery_view_row_type;
pub mod jump_hop_gallery_view_table;
pub mod jump_hop_jump_procedure;
pub mod jump_hop_jump_result_kind_type;
pub mod jump_hop_last_jump_type;
pub mod jump_hop_path_type;
pub mod jump_hop_platform_type;
pub mod jump_hop_run_get_input_type;
pub mod jump_hop_run_jump_input_type;
pub mod jump_hop_run_procedure_result_type;
pub mod jump_hop_run_restart_input_type;
pub mod jump_hop_run_snapshot_type;
pub mod jump_hop_run_start_input_type;
pub mod jump_hop_run_status_type;
pub mod jump_hop_runtime_run_row_type;
pub mod jump_hop_runtime_run_table;
pub mod jump_hop_scoring_type;
pub mod jump_hop_tile_asset_snapshot_type;
pub mod jump_hop_tile_type_type;
pub mod jump_hop_work_get_input_type;
pub mod jump_hop_work_procedure_result_type;
pub mod jump_hop_work_profile_row_type;
pub mod jump_hop_work_profile_table;
pub mod jump_hop_work_publish_input_type;
pub mod jump_hop_work_snapshot_type;
pub mod jump_hop_work_update_input_type;
pub mod jump_hop_works_list_input_type;
pub mod jump_hop_works_procedure_result_type;
pub mod list_asset_history_and_return_procedure; pub mod list_asset_history_and_return_procedure;
pub mod list_big_fish_works_procedure; pub mod list_big_fish_works_procedure;
pub mod list_custom_world_gallery_entries_procedure; pub mod list_custom_world_gallery_entries_procedure;
pub mod list_custom_world_profiles_procedure; pub mod list_custom_world_profiles_procedure;
pub mod list_custom_world_works_procedure; pub mod list_custom_world_works_procedure;
pub mod list_jump_hop_works_procedure;
pub mod list_match_3_d_works_procedure; pub mod list_match_3_d_works_procedure;
pub mod list_platform_browse_history_procedure; pub mod list_platform_browse_history_procedure;
pub mod list_profile_save_archives_procedure; pub mod list_profile_save_archives_procedure;
@@ -508,6 +557,7 @@ pub mod publish_big_fish_game_procedure;
pub mod publish_custom_world_profile_and_return_procedure; pub mod publish_custom_world_profile_and_return_procedure;
pub mod publish_custom_world_profile_reducer; pub mod publish_custom_world_profile_reducer;
pub mod publish_custom_world_world_procedure; pub mod publish_custom_world_world_procedure;
pub mod publish_jump_hop_work_procedure;
pub mod publish_match_3_d_work_procedure; pub mod publish_match_3_d_work_procedure;
pub mod publish_puzzle_work_procedure; pub mod publish_puzzle_work_procedure;
pub mod publish_square_hole_work_procedure; pub mod publish_square_hole_work_procedure;
@@ -649,6 +699,7 @@ pub mod resolve_npc_social_action_input_type;
pub mod resolve_npc_social_action_reducer; pub mod resolve_npc_social_action_reducer;
pub mod resolve_treasure_interaction_and_return_procedure; pub mod resolve_treasure_interaction_and_return_procedure;
pub mod resolve_treasure_interaction_reducer; pub mod resolve_treasure_interaction_reducer;
pub mod restart_jump_hop_run_procedure;
pub mod restart_match_3_d_run_procedure; pub mod restart_match_3_d_run_procedure;
pub mod restart_square_hole_run_procedure; pub mod restart_square_hole_run_procedure;
pub mod resume_profile_save_archive_and_return_procedure; pub mod resume_profile_save_archive_and_return_procedure;
@@ -820,6 +871,7 @@ pub mod start_ai_task_reducer;
pub mod start_ai_task_stage_reducer; pub mod start_ai_task_stage_reducer;
pub mod start_bark_battle_run_procedure; pub mod start_bark_battle_run_procedure;
pub mod start_big_fish_run_procedure; pub mod start_big_fish_run_procedure;
pub mod start_jump_hop_run_procedure;
pub mod start_match_3_d_run_procedure; pub mod start_match_3_d_run_procedure;
pub mod start_puzzle_run_procedure; pub mod start_puzzle_run_procedure;
pub mod start_square_hole_run_procedure; pub mod start_square_hole_run_procedure;
@@ -864,6 +916,7 @@ pub mod unequip_inventory_item_input_type;
pub mod unpublish_custom_world_profile_and_return_procedure; pub mod unpublish_custom_world_profile_and_return_procedure;
pub mod unpublish_custom_world_profile_reducer; pub mod unpublish_custom_world_profile_reducer;
pub mod update_bark_battle_draft_config_procedure; pub mod update_bark_battle_draft_config_procedure;
pub mod update_jump_hop_work_procedure;
pub mod update_match_3_d_work_procedure; pub mod update_match_3_d_work_procedure;
pub mod update_puzzle_run_pause_procedure; pub mod update_puzzle_run_pause_procedure;
pub mod update_puzzle_work_procedure; pub mod update_puzzle_work_procedure;
@@ -1125,6 +1178,7 @@ pub use click_match_3_d_item_procedure::click_match_3_d_item;
pub use combat_outcome_type::CombatOutcome; pub use combat_outcome_type::CombatOutcome;
pub use compile_big_fish_draft_procedure::compile_big_fish_draft; pub use compile_big_fish_draft_procedure::compile_big_fish_draft;
pub use compile_custom_world_published_profile_procedure::compile_custom_world_published_profile; pub use compile_custom_world_published_profile_procedure::compile_custom_world_published_profile;
pub use compile_jump_hop_draft_procedure::compile_jump_hop_draft;
pub use compile_match_3_d_draft_procedure::compile_match_3_d_draft; pub use compile_match_3_d_draft_procedure::compile_match_3_d_draft;
pub use compile_puzzle_agent_draft_procedure::compile_puzzle_agent_draft; pub use compile_puzzle_agent_draft_procedure::compile_puzzle_agent_draft;
pub use compile_square_hole_draft_procedure::compile_square_hole_draft; pub use compile_square_hole_draft_procedure::compile_square_hole_draft;
@@ -1144,6 +1198,7 @@ pub use create_battle_state_and_return_procedure::create_battle_state_and_return
pub use create_battle_state_reducer::create_battle_state; pub use create_battle_state_reducer::create_battle_state;
pub use create_big_fish_session_procedure::create_big_fish_session; pub use create_big_fish_session_procedure::create_big_fish_session;
pub use create_custom_world_agent_session_procedure::create_custom_world_agent_session; pub use create_custom_world_agent_session_procedure::create_custom_world_agent_session;
pub use create_jump_hop_agent_session_procedure::create_jump_hop_agent_session;
pub use create_match_3_d_agent_session_procedure::create_match_3_d_agent_session; pub use create_match_3_d_agent_session_procedure::create_match_3_d_agent_session;
pub use create_profile_recharge_order_and_return_procedure::create_profile_recharge_order_and_return; pub use create_profile_recharge_order_and_return_procedure::create_profile_recharge_order_and_return;
pub use create_puzzle_agent_session_procedure::create_puzzle_agent_session; pub use create_puzzle_agent_session_procedure::create_puzzle_agent_session;
@@ -1275,6 +1330,9 @@ pub use get_custom_world_agent_session_procedure::get_custom_world_agent_session
pub use get_custom_world_gallery_detail_by_code_procedure::get_custom_world_gallery_detail_by_code; pub use get_custom_world_gallery_detail_by_code_procedure::get_custom_world_gallery_detail_by_code;
pub use get_custom_world_gallery_detail_procedure::get_custom_world_gallery_detail; pub use get_custom_world_gallery_detail_procedure::get_custom_world_gallery_detail;
pub use get_custom_world_library_detail_procedure::get_custom_world_library_detail; pub use get_custom_world_library_detail_procedure::get_custom_world_library_detail;
pub use get_jump_hop_agent_session_procedure::get_jump_hop_agent_session;
pub use get_jump_hop_run_procedure::get_jump_hop_run;
pub use get_jump_hop_work_profile_procedure::get_jump_hop_work_profile;
pub use get_match_3_d_agent_session_procedure::get_match_3_d_agent_session; pub use get_match_3_d_agent_session_procedure::get_match_3_d_agent_session;
pub use get_match_3_d_run_procedure::get_match_3_d_run; pub use get_match_3_d_run_procedure::get_match_3_d_run;
pub use get_match_3_d_work_detail_procedure::get_match_3_d_work_detail; pub use get_match_3_d_work_detail_procedure::get_match_3_d_work_detail;
@@ -1319,11 +1377,55 @@ pub use inventory_mutation_type::InventoryMutation;
pub use inventory_slot_snapshot_type::InventorySlotSnapshot; pub use inventory_slot_snapshot_type::InventorySlotSnapshot;
pub use inventory_slot_table::*; pub use inventory_slot_table::*;
pub use inventory_slot_type::InventorySlot; pub use inventory_slot_type::InventorySlot;
pub use jump_hop_agent_session_create_input_type::JumpHopAgentSessionCreateInput;
pub use jump_hop_agent_session_get_input_type::JumpHopAgentSessionGetInput;
pub use jump_hop_agent_session_procedure_result_type::JumpHopAgentSessionProcedureResult;
pub use jump_hop_agent_session_row_type::JumpHopAgentSessionRow;
pub use jump_hop_agent_session_snapshot_type::JumpHopAgentSessionSnapshot;
pub use jump_hop_agent_session_table::*;
pub use jump_hop_character_asset_snapshot_type::JumpHopCharacterAssetSnapshot;
pub use jump_hop_creator_config_snapshot_type::JumpHopCreatorConfigSnapshot;
pub use jump_hop_difficulty_type::JumpHopDifficulty;
pub use jump_hop_draft_compile_input_type::JumpHopDraftCompileInput;
pub use jump_hop_draft_snapshot_type::JumpHopDraftSnapshot;
pub use jump_hop_event_row_type::JumpHopEventRow;
pub use jump_hop_event_table::*;
pub use jump_hop_gallery_card_view_row_type::JumpHopGalleryCardViewRow;
pub use jump_hop_gallery_card_view_table::*;
pub use jump_hop_gallery_view_row_type::JumpHopGalleryViewRow;
pub use jump_hop_gallery_view_table::*;
pub use jump_hop_jump_procedure::jump_hop_jump;
pub use jump_hop_jump_result_kind_type::JumpHopJumpResultKind;
pub use jump_hop_last_jump_type::JumpHopLastJump;
pub use jump_hop_path_type::JumpHopPath;
pub use jump_hop_platform_type::JumpHopPlatform;
pub use jump_hop_run_get_input_type::JumpHopRunGetInput;
pub use jump_hop_run_jump_input_type::JumpHopRunJumpInput;
pub use jump_hop_run_procedure_result_type::JumpHopRunProcedureResult;
pub use jump_hop_run_restart_input_type::JumpHopRunRestartInput;
pub use jump_hop_run_snapshot_type::JumpHopRunSnapshot;
pub use jump_hop_run_start_input_type::JumpHopRunStartInput;
pub use jump_hop_run_status_type::JumpHopRunStatus;
pub use jump_hop_runtime_run_row_type::JumpHopRuntimeRunRow;
pub use jump_hop_runtime_run_table::*;
pub use jump_hop_scoring_type::JumpHopScoring;
pub use jump_hop_tile_asset_snapshot_type::JumpHopTileAssetSnapshot;
pub use jump_hop_tile_type_type::JumpHopTileType;
pub use jump_hop_work_get_input_type::JumpHopWorkGetInput;
pub use jump_hop_work_procedure_result_type::JumpHopWorkProcedureResult;
pub use jump_hop_work_profile_row_type::JumpHopWorkProfileRow;
pub use jump_hop_work_profile_table::*;
pub use jump_hop_work_publish_input_type::JumpHopWorkPublishInput;
pub use jump_hop_work_snapshot_type::JumpHopWorkSnapshot;
pub use jump_hop_work_update_input_type::JumpHopWorkUpdateInput;
pub use jump_hop_works_list_input_type::JumpHopWorksListInput;
pub use jump_hop_works_procedure_result_type::JumpHopWorksProcedureResult;
pub use list_asset_history_and_return_procedure::list_asset_history_and_return; pub use list_asset_history_and_return_procedure::list_asset_history_and_return;
pub use list_big_fish_works_procedure::list_big_fish_works; pub use list_big_fish_works_procedure::list_big_fish_works;
pub use list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries; pub use list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries;
pub use list_custom_world_profiles_procedure::list_custom_world_profiles; pub use list_custom_world_profiles_procedure::list_custom_world_profiles;
pub use list_custom_world_works_procedure::list_custom_world_works; pub use list_custom_world_works_procedure::list_custom_world_works;
pub use list_jump_hop_works_procedure::list_jump_hop_works;
pub use list_match_3_d_works_procedure::list_match_3_d_works; pub use list_match_3_d_works_procedure::list_match_3_d_works;
pub use list_platform_browse_history_procedure::list_platform_browse_history; pub use list_platform_browse_history_procedure::list_platform_browse_history;
pub use list_profile_save_archives_procedure::list_profile_save_archives; pub use list_profile_save_archives_procedure::list_profile_save_archives;
@@ -1434,6 +1536,7 @@ pub use publish_big_fish_game_procedure::publish_big_fish_game;
pub use publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return; pub use publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return;
pub use publish_custom_world_profile_reducer::publish_custom_world_profile; pub use publish_custom_world_profile_reducer::publish_custom_world_profile;
pub use publish_custom_world_world_procedure::publish_custom_world_world; pub use publish_custom_world_world_procedure::publish_custom_world_world;
pub use publish_jump_hop_work_procedure::publish_jump_hop_work;
pub use publish_match_3_d_work_procedure::publish_match_3_d_work; pub use publish_match_3_d_work_procedure::publish_match_3_d_work;
pub use publish_puzzle_work_procedure::publish_puzzle_work; pub use publish_puzzle_work_procedure::publish_puzzle_work;
pub use publish_square_hole_work_procedure::publish_square_hole_work; pub use publish_square_hole_work_procedure::publish_square_hole_work;
@@ -1575,6 +1678,7 @@ pub use resolve_npc_social_action_input_type::ResolveNpcSocialActionInput;
pub use resolve_npc_social_action_reducer::resolve_npc_social_action; pub use resolve_npc_social_action_reducer::resolve_npc_social_action;
pub use resolve_treasure_interaction_and_return_procedure::resolve_treasure_interaction_and_return; pub use resolve_treasure_interaction_and_return_procedure::resolve_treasure_interaction_and_return;
pub use resolve_treasure_interaction_reducer::resolve_treasure_interaction; pub use resolve_treasure_interaction_reducer::resolve_treasure_interaction;
pub use restart_jump_hop_run_procedure::restart_jump_hop_run;
pub use restart_match_3_d_run_procedure::restart_match_3_d_run; pub use restart_match_3_d_run_procedure::restart_match_3_d_run;
pub use restart_square_hole_run_procedure::restart_square_hole_run; pub use restart_square_hole_run_procedure::restart_square_hole_run;
pub use resume_profile_save_archive_and_return_procedure::resume_profile_save_archive_and_return; pub use resume_profile_save_archive_and_return_procedure::resume_profile_save_archive_and_return;
@@ -1746,6 +1850,7 @@ pub use start_ai_task_reducer::start_ai_task;
pub use start_ai_task_stage_reducer::start_ai_task_stage; pub use start_ai_task_stage_reducer::start_ai_task_stage;
pub use start_bark_battle_run_procedure::start_bark_battle_run; pub use start_bark_battle_run_procedure::start_bark_battle_run;
pub use start_big_fish_run_procedure::start_big_fish_run; pub use start_big_fish_run_procedure::start_big_fish_run;
pub use start_jump_hop_run_procedure::start_jump_hop_run;
pub use start_match_3_d_run_procedure::start_match_3_d_run; pub use start_match_3_d_run_procedure::start_match_3_d_run;
pub use start_puzzle_run_procedure::start_puzzle_run; pub use start_puzzle_run_procedure::start_puzzle_run;
pub use start_square_hole_run_procedure::start_square_hole_run; pub use start_square_hole_run_procedure::start_square_hole_run;
@@ -1790,6 +1895,7 @@ pub use unequip_inventory_item_input_type::UnequipInventoryItemInput;
pub use unpublish_custom_world_profile_and_return_procedure::unpublish_custom_world_profile_and_return; pub use unpublish_custom_world_profile_and_return_procedure::unpublish_custom_world_profile_and_return;
pub use unpublish_custom_world_profile_reducer::unpublish_custom_world_profile; pub use unpublish_custom_world_profile_reducer::unpublish_custom_world_profile;
pub use update_bark_battle_draft_config_procedure::update_bark_battle_draft_config; pub use update_bark_battle_draft_config_procedure::update_bark_battle_draft_config;
pub use update_jump_hop_work_procedure::update_jump_hop_work;
pub use update_match_3_d_work_procedure::update_match_3_d_work; pub use update_match_3_d_work_procedure::update_match_3_d_work;
pub use update_puzzle_run_pause_procedure::update_puzzle_run_pause; pub use update_puzzle_run_pause_procedure::update_puzzle_run_pause;
pub use update_puzzle_work_procedure::update_puzzle_work; pub use update_puzzle_work_procedure::update_puzzle_work;
@@ -2169,6 +2275,12 @@ pub struct DbUpdate {
database_migration_import_chunk: __sdk::TableUpdate<DatabaseMigrationImportChunk>, database_migration_import_chunk: __sdk::TableUpdate<DatabaseMigrationImportChunk>,
database_migration_operator: __sdk::TableUpdate<DatabaseMigrationOperator>, database_migration_operator: __sdk::TableUpdate<DatabaseMigrationOperator>,
inventory_slot: __sdk::TableUpdate<InventorySlot>, inventory_slot: __sdk::TableUpdate<InventorySlot>,
jump_hop_agent_session: __sdk::TableUpdate<JumpHopAgentSessionRow>,
jump_hop_event: __sdk::TableUpdate<JumpHopEventRow>,
jump_hop_gallery_card_view: __sdk::TableUpdate<JumpHopGalleryCardViewRow>,
jump_hop_gallery_view: __sdk::TableUpdate<JumpHopGalleryViewRow>,
jump_hop_runtime_run: __sdk::TableUpdate<JumpHopRuntimeRunRow>,
jump_hop_work_profile: __sdk::TableUpdate<JumpHopWorkProfileRow>,
match_3_d_agent_message: __sdk::TableUpdate<Match3DAgentMessageRow>, match_3_d_agent_message: __sdk::TableUpdate<Match3DAgentMessageRow>,
match_3_d_agent_session: __sdk::TableUpdate<Match3DAgentSessionRow>, match_3_d_agent_session: __sdk::TableUpdate<Match3DAgentSessionRow>,
match_3_d_gallery_view: __sdk::TableUpdate<Match3DGalleryViewRow>, match_3_d_gallery_view: __sdk::TableUpdate<Match3DGalleryViewRow>,
@@ -2358,6 +2470,24 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
"inventory_slot" => db_update "inventory_slot" => db_update
.inventory_slot .inventory_slot
.append(inventory_slot_table::parse_table_update(table_update)?), .append(inventory_slot_table::parse_table_update(table_update)?),
"jump_hop_agent_session" => db_update.jump_hop_agent_session.append(
jump_hop_agent_session_table::parse_table_update(table_update)?,
),
"jump_hop_event" => db_update
.jump_hop_event
.append(jump_hop_event_table::parse_table_update(table_update)?),
"jump_hop_gallery_card_view" => db_update.jump_hop_gallery_card_view.append(
jump_hop_gallery_card_view_table::parse_table_update(table_update)?,
),
"jump_hop_gallery_view" => db_update.jump_hop_gallery_view.append(
jump_hop_gallery_view_table::parse_table_update(table_update)?,
),
"jump_hop_runtime_run" => db_update.jump_hop_runtime_run.append(
jump_hop_runtime_run_table::parse_table_update(table_update)?,
),
"jump_hop_work_profile" => db_update.jump_hop_work_profile.append(
jump_hop_work_profile_table::parse_table_update(table_update)?,
),
"match_3_d_agent_message" => db_update.match_3_d_agent_message.append( "match_3_d_agent_message" => db_update.match_3_d_agent_message.append(
match_3_d_agent_message_table::parse_table_update(table_update)?, match_3_d_agent_message_table::parse_table_update(table_update)?,
), ),
@@ -2748,6 +2878,27 @@ impl __sdk::DbUpdate for DbUpdate {
diff.inventory_slot = cache diff.inventory_slot = cache
.apply_diff_to_table::<InventorySlot>("inventory_slot", &self.inventory_slot) .apply_diff_to_table::<InventorySlot>("inventory_slot", &self.inventory_slot)
.with_updates_by_pk(|row| &row.slot_id); .with_updates_by_pk(|row| &row.slot_id);
diff.jump_hop_agent_session = cache
.apply_diff_to_table::<JumpHopAgentSessionRow>(
"jump_hop_agent_session",
&self.jump_hop_agent_session,
)
.with_updates_by_pk(|row| &row.session_id);
diff.jump_hop_event = cache
.apply_diff_to_table::<JumpHopEventRow>("jump_hop_event", &self.jump_hop_event)
.with_updates_by_pk(|row| &row.event_id);
diff.jump_hop_runtime_run = cache
.apply_diff_to_table::<JumpHopRuntimeRunRow>(
"jump_hop_runtime_run",
&self.jump_hop_runtime_run,
)
.with_updates_by_pk(|row| &row.run_id);
diff.jump_hop_work_profile = cache
.apply_diff_to_table::<JumpHopWorkProfileRow>(
"jump_hop_work_profile",
&self.jump_hop_work_profile,
)
.with_updates_by_pk(|row| &row.profile_id);
diff.match_3_d_agent_message = cache diff.match_3_d_agent_message = cache
.apply_diff_to_table::<Match3DAgentMessageRow>( .apply_diff_to_table::<Match3DAgentMessageRow>(
"match_3_d_agent_message", "match_3_d_agent_message",
@@ -3012,6 +3163,14 @@ impl __sdk::DbUpdate for DbUpdate {
"big_fish_gallery_view", "big_fish_gallery_view",
&self.big_fish_gallery_view, &self.big_fish_gallery_view,
); );
diff.jump_hop_gallery_card_view = cache.apply_diff_to_table::<JumpHopGalleryCardViewRow>(
"jump_hop_gallery_card_view",
&self.jump_hop_gallery_card_view,
);
diff.jump_hop_gallery_view = cache.apply_diff_to_table::<JumpHopGalleryViewRow>(
"jump_hop_gallery_view",
&self.jump_hop_gallery_view,
);
diff.match_3_d_gallery_view = cache.apply_diff_to_table::<Match3DGalleryViewRow>( diff.match_3_d_gallery_view = cache.apply_diff_to_table::<Match3DGalleryViewRow>(
"match_3_d_gallery_view", "match_3_d_gallery_view",
&self.match_3_d_gallery_view, &self.match_3_d_gallery_view,
@@ -3156,6 +3315,24 @@ impl __sdk::DbUpdate for DbUpdate {
"inventory_slot" => db_update "inventory_slot" => db_update
.inventory_slot .inventory_slot
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"jump_hop_agent_session" => db_update
.jump_hop_agent_session
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"jump_hop_event" => db_update
.jump_hop_event
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"jump_hop_gallery_card_view" => db_update
.jump_hop_gallery_card_view
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"jump_hop_gallery_view" => db_update
.jump_hop_gallery_view
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"jump_hop_runtime_run" => db_update
.jump_hop_runtime_run
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"jump_hop_work_profile" => db_update
.jump_hop_work_profile
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"match_3_d_agent_message" => db_update "match_3_d_agent_message" => db_update
.match_3_d_agent_message .match_3_d_agent_message
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
@@ -3454,6 +3631,24 @@ impl __sdk::DbUpdate for DbUpdate {
"inventory_slot" => db_update "inventory_slot" => db_update
.inventory_slot .inventory_slot
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"jump_hop_agent_session" => db_update
.jump_hop_agent_session
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"jump_hop_event" => db_update
.jump_hop_event
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"jump_hop_gallery_card_view" => db_update
.jump_hop_gallery_card_view
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"jump_hop_gallery_view" => db_update
.jump_hop_gallery_view
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"jump_hop_runtime_run" => db_update
.jump_hop_runtime_run
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"jump_hop_work_profile" => db_update
.jump_hop_work_profile
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"match_3_d_agent_message" => db_update "match_3_d_agent_message" => db_update
.match_3_d_agent_message .match_3_d_agent_message
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
@@ -3678,6 +3873,12 @@ pub struct AppliedDiff<'r> {
database_migration_import_chunk: __sdk::TableAppliedDiff<'r, DatabaseMigrationImportChunk>, database_migration_import_chunk: __sdk::TableAppliedDiff<'r, DatabaseMigrationImportChunk>,
database_migration_operator: __sdk::TableAppliedDiff<'r, DatabaseMigrationOperator>, database_migration_operator: __sdk::TableAppliedDiff<'r, DatabaseMigrationOperator>,
inventory_slot: __sdk::TableAppliedDiff<'r, InventorySlot>, inventory_slot: __sdk::TableAppliedDiff<'r, InventorySlot>,
jump_hop_agent_session: __sdk::TableAppliedDiff<'r, JumpHopAgentSessionRow>,
jump_hop_event: __sdk::TableAppliedDiff<'r, JumpHopEventRow>,
jump_hop_gallery_card_view: __sdk::TableAppliedDiff<'r, JumpHopGalleryCardViewRow>,
jump_hop_gallery_view: __sdk::TableAppliedDiff<'r, JumpHopGalleryViewRow>,
jump_hop_runtime_run: __sdk::TableAppliedDiff<'r, JumpHopRuntimeRunRow>,
jump_hop_work_profile: __sdk::TableAppliedDiff<'r, JumpHopWorkProfileRow>,
match_3_d_agent_message: __sdk::TableAppliedDiff<'r, Match3DAgentMessageRow>, match_3_d_agent_message: __sdk::TableAppliedDiff<'r, Match3DAgentMessageRow>,
match_3_d_agent_session: __sdk::TableAppliedDiff<'r, Match3DAgentSessionRow>, match_3_d_agent_session: __sdk::TableAppliedDiff<'r, Match3DAgentSessionRow>,
match_3_d_gallery_view: __sdk::TableAppliedDiff<'r, Match3DGalleryViewRow>, match_3_d_gallery_view: __sdk::TableAppliedDiff<'r, Match3DGalleryViewRow>,
@@ -3935,6 +4136,36 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
&self.inventory_slot, &self.inventory_slot,
event, event,
); );
callbacks.invoke_table_row_callbacks::<JumpHopAgentSessionRow>(
"jump_hop_agent_session",
&self.jump_hop_agent_session,
event,
);
callbacks.invoke_table_row_callbacks::<JumpHopEventRow>(
"jump_hop_event",
&self.jump_hop_event,
event,
);
callbacks.invoke_table_row_callbacks::<JumpHopGalleryCardViewRow>(
"jump_hop_gallery_card_view",
&self.jump_hop_gallery_card_view,
event,
);
callbacks.invoke_table_row_callbacks::<JumpHopGalleryViewRow>(
"jump_hop_gallery_view",
&self.jump_hop_gallery_view,
event,
);
callbacks.invoke_table_row_callbacks::<JumpHopRuntimeRunRow>(
"jump_hop_runtime_run",
&self.jump_hop_runtime_run,
event,
);
callbacks.invoke_table_row_callbacks::<JumpHopWorkProfileRow>(
"jump_hop_work_profile",
&self.jump_hop_work_profile,
event,
);
callbacks.invoke_table_row_callbacks::<Match3DAgentMessageRow>( callbacks.invoke_table_row_callbacks::<Match3DAgentMessageRow>(
"match_3_d_agent_message", "match_3_d_agent_message",
&self.match_3_d_agent_message, &self.match_3_d_agent_message,
@@ -4902,6 +5133,12 @@ impl __sdk::SpacetimeModule for RemoteModule {
database_migration_import_chunk_table::register_table(client_cache); database_migration_import_chunk_table::register_table(client_cache);
database_migration_operator_table::register_table(client_cache); database_migration_operator_table::register_table(client_cache);
inventory_slot_table::register_table(client_cache); inventory_slot_table::register_table(client_cache);
jump_hop_agent_session_table::register_table(client_cache);
jump_hop_event_table::register_table(client_cache);
jump_hop_gallery_card_view_table::register_table(client_cache);
jump_hop_gallery_view_table::register_table(client_cache);
jump_hop_runtime_run_table::register_table(client_cache);
jump_hop_work_profile_table::register_table(client_cache);
match_3_d_agent_message_table::register_table(client_cache); match_3_d_agent_message_table::register_table(client_cache);
match_3_d_agent_session_table::register_table(client_cache); match_3_d_agent_session_table::register_table(client_cache);
match_3_d_gallery_view_table::register_table(client_cache); match_3_d_gallery_view_table::register_table(client_cache);
@@ -4999,6 +5236,12 @@ impl __sdk::SpacetimeModule for RemoteModule {
"database_migration_import_chunk", "database_migration_import_chunk",
"database_migration_operator", "database_migration_operator",
"inventory_slot", "inventory_slot",
"jump_hop_agent_session",
"jump_hop_event",
"jump_hop_gallery_card_view",
"jump_hop_gallery_view",
"jump_hop_runtime_run",
"jump_hop_work_profile",
"match_3_d_agent_message", "match_3_d_agent_message",
"match_3_d_agent_session", "match_3_d_agent_session",
"match_3_d_gallery_view", "match_3_d_gallery_view",

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_agent_session_procedure_result_type::JumpHopAgentSessionProcedureResult;
use super::jump_hop_draft_compile_input_type::JumpHopDraftCompileInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct CompileJumpHopDraftArgs {
pub input: JumpHopDraftCompileInput,
}
impl __sdk::InModule for CompileJumpHopDraftArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `compile_jump_hop_draft`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait compile_jump_hop_draft {
fn compile_jump_hop_draft(&self, input: JumpHopDraftCompileInput) {
self.compile_jump_hop_draft_then(input, |_, _| {});
}
fn compile_jump_hop_draft_then(
&self,
input: JumpHopDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl compile_jump_hop_draft for super::RemoteProcedures {
fn compile_jump_hop_draft_then(
&self,
input: JumpHopDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopAgentSessionProcedureResult>(
"compile_jump_hop_draft",
CompileJumpHopDraftArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_agent_session_create_input_type::JumpHopAgentSessionCreateInput;
use super::jump_hop_agent_session_procedure_result_type::JumpHopAgentSessionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct CreateJumpHopAgentSessionArgs {
pub input: JumpHopAgentSessionCreateInput,
}
impl __sdk::InModule for CreateJumpHopAgentSessionArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `create_jump_hop_agent_session`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait create_jump_hop_agent_session {
fn create_jump_hop_agent_session(&self, input: JumpHopAgentSessionCreateInput) {
self.create_jump_hop_agent_session_then(input, |_, _| {});
}
fn create_jump_hop_agent_session_then(
&self,
input: JumpHopAgentSessionCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl create_jump_hop_agent_session for super::RemoteProcedures {
fn create_jump_hop_agent_session_then(
&self,
input: JumpHopAgentSessionCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopAgentSessionProcedureResult>(
"create_jump_hop_agent_session",
CreateJumpHopAgentSessionArgs { input },
__callback,
);
}
}

View File

@@ -1,3 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_agent_session_get_input_type::JumpHopAgentSessionGetInput;
use super::jump_hop_agent_session_procedure_result_type::JumpHopAgentSessionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetJumpHopAgentSessionArgs {
pub input: JumpHopAgentSessionGetInput,
}
impl __sdk::InModule for GetJumpHopAgentSessionArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_jump_hop_agent_session`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_jump_hop_agent_session {
fn get_jump_hop_agent_session(&self, input: JumpHopAgentSessionGetInput) {
self.get_jump_hop_agent_session_then(input, |_, _| {});
}
fn get_jump_hop_agent_session_then(
&self,
input: JumpHopAgentSessionGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_jump_hop_agent_session for super::RemoteProcedures {
fn get_jump_hop_agent_session_then(
&self,
input: JumpHopAgentSessionGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopAgentSessionProcedureResult>(
"get_jump_hop_agent_session",
GetJumpHopAgentSessionArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_run_get_input_type::JumpHopRunGetInput;
use super::jump_hop_run_procedure_result_type::JumpHopRunProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetJumpHopRunArgs {
pub input: JumpHopRunGetInput,
}
impl __sdk::InModule for GetJumpHopRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_jump_hop_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_jump_hop_run {
fn get_jump_hop_run(&self, input: JumpHopRunGetInput) {
self.get_jump_hop_run_then(input, |_, _| {});
}
fn get_jump_hop_run_then(
&self,
input: JumpHopRunGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_jump_hop_run for super::RemoteProcedures {
fn get_jump_hop_run_then(
&self,
input: JumpHopRunGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopRunProcedureResult>(
"get_jump_hop_run",
GetJumpHopRunArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_work_get_input_type::JumpHopWorkGetInput;
use super::jump_hop_work_procedure_result_type::JumpHopWorkProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetJumpHopWorkProfileArgs {
pub input: JumpHopWorkGetInput,
}
impl __sdk::InModule for GetJumpHopWorkProfileArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_jump_hop_work_profile`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_jump_hop_work_profile {
fn get_jump_hop_work_profile(&self, input: JumpHopWorkGetInput) {
self.get_jump_hop_work_profile_then(input, |_, _| {});
}
fn get_jump_hop_work_profile_then(
&self,
input: JumpHopWorkGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_jump_hop_work_profile for super::RemoteProcedures {
fn get_jump_hop_work_profile_then(
&self,
input: JumpHopWorkGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopWorkProcedureResult>(
"get_jump_hop_work_profile",
GetJumpHopWorkProfileArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,23 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopAgentSessionCreateInput {
pub session_id: String,
pub owner_user_id: String,
pub seed_text: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: Option<String>,
pub welcome_message_text: String,
pub config_json: Option<String>,
pub created_at_micros: i64,
}
impl __sdk::InModule for JumpHopAgentSessionCreateInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,16 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopAgentSessionGetInput {
pub session_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for JumpHopAgentSessionGetInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_agent_session_snapshot_type::JumpHopAgentSessionSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopAgentSessionProcedureResult {
pub ok: bool,
pub session: Option<JumpHopAgentSessionSnapshot>,
pub error_message: Option<String>,
}
impl __sdk::InModule for JumpHopAgentSessionProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,90 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopAgentSessionRow {
pub session_id: String,
pub owner_user_id: String,
pub seed_text: String,
pub current_turn: u32,
pub progress_percent: u32,
pub stage: String,
pub config_json: String,
pub draft_json: String,
pub last_assistant_reply: String,
pub published_profile_id: String,
pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp,
}
impl __sdk::InModule for JumpHopAgentSessionRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `JumpHopAgentSessionRow`.
///
/// Provides typed access to columns for query building.
pub struct JumpHopAgentSessionRowCols {
pub session_id: __sdk::__query_builder::Col<JumpHopAgentSessionRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<JumpHopAgentSessionRow, String>,
pub seed_text: __sdk::__query_builder::Col<JumpHopAgentSessionRow, String>,
pub current_turn: __sdk::__query_builder::Col<JumpHopAgentSessionRow, u32>,
pub progress_percent: __sdk::__query_builder::Col<JumpHopAgentSessionRow, u32>,
pub stage: __sdk::__query_builder::Col<JumpHopAgentSessionRow, String>,
pub config_json: __sdk::__query_builder::Col<JumpHopAgentSessionRow, String>,
pub draft_json: __sdk::__query_builder::Col<JumpHopAgentSessionRow, String>,
pub last_assistant_reply: __sdk::__query_builder::Col<JumpHopAgentSessionRow, String>,
pub published_profile_id: __sdk::__query_builder::Col<JumpHopAgentSessionRow, String>,
pub created_at: __sdk::__query_builder::Col<JumpHopAgentSessionRow, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<JumpHopAgentSessionRow, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for JumpHopAgentSessionRow {
type Cols = JumpHopAgentSessionRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
JumpHopAgentSessionRowCols {
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
seed_text: __sdk::__query_builder::Col::new(table_name, "seed_text"),
current_turn: __sdk::__query_builder::Col::new(table_name, "current_turn"),
progress_percent: __sdk::__query_builder::Col::new(table_name, "progress_percent"),
stage: __sdk::__query_builder::Col::new(table_name, "stage"),
config_json: __sdk::__query_builder::Col::new(table_name, "config_json"),
draft_json: __sdk::__query_builder::Col::new(table_name, "draft_json"),
last_assistant_reply: __sdk::__query_builder::Col::new(
table_name,
"last_assistant_reply",
),
published_profile_id: __sdk::__query_builder::Col::new(
table_name,
"published_profile_id",
),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
}
}
}
/// Indexed column accessor struct for the table `JumpHopAgentSessionRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct JumpHopAgentSessionRowIxCols {
pub owner_user_id: __sdk::__query_builder::IxCol<JumpHopAgentSessionRow, String>,
pub session_id: __sdk::__query_builder::IxCol<JumpHopAgentSessionRow, String>,
}
impl __sdk::__query_builder::HasIxCols for JumpHopAgentSessionRow {
type IxCols = JumpHopAgentSessionRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
JumpHopAgentSessionRowIxCols {
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for JumpHopAgentSessionRow {}

View File

@@ -0,0 +1,29 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_creator_config_snapshot_type::JumpHopCreatorConfigSnapshot;
use super::jump_hop_draft_snapshot_type::JumpHopDraftSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopAgentSessionSnapshot {
pub session_id: String,
pub owner_user_id: String,
pub seed_text: String,
pub current_turn: u32,
pub progress_percent: u32,
pub stage: String,
pub config: JumpHopCreatorConfigSnapshot,
pub draft: Option<JumpHopDraftSnapshot>,
pub last_assistant_reply: String,
pub published_profile_id: Option<String>,
pub created_at_micros: i64,
pub updated_at_micros: i64,
}
impl __sdk::InModule for JumpHopAgentSessionSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::jump_hop_agent_session_row_type::JumpHopAgentSessionRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `jump_hop_agent_session`.
///
/// Obtain a handle from the [`JumpHopAgentSessionTableAccess::jump_hop_agent_session`] method on [`super::RemoteTables`],
/// like `ctx.db.jump_hop_agent_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_agent_session().on_insert(...)`.
pub struct JumpHopAgentSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<JumpHopAgentSessionRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `jump_hop_agent_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait JumpHopAgentSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`JumpHopAgentSessionTableHandle`], which mediates access to the table `jump_hop_agent_session`.
fn jump_hop_agent_session(&self) -> JumpHopAgentSessionTableHandle<'_>;
}
impl JumpHopAgentSessionTableAccess for super::RemoteTables {
fn jump_hop_agent_session(&self) -> JumpHopAgentSessionTableHandle<'_> {
JumpHopAgentSessionTableHandle {
imp: self
.imp
.get_table::<JumpHopAgentSessionRow>("jump_hop_agent_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct JumpHopAgentSessionInsertCallbackId(__sdk::CallbackId);
pub struct JumpHopAgentSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for JumpHopAgentSessionTableHandle<'ctx> {
type Row = JumpHopAgentSessionRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = JumpHopAgentSessionRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = JumpHopAgentSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopAgentSessionInsertCallbackId {
JumpHopAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: JumpHopAgentSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = JumpHopAgentSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopAgentSessionDeleteCallbackId {
JumpHopAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: JumpHopAgentSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct JumpHopAgentSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopAgentSessionTableHandle<'ctx> {
type UpdateCallbackId = JumpHopAgentSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> JumpHopAgentSessionUpdateCallbackId {
JumpHopAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: JumpHopAgentSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `jump_hop_agent_session`,
/// which allows point queries on the field of the same name
/// via the [`JumpHopAgentSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_agent_session().session_id().find(...)`.
pub struct JumpHopAgentSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<JumpHopAgentSessionRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> JumpHopAgentSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `jump_hop_agent_session`.
pub fn session_id(&self) -> JumpHopAgentSessionSessionIdUnique<'ctx> {
JumpHopAgentSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> JumpHopAgentSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<JumpHopAgentSessionRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<JumpHopAgentSessionRow>("jump_hop_agent_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<JumpHopAgentSessionRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<JumpHopAgentSessionRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `JumpHopAgentSessionRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait jump_hop_agent_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `JumpHopAgentSessionRow`.
fn jump_hop_agent_session(&self) -> __sdk::__query_builder::Table<JumpHopAgentSessionRow>;
}
impl jump_hop_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn jump_hop_agent_session(&self) -> __sdk::__query_builder::Table<JumpHopAgentSessionRow> {
__sdk::__query_builder::Table::new("jump_hop_agent_session")
}
}

View File

@@ -0,0 +1,22 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopCharacterAssetSnapshot {
pub asset_id: String,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub generation_provider: String,
pub prompt: String,
pub width: u32,
pub height: u32,
}
impl __sdk::InModule for JumpHopCharacterAssetSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,20 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopCreatorConfigSnapshot {
pub theme_text: String,
pub difficulty: String,
pub style_preset: String,
pub character_prompt: String,
pub tile_prompt: String,
pub end_mood_prompt: String,
}
impl __sdk::InModule for JumpHopCreatorConfigSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,22 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
#[derive(Copy, Eq, Hash)]
pub enum JumpHopDifficulty {
Easy,
Standard,
Advanced,
Challenge,
}
impl __sdk::InModule for JumpHopDifficulty {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,34 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopDraftCompileInput {
pub session_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub author_display_name: String,
pub seed_text: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: Option<String>,
pub theme_text: Option<String>,
pub difficulty: Option<String>,
pub style_preset: Option<String>,
pub character_prompt: Option<String>,
pub tile_prompt: Option<String>,
pub end_mood_prompt: Option<String>,
pub character_asset_json: Option<String>,
pub tile_atlas_asset_json: Option<String>,
pub tile_assets_json: Option<String>,
pub cover_composite: Option<String>,
pub generation_status: Option<String>,
pub compiled_at_micros: i64,
}
impl __sdk::InModule for JumpHopDraftCompileInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,35 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_character_asset_snapshot_type::JumpHopCharacterAssetSnapshot;
use super::jump_hop_path_type::JumpHopPath;
use super::jump_hop_tile_asset_snapshot_type::JumpHopTileAssetSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopDraftSnapshot {
pub template_id: String,
pub template_name: String,
pub profile_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub difficulty: String,
pub style_preset: String,
pub character_prompt: String,
pub tile_prompt: String,
pub end_mood_prompt: Option<String>,
pub character_asset: Option<JumpHopCharacterAssetSnapshot>,
pub tile_atlas_asset: Option<JumpHopCharacterAssetSnapshot>,
pub tile_assets: Vec<JumpHopTileAssetSnapshot>,
pub path: Option<JumpHopPath>,
pub cover_composite: Option<String>,
pub generation_status: String,
}
impl __sdk::InModule for JumpHopDraftSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,71 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopEventRow {
pub event_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub run_id: String,
pub event_type: String,
pub result: String,
pub occurred_at: __sdk::Timestamp,
}
impl __sdk::InModule for JumpHopEventRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `JumpHopEventRow`.
///
/// Provides typed access to columns for query building.
pub struct JumpHopEventRowCols {
pub event_id: __sdk::__query_builder::Col<JumpHopEventRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<JumpHopEventRow, String>,
pub profile_id: __sdk::__query_builder::Col<JumpHopEventRow, String>,
pub run_id: __sdk::__query_builder::Col<JumpHopEventRow, String>,
pub event_type: __sdk::__query_builder::Col<JumpHopEventRow, String>,
pub result: __sdk::__query_builder::Col<JumpHopEventRow, String>,
pub occurred_at: __sdk::__query_builder::Col<JumpHopEventRow, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for JumpHopEventRow {
type Cols = JumpHopEventRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
JumpHopEventRowCols {
event_id: __sdk::__query_builder::Col::new(table_name, "event_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
run_id: __sdk::__query_builder::Col::new(table_name, "run_id"),
event_type: __sdk::__query_builder::Col::new(table_name, "event_type"),
result: __sdk::__query_builder::Col::new(table_name, "result"),
occurred_at: __sdk::__query_builder::Col::new(table_name, "occurred_at"),
}
}
}
/// Indexed column accessor struct for the table `JumpHopEventRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct JumpHopEventRowIxCols {
pub event_id: __sdk::__query_builder::IxCol<JumpHopEventRow, String>,
pub profile_id: __sdk::__query_builder::IxCol<JumpHopEventRow, String>,
pub run_id: __sdk::__query_builder::IxCol<JumpHopEventRow, String>,
}
impl __sdk::__query_builder::HasIxCols for JumpHopEventRow {
type IxCols = JumpHopEventRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
JumpHopEventRowIxCols {
event_id: __sdk::__query_builder::IxCol::new(table_name, "event_id"),
profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"),
run_id: __sdk::__query_builder::IxCol::new(table_name, "run_id"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for JumpHopEventRow {}

View File

@@ -0,0 +1,159 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::jump_hop_event_row_type::JumpHopEventRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `jump_hop_event`.
///
/// Obtain a handle from the [`JumpHopEventTableAccess::jump_hop_event`] method on [`super::RemoteTables`],
/// like `ctx.db.jump_hop_event()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_event().on_insert(...)`.
pub struct JumpHopEventTableHandle<'ctx> {
imp: __sdk::TableHandle<JumpHopEventRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `jump_hop_event`.
///
/// Implemented for [`super::RemoteTables`].
pub trait JumpHopEventTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`JumpHopEventTableHandle`], which mediates access to the table `jump_hop_event`.
fn jump_hop_event(&self) -> JumpHopEventTableHandle<'_>;
}
impl JumpHopEventTableAccess for super::RemoteTables {
fn jump_hop_event(&self) -> JumpHopEventTableHandle<'_> {
JumpHopEventTableHandle {
imp: self.imp.get_table::<JumpHopEventRow>("jump_hop_event"),
ctx: std::marker::PhantomData,
}
}
}
pub struct JumpHopEventInsertCallbackId(__sdk::CallbackId);
pub struct JumpHopEventDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for JumpHopEventTableHandle<'ctx> {
type Row = JumpHopEventRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = JumpHopEventRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = JumpHopEventInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopEventInsertCallbackId {
JumpHopEventInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: JumpHopEventInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = JumpHopEventDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopEventDeleteCallbackId {
JumpHopEventDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: JumpHopEventDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct JumpHopEventUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopEventTableHandle<'ctx> {
type UpdateCallbackId = JumpHopEventUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> JumpHopEventUpdateCallbackId {
JumpHopEventUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: JumpHopEventUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `event_id` unique index on the table `jump_hop_event`,
/// which allows point queries on the field of the same name
/// via the [`JumpHopEventEventIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_event().event_id().find(...)`.
pub struct JumpHopEventEventIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<JumpHopEventRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> JumpHopEventTableHandle<'ctx> {
/// Get a handle on the `event_id` unique index on the table `jump_hop_event`.
pub fn event_id(&self) -> JumpHopEventEventIdUnique<'ctx> {
JumpHopEventEventIdUnique {
imp: self.imp.get_unique_constraint::<String>("event_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> JumpHopEventEventIdUnique<'ctx> {
/// Find the subscribed row whose `event_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<JumpHopEventRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<JumpHopEventRow>("jump_hop_event");
_table.add_unique_constraint::<String>("event_id", |row| &row.event_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<JumpHopEventRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<JumpHopEventRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `JumpHopEventRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait jump_hop_eventQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `JumpHopEventRow`.
fn jump_hop_event(&self) -> __sdk::__query_builder::Table<JumpHopEventRow>;
}
impl jump_hop_eventQueryTableAccess for __sdk::QueryTableAccessor {
fn jump_hop_event(&self) -> __sdk::__query_builder::Table<JumpHopEventRow> {
__sdk::__query_builder::Table::new("jump_hop_event")
}
}

View File

@@ -0,0 +1,82 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopGalleryCardViewRow {
pub public_work_code: String,
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub difficulty: String,
pub style_preset: String,
pub cover_image_src: String,
pub publication_status: String,
pub play_count: u32,
pub updated_at_micros: i64,
pub published_at_micros: Option<i64>,
pub generation_status: String,
}
impl __sdk::InModule for JumpHopGalleryCardViewRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `JumpHopGalleryCardViewRow`.
///
/// Provides typed access to columns for query building.
pub struct JumpHopGalleryCardViewRowCols {
pub public_work_code: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub work_id: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub profile_id: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub author_display_name: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub work_title: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub work_description: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub theme_tags: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, Vec<String>>,
pub difficulty: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub style_preset: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub cover_image_src: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub publication_status: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
pub play_count: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, u32>,
pub updated_at_micros: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, i64>,
pub published_at_micros: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, Option<i64>>,
pub generation_status: __sdk::__query_builder::Col<JumpHopGalleryCardViewRow, String>,
}
impl __sdk::__query_builder::HasCols for JumpHopGalleryCardViewRow {
type Cols = JumpHopGalleryCardViewRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
JumpHopGalleryCardViewRowCols {
public_work_code: __sdk::__query_builder::Col::new(table_name, "public_work_code"),
work_id: __sdk::__query_builder::Col::new(table_name, "work_id"),
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
author_display_name: __sdk::__query_builder::Col::new(
table_name,
"author_display_name",
),
work_title: __sdk::__query_builder::Col::new(table_name, "work_title"),
work_description: __sdk::__query_builder::Col::new(table_name, "work_description"),
theme_tags: __sdk::__query_builder::Col::new(table_name, "theme_tags"),
difficulty: __sdk::__query_builder::Col::new(table_name, "difficulty"),
style_preset: __sdk::__query_builder::Col::new(table_name, "style_preset"),
cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"),
publication_status: __sdk::__query_builder::Col::new(table_name, "publication_status"),
play_count: __sdk::__query_builder::Col::new(table_name, "play_count"),
updated_at_micros: __sdk::__query_builder::Col::new(table_name, "updated_at_micros"),
published_at_micros: __sdk::__query_builder::Col::new(
table_name,
"published_at_micros",
),
generation_status: __sdk::__query_builder::Col::new(table_name, "generation_status"),
}
}
}

View File

@@ -0,0 +1,118 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::jump_hop_gallery_card_view_row_type::JumpHopGalleryCardViewRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `jump_hop_gallery_card_view`.
///
/// Obtain a handle from the [`JumpHopGalleryCardViewTableAccess::jump_hop_gallery_card_view`] method on [`super::RemoteTables`],
/// like `ctx.db.jump_hop_gallery_card_view()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_gallery_card_view().on_insert(...)`.
pub struct JumpHopGalleryCardViewTableHandle<'ctx> {
imp: __sdk::TableHandle<JumpHopGalleryCardViewRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `jump_hop_gallery_card_view`.
///
/// Implemented for [`super::RemoteTables`].
pub trait JumpHopGalleryCardViewTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`JumpHopGalleryCardViewTableHandle`], which mediates access to the table `jump_hop_gallery_card_view`.
fn jump_hop_gallery_card_view(&self) -> JumpHopGalleryCardViewTableHandle<'_>;
}
impl JumpHopGalleryCardViewTableAccess for super::RemoteTables {
fn jump_hop_gallery_card_view(&self) -> JumpHopGalleryCardViewTableHandle<'_> {
JumpHopGalleryCardViewTableHandle {
imp: self
.imp
.get_table::<JumpHopGalleryCardViewRow>("jump_hop_gallery_card_view"),
ctx: std::marker::PhantomData,
}
}
}
pub struct JumpHopGalleryCardViewInsertCallbackId(__sdk::CallbackId);
pub struct JumpHopGalleryCardViewDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for JumpHopGalleryCardViewTableHandle<'ctx> {
type Row = JumpHopGalleryCardViewRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = JumpHopGalleryCardViewRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = JumpHopGalleryCardViewInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopGalleryCardViewInsertCallbackId {
JumpHopGalleryCardViewInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: JumpHopGalleryCardViewInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = JumpHopGalleryCardViewDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopGalleryCardViewDeleteCallbackId {
JumpHopGalleryCardViewDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: JumpHopGalleryCardViewDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<JumpHopGalleryCardViewRow>("jump_hop_gallery_card_view");
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<JumpHopGalleryCardViewRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<JumpHopGalleryCardViewRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `JumpHopGalleryCardViewRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait jump_hop_gallery_card_viewQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `JumpHopGalleryCardViewRow`.
fn jump_hop_gallery_card_view(
&self,
) -> __sdk::__query_builder::Table<JumpHopGalleryCardViewRow>;
}
impl jump_hop_gallery_card_viewQueryTableAccess for __sdk::QueryTableAccessor {
fn jump_hop_gallery_card_view(
&self,
) -> __sdk::__query_builder::Table<JumpHopGalleryCardViewRow> {
__sdk::__query_builder::Table::new("jump_hop_gallery_card_view")
}
}

View File

@@ -0,0 +1,116 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_character_asset_snapshot_type::JumpHopCharacterAssetSnapshot;
use super::jump_hop_path_type::JumpHopPath;
use super::jump_hop_tile_asset_snapshot_type::JumpHopTileAssetSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopGalleryViewRow {
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub source_session_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub difficulty: String,
pub style_preset: String,
pub character_prompt: String,
pub tile_prompt: String,
pub end_mood_prompt: Option<String>,
pub character_asset: Option<JumpHopCharacterAssetSnapshot>,
pub tile_atlas_asset: Option<JumpHopCharacterAssetSnapshot>,
pub tile_assets: Vec<JumpHopTileAssetSnapshot>,
pub path: JumpHopPath,
pub cover_image_src: String,
pub cover_composite: Option<String>,
pub publication_status: String,
pub publish_ready: bool,
pub play_count: u32,
pub generation_status: String,
pub updated_at_micros: i64,
pub published_at_micros: Option<i64>,
}
impl __sdk::InModule for JumpHopGalleryViewRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `JumpHopGalleryViewRow`.
///
/// Provides typed access to columns for query building.
pub struct JumpHopGalleryViewRowCols {
pub work_id: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub profile_id: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub source_session_id: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub author_display_name: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub work_title: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub work_description: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub theme_tags: __sdk::__query_builder::Col<JumpHopGalleryViewRow, Vec<String>>,
pub difficulty: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub style_preset: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub character_prompt: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub tile_prompt: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub end_mood_prompt: __sdk::__query_builder::Col<JumpHopGalleryViewRow, Option<String>>,
pub character_asset:
__sdk::__query_builder::Col<JumpHopGalleryViewRow, Option<JumpHopCharacterAssetSnapshot>>,
pub tile_atlas_asset:
__sdk::__query_builder::Col<JumpHopGalleryViewRow, Option<JumpHopCharacterAssetSnapshot>>,
pub tile_assets:
__sdk::__query_builder::Col<JumpHopGalleryViewRow, Vec<JumpHopTileAssetSnapshot>>,
pub path: __sdk::__query_builder::Col<JumpHopGalleryViewRow, JumpHopPath>,
pub cover_image_src: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub cover_composite: __sdk::__query_builder::Col<JumpHopGalleryViewRow, Option<String>>,
pub publication_status: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub publish_ready: __sdk::__query_builder::Col<JumpHopGalleryViewRow, bool>,
pub play_count: __sdk::__query_builder::Col<JumpHopGalleryViewRow, u32>,
pub generation_status: __sdk::__query_builder::Col<JumpHopGalleryViewRow, String>,
pub updated_at_micros: __sdk::__query_builder::Col<JumpHopGalleryViewRow, i64>,
pub published_at_micros: __sdk::__query_builder::Col<JumpHopGalleryViewRow, Option<i64>>,
}
impl __sdk::__query_builder::HasCols for JumpHopGalleryViewRow {
type Cols = JumpHopGalleryViewRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
JumpHopGalleryViewRowCols {
work_id: __sdk::__query_builder::Col::new(table_name, "work_id"),
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
source_session_id: __sdk::__query_builder::Col::new(table_name, "source_session_id"),
author_display_name: __sdk::__query_builder::Col::new(
table_name,
"author_display_name",
),
work_title: __sdk::__query_builder::Col::new(table_name, "work_title"),
work_description: __sdk::__query_builder::Col::new(table_name, "work_description"),
theme_tags: __sdk::__query_builder::Col::new(table_name, "theme_tags"),
difficulty: __sdk::__query_builder::Col::new(table_name, "difficulty"),
style_preset: __sdk::__query_builder::Col::new(table_name, "style_preset"),
character_prompt: __sdk::__query_builder::Col::new(table_name, "character_prompt"),
tile_prompt: __sdk::__query_builder::Col::new(table_name, "tile_prompt"),
end_mood_prompt: __sdk::__query_builder::Col::new(table_name, "end_mood_prompt"),
character_asset: __sdk::__query_builder::Col::new(table_name, "character_asset"),
tile_atlas_asset: __sdk::__query_builder::Col::new(table_name, "tile_atlas_asset"),
tile_assets: __sdk::__query_builder::Col::new(table_name, "tile_assets"),
path: __sdk::__query_builder::Col::new(table_name, "path"),
cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"),
cover_composite: __sdk::__query_builder::Col::new(table_name, "cover_composite"),
publication_status: __sdk::__query_builder::Col::new(table_name, "publication_status"),
publish_ready: __sdk::__query_builder::Col::new(table_name, "publish_ready"),
play_count: __sdk::__query_builder::Col::new(table_name, "play_count"),
generation_status: __sdk::__query_builder::Col::new(table_name, "generation_status"),
updated_at_micros: __sdk::__query_builder::Col::new(table_name, "updated_at_micros"),
published_at_micros: __sdk::__query_builder::Col::new(
table_name,
"published_at_micros",
),
}
}
}

View File

@@ -0,0 +1,116 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::jump_hop_character_asset_snapshot_type::JumpHopCharacterAssetSnapshot;
use super::jump_hop_gallery_view_row_type::JumpHopGalleryViewRow;
use super::jump_hop_path_type::JumpHopPath;
use super::jump_hop_tile_asset_snapshot_type::JumpHopTileAssetSnapshot;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `jump_hop_gallery_view`.
///
/// Obtain a handle from the [`JumpHopGalleryViewTableAccess::jump_hop_gallery_view`] method on [`super::RemoteTables`],
/// like `ctx.db.jump_hop_gallery_view()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_gallery_view().on_insert(...)`.
pub struct JumpHopGalleryViewTableHandle<'ctx> {
imp: __sdk::TableHandle<JumpHopGalleryViewRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `jump_hop_gallery_view`.
///
/// Implemented for [`super::RemoteTables`].
pub trait JumpHopGalleryViewTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`JumpHopGalleryViewTableHandle`], which mediates access to the table `jump_hop_gallery_view`.
fn jump_hop_gallery_view(&self) -> JumpHopGalleryViewTableHandle<'_>;
}
impl JumpHopGalleryViewTableAccess for super::RemoteTables {
fn jump_hop_gallery_view(&self) -> JumpHopGalleryViewTableHandle<'_> {
JumpHopGalleryViewTableHandle {
imp: self
.imp
.get_table::<JumpHopGalleryViewRow>("jump_hop_gallery_view"),
ctx: std::marker::PhantomData,
}
}
}
pub struct JumpHopGalleryViewInsertCallbackId(__sdk::CallbackId);
pub struct JumpHopGalleryViewDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for JumpHopGalleryViewTableHandle<'ctx> {
type Row = JumpHopGalleryViewRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = JumpHopGalleryViewRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = JumpHopGalleryViewInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopGalleryViewInsertCallbackId {
JumpHopGalleryViewInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: JumpHopGalleryViewInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = JumpHopGalleryViewDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopGalleryViewDeleteCallbackId {
JumpHopGalleryViewDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: JumpHopGalleryViewDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<JumpHopGalleryViewRow>("jump_hop_gallery_view");
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<JumpHopGalleryViewRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<JumpHopGalleryViewRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `JumpHopGalleryViewRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait jump_hop_gallery_viewQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `JumpHopGalleryViewRow`.
fn jump_hop_gallery_view(&self) -> __sdk::__query_builder::Table<JumpHopGalleryViewRow>;
}
impl jump_hop_gallery_viewQueryTableAccess for __sdk::QueryTableAccessor {
fn jump_hop_gallery_view(&self) -> __sdk::__query_builder::Table<JumpHopGalleryViewRow> {
__sdk::__query_builder::Table::new("jump_hop_gallery_view")
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_run_jump_input_type::JumpHopRunJumpInput;
use super::jump_hop_run_procedure_result_type::JumpHopRunProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct JumpHopJumpArgs {
pub input: JumpHopRunJumpInput,
}
impl __sdk::InModule for JumpHopJumpArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `jump_hop_jump`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait jump_hop_jump {
fn jump_hop_jump(&self, input: JumpHopRunJumpInput) {
self.jump_hop_jump_then(input, |_, _| {});
}
fn jump_hop_jump_then(
&self,
input: JumpHopRunJumpInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl jump_hop_jump for super::RemoteProcedures {
fn jump_hop_jump_then(
&self,
input: JumpHopRunJumpInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopRunProcedureResult>(
"jump_hop_jump",
JumpHopJumpArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,22 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
#[derive(Copy, Eq, Hash)]
pub enum JumpHopJumpResultKind {
Miss,
Hit,
Perfect,
Finish,
}
impl __sdk::InModule for JumpHopJumpResultKind {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,22 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_jump_result_kind_type::JumpHopJumpResultKind;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopLastJump {
pub charge_ms: u32,
pub jump_distance: f32,
pub target_platform_index: u32,
pub landed_x: f32,
pub landed_y: f32,
pub result: JumpHopJumpResultKind,
}
impl __sdk::InModule for JumpHopLastJump {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,24 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_difficulty_type::JumpHopDifficulty;
use super::jump_hop_platform_type::JumpHopPlatform;
use super::jump_hop_scoring_type::JumpHopScoring;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopPath {
pub seed: String,
pub difficulty: JumpHopDifficulty,
pub platforms: Vec<JumpHopPlatform>,
pub finish_index: u32,
pub camera_preset: String,
pub scoring: JumpHopScoring,
}
impl __sdk::InModule for JumpHopPath {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,25 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_tile_type_type::JumpHopTileType;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopPlatform {
pub platform_id: String,
pub tile_type: JumpHopTileType,
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub landing_radius: f32,
pub perfect_radius: f32,
pub score_value: u32,
}
impl __sdk::InModule for JumpHopPlatform {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,16 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopRunGetInput {
pub run_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for JumpHopRunGetInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopRunJumpInput {
pub run_id: String,
pub owner_user_id: String,
pub charge_ms: u32,
pub client_event_id: String,
pub jumped_at_ms: i64,
}
impl __sdk::InModule for JumpHopRunJumpInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_run_snapshot_type::JumpHopRunSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopRunProcedureResult {
pub ok: bool,
pub run: Option<JumpHopRunSnapshot>,
pub error_message: Option<String>,
}
impl __sdk::InModule for JumpHopRunProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopRunRestartInput {
pub source_run_id: String,
pub next_run_id: String,
pub owner_user_id: String,
pub client_action_id: String,
pub restarted_at_ms: i64,
}
impl __sdk::InModule for JumpHopRunRestartInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,29 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_last_jump_type::JumpHopLastJump;
use super::jump_hop_path_type::JumpHopPath;
use super::jump_hop_run_status_type::JumpHopRunStatus;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopRunSnapshot {
pub run_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub status: JumpHopRunStatus,
pub current_platform_index: u32,
pub score: u32,
pub combo: u32,
pub last_jump: Option<JumpHopLastJump>,
pub started_at_ms: u64,
pub finished_at_ms: Option<u64>,
pub path: JumpHopPath,
}
impl __sdk::InModule for JumpHopRunSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopRunStartInput {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub client_event_id: String,
pub started_at_ms: i64,
}
impl __sdk::InModule for JumpHopRunStartInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,20 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
#[derive(Copy, Eq, Hash)]
pub enum JumpHopRunStatus {
Playing,
Failed,
Cleared,
}
impl __sdk::InModule for JumpHopRunStatus {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,89 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopRuntimeRunRow {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub status: String,
pub started_at_ms: i64,
pub finished_at_ms: i64,
pub current_platform_index: u32,
pub score: u32,
pub combo: u32,
pub snapshot_json: String,
pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp,
}
impl __sdk::InModule for JumpHopRuntimeRunRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `JumpHopRuntimeRunRow`.
///
/// Provides typed access to columns for query building.
pub struct JumpHopRuntimeRunRowCols {
pub run_id: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, String>,
pub profile_id: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, String>,
pub status: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, String>,
pub started_at_ms: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, i64>,
pub finished_at_ms: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, i64>,
pub current_platform_index: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, u32>,
pub score: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, u32>,
pub combo: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, u32>,
pub snapshot_json: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, String>,
pub created_at: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<JumpHopRuntimeRunRow, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for JumpHopRuntimeRunRow {
type Cols = JumpHopRuntimeRunRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
JumpHopRuntimeRunRowCols {
run_id: __sdk::__query_builder::Col::new(table_name, "run_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
status: __sdk::__query_builder::Col::new(table_name, "status"),
started_at_ms: __sdk::__query_builder::Col::new(table_name, "started_at_ms"),
finished_at_ms: __sdk::__query_builder::Col::new(table_name, "finished_at_ms"),
current_platform_index: __sdk::__query_builder::Col::new(
table_name,
"current_platform_index",
),
score: __sdk::__query_builder::Col::new(table_name, "score"),
combo: __sdk::__query_builder::Col::new(table_name, "combo"),
snapshot_json: __sdk::__query_builder::Col::new(table_name, "snapshot_json"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
}
}
}
/// Indexed column accessor struct for the table `JumpHopRuntimeRunRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct JumpHopRuntimeRunRowIxCols {
pub owner_user_id: __sdk::__query_builder::IxCol<JumpHopRuntimeRunRow, String>,
pub profile_id: __sdk::__query_builder::IxCol<JumpHopRuntimeRunRow, String>,
pub run_id: __sdk::__query_builder::IxCol<JumpHopRuntimeRunRow, String>,
}
impl __sdk::__query_builder::HasIxCols for JumpHopRuntimeRunRow {
type IxCols = JumpHopRuntimeRunRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
JumpHopRuntimeRunRowIxCols {
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"),
run_id: __sdk::__query_builder::IxCol::new(table_name, "run_id"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for JumpHopRuntimeRunRow {}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::jump_hop_runtime_run_row_type::JumpHopRuntimeRunRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `jump_hop_runtime_run`.
///
/// Obtain a handle from the [`JumpHopRuntimeRunTableAccess::jump_hop_runtime_run`] method on [`super::RemoteTables`],
/// like `ctx.db.jump_hop_runtime_run()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_runtime_run().on_insert(...)`.
pub struct JumpHopRuntimeRunTableHandle<'ctx> {
imp: __sdk::TableHandle<JumpHopRuntimeRunRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `jump_hop_runtime_run`.
///
/// Implemented for [`super::RemoteTables`].
pub trait JumpHopRuntimeRunTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`JumpHopRuntimeRunTableHandle`], which mediates access to the table `jump_hop_runtime_run`.
fn jump_hop_runtime_run(&self) -> JumpHopRuntimeRunTableHandle<'_>;
}
impl JumpHopRuntimeRunTableAccess for super::RemoteTables {
fn jump_hop_runtime_run(&self) -> JumpHopRuntimeRunTableHandle<'_> {
JumpHopRuntimeRunTableHandle {
imp: self
.imp
.get_table::<JumpHopRuntimeRunRow>("jump_hop_runtime_run"),
ctx: std::marker::PhantomData,
}
}
}
pub struct JumpHopRuntimeRunInsertCallbackId(__sdk::CallbackId);
pub struct JumpHopRuntimeRunDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for JumpHopRuntimeRunTableHandle<'ctx> {
type Row = JumpHopRuntimeRunRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = JumpHopRuntimeRunRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = JumpHopRuntimeRunInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopRuntimeRunInsertCallbackId {
JumpHopRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: JumpHopRuntimeRunInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = JumpHopRuntimeRunDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopRuntimeRunDeleteCallbackId {
JumpHopRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: JumpHopRuntimeRunDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct JumpHopRuntimeRunUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopRuntimeRunTableHandle<'ctx> {
type UpdateCallbackId = JumpHopRuntimeRunUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> JumpHopRuntimeRunUpdateCallbackId {
JumpHopRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: JumpHopRuntimeRunUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `run_id` unique index on the table `jump_hop_runtime_run`,
/// which allows point queries on the field of the same name
/// via the [`JumpHopRuntimeRunRunIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_runtime_run().run_id().find(...)`.
pub struct JumpHopRuntimeRunRunIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<JumpHopRuntimeRunRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> JumpHopRuntimeRunTableHandle<'ctx> {
/// Get a handle on the `run_id` unique index on the table `jump_hop_runtime_run`.
pub fn run_id(&self) -> JumpHopRuntimeRunRunIdUnique<'ctx> {
JumpHopRuntimeRunRunIdUnique {
imp: self.imp.get_unique_constraint::<String>("run_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> JumpHopRuntimeRunRunIdUnique<'ctx> {
/// Find the subscribed row whose `run_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<JumpHopRuntimeRunRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<JumpHopRuntimeRunRow>("jump_hop_runtime_run");
_table.add_unique_constraint::<String>("run_id", |row| &row.run_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<JumpHopRuntimeRunRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<JumpHopRuntimeRunRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `JumpHopRuntimeRunRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait jump_hop_runtime_runQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `JumpHopRuntimeRunRow`.
fn jump_hop_runtime_run(&self) -> __sdk::__query_builder::Table<JumpHopRuntimeRunRow>;
}
impl jump_hop_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
fn jump_hop_runtime_run(&self) -> __sdk::__query_builder::Table<JumpHopRuntimeRunRow> {
__sdk::__query_builder::Table::new("jump_hop_runtime_run")
}
}

View File

@@ -0,0 +1,18 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopScoring {
pub charge_to_distance_ratio: f32,
pub max_charge_ms: u32,
pub hit_bonus: u32,
pub perfect_bonus: u32,
}
impl __sdk::InModule for JumpHopScoring {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,23 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopTileAssetSnapshot {
pub tile_type: String,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub source_atlas_cell: String,
pub visual_width: u32,
pub visual_height: u32,
pub top_surface_radius: f32,
pub landing_radius: f32,
}
impl __sdk::InModule for JumpHopTileAssetSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,26 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
#[derive(Copy, Eq, Hash)]
pub enum JumpHopTileType {
Start,
Normal,
Target,
Finish,
Bonus,
Accent,
}
impl __sdk::InModule for JumpHopTileType {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,16 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopWorkGetInput {
pub profile_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for JumpHopWorkGetInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_work_snapshot_type::JumpHopWorkSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopWorkProcedureResult {
pub ok: bool,
pub work: Option<JumpHopWorkSnapshot>,
pub error_message: Option<String>,
}
impl __sdk::InModule for JumpHopWorkProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,134 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopWorkProfileRow {
pub profile_id: String,
pub work_id: String,
pub owner_user_id: String,
pub source_session_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: String,
pub difficulty: String,
pub style_preset: String,
pub character_prompt: String,
pub tile_prompt: String,
pub end_mood_prompt: String,
pub character_asset_json: String,
pub tile_atlas_asset_json: String,
pub tile_assets_json: String,
pub path_json: String,
pub cover_image_src: String,
pub cover_composite: String,
pub generation_status: String,
pub publication_status: String,
pub play_count: u32,
pub updated_at: __sdk::Timestamp,
pub published_at: Option<__sdk::Timestamp>,
}
impl __sdk::InModule for JumpHopWorkProfileRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `JumpHopWorkProfileRow`.
///
/// Provides typed access to columns for query building.
pub struct JumpHopWorkProfileRowCols {
pub profile_id: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub work_id: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub source_session_id: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub author_display_name: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub work_title: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub work_description: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub theme_tags_json: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub difficulty: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub style_preset: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub character_prompt: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub tile_prompt: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub end_mood_prompt: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub character_asset_json: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub tile_atlas_asset_json: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub tile_assets_json: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub path_json: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub cover_image_src: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub cover_composite: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub generation_status: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub publication_status: __sdk::__query_builder::Col<JumpHopWorkProfileRow, String>,
pub play_count: __sdk::__query_builder::Col<JumpHopWorkProfileRow, u32>,
pub updated_at: __sdk::__query_builder::Col<JumpHopWorkProfileRow, __sdk::Timestamp>,
pub published_at: __sdk::__query_builder::Col<JumpHopWorkProfileRow, Option<__sdk::Timestamp>>,
}
impl __sdk::__query_builder::HasCols for JumpHopWorkProfileRow {
type Cols = JumpHopWorkProfileRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
JumpHopWorkProfileRowCols {
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
work_id: __sdk::__query_builder::Col::new(table_name, "work_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
source_session_id: __sdk::__query_builder::Col::new(table_name, "source_session_id"),
author_display_name: __sdk::__query_builder::Col::new(
table_name,
"author_display_name",
),
work_title: __sdk::__query_builder::Col::new(table_name, "work_title"),
work_description: __sdk::__query_builder::Col::new(table_name, "work_description"),
theme_tags_json: __sdk::__query_builder::Col::new(table_name, "theme_tags_json"),
difficulty: __sdk::__query_builder::Col::new(table_name, "difficulty"),
style_preset: __sdk::__query_builder::Col::new(table_name, "style_preset"),
character_prompt: __sdk::__query_builder::Col::new(table_name, "character_prompt"),
tile_prompt: __sdk::__query_builder::Col::new(table_name, "tile_prompt"),
end_mood_prompt: __sdk::__query_builder::Col::new(table_name, "end_mood_prompt"),
character_asset_json: __sdk::__query_builder::Col::new(
table_name,
"character_asset_json",
),
tile_atlas_asset_json: __sdk::__query_builder::Col::new(
table_name,
"tile_atlas_asset_json",
),
tile_assets_json: __sdk::__query_builder::Col::new(table_name, "tile_assets_json"),
path_json: __sdk::__query_builder::Col::new(table_name, "path_json"),
cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"),
cover_composite: __sdk::__query_builder::Col::new(table_name, "cover_composite"),
generation_status: __sdk::__query_builder::Col::new(table_name, "generation_status"),
publication_status: __sdk::__query_builder::Col::new(table_name, "publication_status"),
play_count: __sdk::__query_builder::Col::new(table_name, "play_count"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
published_at: __sdk::__query_builder::Col::new(table_name, "published_at"),
}
}
}
/// Indexed column accessor struct for the table `JumpHopWorkProfileRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct JumpHopWorkProfileRowIxCols {
pub owner_user_id: __sdk::__query_builder::IxCol<JumpHopWorkProfileRow, String>,
pub profile_id: __sdk::__query_builder::IxCol<JumpHopWorkProfileRow, String>,
pub publication_status: __sdk::__query_builder::IxCol<JumpHopWorkProfileRow, String>,
}
impl __sdk::__query_builder::HasIxCols for JumpHopWorkProfileRow {
type IxCols = JumpHopWorkProfileRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
JumpHopWorkProfileRowIxCols {
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"),
publication_status: __sdk::__query_builder::IxCol::new(
table_name,
"publication_status",
),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for JumpHopWorkProfileRow {}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::jump_hop_work_profile_row_type::JumpHopWorkProfileRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `jump_hop_work_profile`.
///
/// Obtain a handle from the [`JumpHopWorkProfileTableAccess::jump_hop_work_profile`] method on [`super::RemoteTables`],
/// like `ctx.db.jump_hop_work_profile()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_work_profile().on_insert(...)`.
pub struct JumpHopWorkProfileTableHandle<'ctx> {
imp: __sdk::TableHandle<JumpHopWorkProfileRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `jump_hop_work_profile`.
///
/// Implemented for [`super::RemoteTables`].
pub trait JumpHopWorkProfileTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`JumpHopWorkProfileTableHandle`], which mediates access to the table `jump_hop_work_profile`.
fn jump_hop_work_profile(&self) -> JumpHopWorkProfileTableHandle<'_>;
}
impl JumpHopWorkProfileTableAccess for super::RemoteTables {
fn jump_hop_work_profile(&self) -> JumpHopWorkProfileTableHandle<'_> {
JumpHopWorkProfileTableHandle {
imp: self
.imp
.get_table::<JumpHopWorkProfileRow>("jump_hop_work_profile"),
ctx: std::marker::PhantomData,
}
}
}
pub struct JumpHopWorkProfileInsertCallbackId(__sdk::CallbackId);
pub struct JumpHopWorkProfileDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for JumpHopWorkProfileTableHandle<'ctx> {
type Row = JumpHopWorkProfileRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = JumpHopWorkProfileRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = JumpHopWorkProfileInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopWorkProfileInsertCallbackId {
JumpHopWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: JumpHopWorkProfileInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = JumpHopWorkProfileDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> JumpHopWorkProfileDeleteCallbackId {
JumpHopWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: JumpHopWorkProfileDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct JumpHopWorkProfileUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopWorkProfileTableHandle<'ctx> {
type UpdateCallbackId = JumpHopWorkProfileUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> JumpHopWorkProfileUpdateCallbackId {
JumpHopWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: JumpHopWorkProfileUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `profile_id` unique index on the table `jump_hop_work_profile`,
/// which allows point queries on the field of the same name
/// via the [`JumpHopWorkProfileProfileIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.jump_hop_work_profile().profile_id().find(...)`.
pub struct JumpHopWorkProfileProfileIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<JumpHopWorkProfileRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> JumpHopWorkProfileTableHandle<'ctx> {
/// Get a handle on the `profile_id` unique index on the table `jump_hop_work_profile`.
pub fn profile_id(&self) -> JumpHopWorkProfileProfileIdUnique<'ctx> {
JumpHopWorkProfileProfileIdUnique {
imp: self.imp.get_unique_constraint::<String>("profile_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> JumpHopWorkProfileProfileIdUnique<'ctx> {
/// Find the subscribed row whose `profile_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<JumpHopWorkProfileRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<JumpHopWorkProfileRow>("jump_hop_work_profile");
_table.add_unique_constraint::<String>("profile_id", |row| &row.profile_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<JumpHopWorkProfileRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<JumpHopWorkProfileRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `JumpHopWorkProfileRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait jump_hop_work_profileQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `JumpHopWorkProfileRow`.
fn jump_hop_work_profile(&self) -> __sdk::__query_builder::Table<JumpHopWorkProfileRow>;
}
impl jump_hop_work_profileQueryTableAccess for __sdk::QueryTableAccessor {
fn jump_hop_work_profile(&self) -> __sdk::__query_builder::Table<JumpHopWorkProfileRow> {
__sdk::__query_builder::Table::new("jump_hop_work_profile")
}
}

View File

@@ -0,0 +1,17 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopWorkPublishInput {
pub profile_id: String,
pub owner_user_id: String,
pub published_at_micros: i64,
}
impl __sdk::InModule for JumpHopWorkPublishInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,43 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_character_asset_snapshot_type::JumpHopCharacterAssetSnapshot;
use super::jump_hop_path_type::JumpHopPath;
use super::jump_hop_tile_asset_snapshot_type::JumpHopTileAssetSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopWorkSnapshot {
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub source_session_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub difficulty: String,
pub style_preset: String,
pub character_prompt: String,
pub tile_prompt: String,
pub end_mood_prompt: Option<String>,
pub character_asset: Option<JumpHopCharacterAssetSnapshot>,
pub tile_atlas_asset: Option<JumpHopCharacterAssetSnapshot>,
pub tile_assets: Vec<JumpHopTileAssetSnapshot>,
pub path: JumpHopPath,
pub cover_image_src: String,
pub cover_composite: Option<String>,
pub publication_status: String,
pub publish_ready: bool,
pub play_count: u32,
pub generation_status: String,
pub updated_at_micros: i64,
pub published_at_micros: Option<i64>,
}
impl __sdk::InModule for JumpHopWorkSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,24 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopWorkUpdateInput {
pub profile_id: String,
pub owner_user_id: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: String,
pub difficulty: Option<String>,
pub style_preset: Option<String>,
pub cover_image_src: Option<String>,
pub cover_composite: Option<String>,
pub updated_at_micros: i64,
}
impl __sdk::InModule for JumpHopWorkUpdateInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,16 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopWorksListInput {
pub owner_user_id: String,
pub published_only: bool,
}
impl __sdk::InModule for JumpHopWorksListInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_work_snapshot_type::JumpHopWorkSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct JumpHopWorksProcedureResult {
pub ok: bool,
pub items: Vec<JumpHopWorkSnapshot>,
pub error_message: Option<String>,
}
impl __sdk::InModule for JumpHopWorksProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_works_list_input_type::JumpHopWorksListInput;
use super::jump_hop_works_procedure_result_type::JumpHopWorksProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct ListJumpHopWorksArgs {
pub input: JumpHopWorksListInput,
}
impl __sdk::InModule for ListJumpHopWorksArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `list_jump_hop_works`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait list_jump_hop_works {
fn list_jump_hop_works(&self, input: JumpHopWorksListInput) {
self.list_jump_hop_works_then(input, |_, _| {});
}
fn list_jump_hop_works_then(
&self,
input: JumpHopWorksListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopWorksProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl list_jump_hop_works for super::RemoteProcedures {
fn list_jump_hop_works_then(
&self,
input: JumpHopWorksListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopWorksProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopWorksProcedureResult>(
"list_jump_hop_works",
ListJumpHopWorksArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_work_procedure_result_type::JumpHopWorkProcedureResult;
use super::jump_hop_work_publish_input_type::JumpHopWorkPublishInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct PublishJumpHopWorkArgs {
pub input: JumpHopWorkPublishInput,
}
impl __sdk::InModule for PublishJumpHopWorkArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `publish_jump_hop_work`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait publish_jump_hop_work {
fn publish_jump_hop_work(&self, input: JumpHopWorkPublishInput) {
self.publish_jump_hop_work_then(input, |_, _| {});
}
fn publish_jump_hop_work_then(
&self,
input: JumpHopWorkPublishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl publish_jump_hop_work for super::RemoteProcedures {
fn publish_jump_hop_work_then(
&self,
input: JumpHopWorkPublishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopWorkProcedureResult>(
"publish_jump_hop_work",
PublishJumpHopWorkArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_run_procedure_result_type::JumpHopRunProcedureResult;
use super::jump_hop_run_restart_input_type::JumpHopRunRestartInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct RestartJumpHopRunArgs {
pub input: JumpHopRunRestartInput,
}
impl __sdk::InModule for RestartJumpHopRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `restart_jump_hop_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait restart_jump_hop_run {
fn restart_jump_hop_run(&self, input: JumpHopRunRestartInput) {
self.restart_jump_hop_run_then(input, |_, _| {});
}
fn restart_jump_hop_run_then(
&self,
input: JumpHopRunRestartInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl restart_jump_hop_run for super::RemoteProcedures {
fn restart_jump_hop_run_then(
&self,
input: JumpHopRunRestartInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopRunProcedureResult>(
"restart_jump_hop_run",
RestartJumpHopRunArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_run_procedure_result_type::JumpHopRunProcedureResult;
use super::jump_hop_run_start_input_type::JumpHopRunStartInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct StartJumpHopRunArgs {
pub input: JumpHopRunStartInput,
}
impl __sdk::InModule for StartJumpHopRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `start_jump_hop_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait start_jump_hop_run {
fn start_jump_hop_run(&self, input: JumpHopRunStartInput) {
self.start_jump_hop_run_then(input, |_, _| {});
}
fn start_jump_hop_run_then(
&self,
input: JumpHopRunStartInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl start_jump_hop_run for super::RemoteProcedures {
fn start_jump_hop_run_then(
&self,
input: JumpHopRunStartInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopRunProcedureResult>(
"start_jump_hop_run",
StartJumpHopRunArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::jump_hop_work_procedure_result_type::JumpHopWorkProcedureResult;
use super::jump_hop_work_update_input_type::JumpHopWorkUpdateInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct UpdateJumpHopWorkArgs {
pub input: JumpHopWorkUpdateInput,
}
impl __sdk::InModule for UpdateJumpHopWorkArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `update_jump_hop_work`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait update_jump_hop_work {
fn update_jump_hop_work(&self, input: JumpHopWorkUpdateInput) {
self.update_jump_hop_work_then(input, |_, _| {});
}
fn update_jump_hop_work_then(
&self,
input: JumpHopWorkUpdateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl update_jump_hop_work for super::RemoteProcedures {
fn update_jump_hop_work_then(
&self,
input: JumpHopWorkUpdateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopWorkProcedureResult>(
"update_jump_hop_work",
UpdateJumpHopWorkArgs { input },
__callback,
);
}
}

View File

@@ -595,7 +595,18 @@ impl SpacetimeClient {
let procedure_inputs = events let procedure_inputs = events
.into_iter() .into_iter()
.map(crate::module_bindings::RuntimeTrackingEventInput::from) .map(|event| crate::module_bindings::RuntimeTrackingEventInput {
event_id: event.event_id,
event_key: event.event_key,
scope_kind: map_runtime_tracking_scope_kind(event.scope_kind),
scope_id: event.scope_id,
user_id: event.user_id,
owner_user_id: event.owner_user_id,
profile_id: event.profile_id,
module_key: event.module_key,
metadata_json: event.metadata_json,
occurred_at_micros: event.occurred_at_micros,
})
.collect::<Vec<_>>(); .collect::<Vec<_>>();
self.call_after_connect( self.call_after_connect(

Some files were not shown because too many files have changed in this diff Show More