Merge remote-tracking branch 'origin/master' into codex/tiaoyitiao

# Conflicts:
#	server-rs/crates/api-server/src/jump_hop.rs
#	server-rs/crates/api-server/src/modules/jump_hop.rs
This commit is contained in:
2026-06-06 21:04:46 +08:00
451 changed files with 25780 additions and 2687 deletions

View File

@@ -29,6 +29,7 @@ module-inventory = { workspace = true }
module-match3d = { workspace = true }
module-npc = { workspace = true }
module-puzzle = { workspace = true }
module-puzzle-clear = { workspace = true }
module-runtime = { workspace = true }
module-runtime-story = { workspace = true }
module-runtime-item = { workspace = true }

View File

@@ -67,6 +67,7 @@ pub fn build_router(state: AppState) -> Router {
.merge(modules::jump_hop::router(state.clone()))
.merge(modules::wooden_fish::router(state.clone()))
.merge(modules::public_work::router(state.clone()))
.merge(modules::puzzle_clear::router(state.clone()))
.merge(modules::puzzle::router(state.clone()))
.merge(visual_novel_router(state.clone()))
.route(
@@ -2697,6 +2698,18 @@ mod tests {
bind_payload["user"]["phoneNumberMasked"],
Value::String("138****8000".to_string())
);
assert_eq!(
bind_payload["user"]["phoneNumber"],
Value::String("+8613800138000".to_string())
);
assert_eq!(
bind_payload["user"]["wechatAccount"],
Value::String("wx-mini-code-bind-001".to_string())
);
assert_eq!(
bind_payload["user"]["wechatDisplayName"],
Value::String("微信旅人".to_string())
);
assert!(
bind_payload["token"]
.as_str()
@@ -3384,6 +3397,10 @@ mod tests {
serde_json::from_slice(&body).expect("response body should be valid json");
assert_eq!(payload["user"]["id"], Value::String(seed_user.id));
assert_eq!(
payload["user"]["phoneNumber"],
Value::String("+8613800138016".to_string())
);
assert_eq!(
payload["availableLoginMethods"],
serde_json::json!(["phone", "password", "wechat"])
@@ -4119,8 +4136,7 @@ mod tests {
.await
.expect("banners body should collect")
.to_bytes();
let payload: Value =
serde_json::from_slice(&body).expect("banners payload should be json");
let payload: Value = serde_json::from_slice(&body).expect("banners payload should be json");
assert_eq!(payload["eventBanners"][0]["title"], "后台表单公告");
assert_eq!(payload["eventBanners"][0]["renderMode"], "html");

View File

@@ -7,10 +7,13 @@ pub fn map_auth_user_payload(user: AuthUser) -> AuthUserPayload {
public_user_code: user.public_user_code,
display_name: user.display_name,
avatar_url: user.avatar_url,
phone_number: user.phone_number,
phone_number_masked: user.phone_number_masked,
login_method: user.login_method.as_str().to_string(),
binding_status: user.binding_status.as_str().to_string(),
wechat_bound: user.wechat_bound,
wechat_display_name: user.wechat_display_name,
wechat_account: user.wechat_account,
}
}

View File

@@ -30,7 +30,7 @@ use shared_kernel::{
use spacetime_client::{
BarkBattleDraftConfigUpsertRecordInput, BarkBattleDraftCreateRecordInput,
BarkBattleRunFinishRecordInput, BarkBattleRunRecord, BarkBattleRunStartRecordInput,
BarkBattleWorkPublishRecordInput, SpacetimeClientError,
BarkBattleWorkDeleteRecordInput, BarkBattleWorkPublishRecordInput, SpacetimeClientError,
};
use time::{Duration as TimeDuration, OffsetDateTime};
@@ -406,6 +406,38 @@ pub async fn list_bark_battle_works(
))
}
pub async fn delete_bark_battle_work(
State(state): State<AppState>,
Path(work_id): Path<String>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
) -> Result<Json<Value>, Response> {
ensure_non_empty(&request_context, &work_id, "workId")?;
let items = state
.spacetime_client()
.delete_bark_battle_work(BarkBattleWorkDeleteRecordInput {
work_id,
owner_user_id: authenticated.claims().user_id().to_string(),
})
.await
.map_err(|error| {
bark_battle_error_response(&request_context, map_bark_battle_client_error(error))
})?;
let items = items
.into_iter()
.map(|item| {
let author_display_name =
resolve_bark_battle_author_display_name_for_record(&state, &item);
map_work_summary_record(item, &request_context, author_display_name)
})
.collect::<Result<Vec<_>, _>>()?;
Ok(json_success_body(
Some(&request_context),
BarkBattleWorksResponse { items },
))
}
pub async fn list_bark_battle_gallery(
State(state): State<AppState>,
Extension(request_context): Extension<RequestContext>,

View File

@@ -77,17 +77,13 @@ pub fn resolve_creation_entry_route_id(path: &str) -> Option<&'static str> {
{
return Some("puzzle");
}
if normalized.starts_with("/api/runtime/puzzle/gallery/")
&& normalized.ends_with("/remix")
{
if normalized.starts_with("/api/runtime/puzzle/gallery/") && normalized.ends_with("/remix") {
return Some("puzzle");
}
if normalized == "/api/runtime/big-fish/agent/sessions" {
return Some("big-fish");
}
if normalized.starts_with("/api/runtime/big-fish/gallery/")
&& normalized.ends_with("/remix")
{
if normalized.starts_with("/api/runtime/big-fish/gallery/") && normalized.ends_with("/remix") {
return Some("big-fish");
}
if normalized == "/api/runtime/custom-world/agent/sessions"
@@ -115,6 +111,9 @@ pub fn resolve_creation_entry_route_id(path: &str) -> Option<&'static str> {
if normalized == "/api/creation/jump-hop/sessions" {
return Some("jump-hop");
}
if normalized == "/api/creation/puzzle-clear/sessions" {
return Some("puzzle-clear");
}
if normalized == "/api/creation/visual-novel/sessions" {
return Some("visual-novel");
}
@@ -178,6 +177,10 @@ mod tests {
resolve_creation_entry_route_id("/api/runtime/puzzle/agent/sessions"),
Some("puzzle"),
);
assert_eq!(
resolve_creation_entry_route_id("/api/creation/puzzle-clear/sessions"),
Some("puzzle-clear"),
);
assert_eq!(
resolve_creation_entry_route_id("/api/runtime/puzzle/gallery/profile-1/remix"),
Some("puzzle"),
@@ -236,6 +239,10 @@ mod tests {
resolve_creation_entry_route_id("/api/runtime/wooden-fish/runs/run-1"),
None,
);
assert_eq!(
resolve_creation_entry_route_id("/api/runtime/puzzle-clear/runs/run-1"),
None,
);
assert_eq!(
resolve_creation_entry_route_id("/api/creation/wooden-fish/sessions"),
Some("wooden-fish"),

View File

@@ -42,6 +42,10 @@ impl AppError {
&self.message
}
pub fn details(&self) -> Option<&Value> {
self.details.as_ref()
}
pub fn body_text(&self) -> String {
// 批处理任务不能只读 HTTP 状态文案,否则 DashScope 返回的真实失败原因会被压成“上游服务请求失败”。
self.details

View File

@@ -250,6 +250,36 @@ pub async fn get_jump_hop_work_detail(
))
}
pub async fn delete_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 works = state
.spacetime_client()
.delete_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),
JumpHopWorksResponse {
items: works.into_iter().map(|work| work.summary).collect(),
},
))
}
pub async fn get_jump_hop_runtime_work(
State(state): State<AppState>,
Path(profile_id): Path<String>,
@@ -311,7 +341,10 @@ pub async fn start_jump_hop_run(
) -> 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 is_draft_runtime = payload.runtime_mode.as_deref() == Some("draft");
let is_draft_runtime = payload
.runtime_mode
.as_deref()
.is_some_and(is_jump_hop_draft_runtime_mode);
let owner_user_id = principal.subject().to_string();
let principal_kind = principal.kind().as_str();
let run = state
@@ -1268,6 +1301,10 @@ fn build_jump_hop_work_play_tracking_draft(
WorkPlayTrackingDraft::runtime_principal("jump-hop", work_id, principal, source_route)
}
fn is_jump_hop_draft_runtime_mode(runtime_mode: &str) -> bool {
runtime_mode.trim().eq_ignore_ascii_case("draft")
}
fn build_jump_hop_draft(payload: &JumpHopWorkspaceCreateRequest) -> JumpHopDraftResponse {
let theme_text = normalize_theme_text(&payload.theme_text, &payload.work_title);
JumpHopDraftResponse {
@@ -1450,6 +1487,14 @@ fn current_utc_micros() -> i64 {
mod tests {
use super::*;
#[test]
fn jump_hop_draft_runtime_mode_detection_matches_client_normalization() {
assert!(is_jump_hop_draft_runtime_mode("draft"));
assert!(is_jump_hop_draft_runtime_mode(" DRAFT "));
assert!(!is_jump_hop_draft_runtime_mode("published"));
assert!(!is_jump_hop_draft_runtime_mode(""));
}
#[test]
fn jump_hop_tile_atlas_prompt_uses_dedicated_five_by_five_floor_layout() {
let prompt = build_jump_hop_tile_atlas_prompt("森林冒险", "森林主题清爽游戏化立体感平台");

View File

@@ -64,6 +64,7 @@ mod prompt;
mod public_work;
mod puzzle;
mod puzzle_agent_turn;
mod puzzle_clear;
mod puzzle_gallery_cache;
mod refresh_session;
mod registration_reward;

View File

@@ -13,6 +13,7 @@ pub mod platform;
pub mod profile;
pub mod public_work;
pub mod puzzle;
pub mod puzzle_clear;
pub mod square_hole;
pub mod story;
pub mod wooden_fish;

View File

@@ -1,15 +1,15 @@
use axum::{
Router, middleware,
routing::{get, post},
routing::{delete, get, post},
};
use crate::{
auth::require_bearer_auth,
bark_battle::{
create_bark_battle_draft, finish_bark_battle_run, generate_bark_battle_image_asset,
get_bark_battle_run, get_bark_battle_runtime_config, list_bark_battle_gallery,
list_bark_battle_works, publish_bark_battle_work, start_bark_battle_run,
update_bark_battle_draft_config,
create_bark_battle_draft, delete_bark_battle_work, finish_bark_battle_run,
generate_bark_battle_image_asset, get_bark_battle_run, get_bark_battle_runtime_config,
list_bark_battle_gallery, list_bark_battle_works, publish_bark_battle_work,
start_bark_battle_run, update_bark_battle_draft_config,
},
state::AppState,
};
@@ -51,6 +51,13 @@ pub fn router(state: AppState) -> Router<AppState> {
require_bearer_auth,
)),
)
.route(
"/api/runtime/bark-battle/works/{work_id}",
delete(delete_bark_battle_work).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/bark-battle/gallery",
get(list_bark_battle_gallery),

View File

@@ -1,16 +1,17 @@
use axum::{
Router, middleware,
middleware,
routing::{get, post},
Router,
};
use crate::{
auth::{require_bearer_auth, require_runtime_principal_auth},
jump_hop::{
create_jump_hop_session, execute_jump_hop_action, get_jump_hop_gallery_detail,
get_jump_hop_leaderboard, get_jump_hop_runtime_work, get_jump_hop_session,
get_jump_hop_work_detail,
jump_hop_run_jump, list_jump_hop_gallery, list_jump_hop_works, publish_jump_hop_work,
restart_jump_hop_run, start_jump_hop_run,
create_jump_hop_session, delete_jump_hop_work, execute_jump_hop_action,
get_jump_hop_gallery_detail, get_jump_hop_leaderboard, get_jump_hop_runtime_work,
get_jump_hop_session, get_jump_hop_work_detail, jump_hop_run_jump,
list_jump_hop_gallery, list_jump_hop_works, publish_jump_hop_work, restart_jump_hop_run,
start_jump_hop_run,
},
state::AppState,
};
@@ -47,10 +48,12 @@ pub fn router(state: AppState) -> Router<AppState> {
)
.route(
"/api/creation/jump-hop/works/{profile_id}",
get(get_jump_hop_work_detail).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
get(get_jump_hop_work_detail)
.delete(delete_jump_hop_work)
.route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/jump-hop/works/{profile_id}/publish",

View File

@@ -0,0 +1,116 @@
use axum::{
Router, middleware,
routing::{get, post},
};
use crate::{
auth::{require_bearer_auth, require_runtime_principal_auth},
puzzle_clear::{
advance_puzzle_clear_next_level, create_puzzle_clear_session, execute_puzzle_clear_action,
get_puzzle_clear_gallery_detail, get_puzzle_clear_run, get_puzzle_clear_runtime_work,
get_puzzle_clear_session, get_puzzle_clear_work, list_puzzle_clear_gallery,
list_puzzle_clear_works, mark_puzzle_clear_level_time_up, publish_puzzle_clear_work,
retry_puzzle_clear_level, start_puzzle_clear_run, swap_puzzle_clear_cards,
},
state::AppState,
};
pub fn router(state: AppState) -> Router<AppState> {
Router::new()
.route(
"/api/creation/puzzle-clear/sessions",
post(create_puzzle_clear_session).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/puzzle-clear/sessions/{session_id}",
get(get_puzzle_clear_session).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/puzzle-clear/sessions/{session_id}/actions",
post(execute_puzzle_clear_action).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/puzzle-clear/works",
get(list_puzzle_clear_works).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/puzzle-clear/works/{profile_id}",
get(get_puzzle_clear_work).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/puzzle-clear/works/{profile_id}/publish",
post(publish_puzzle_clear_work).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/puzzle-clear/works/{profile_id}",
get(get_puzzle_clear_runtime_work),
)
.route(
"/api/runtime/puzzle-clear/runs",
post(start_puzzle_clear_run).route_layer(middleware::from_fn_with_state(
state.clone(),
require_runtime_principal_auth,
)),
)
.route(
"/api/runtime/puzzle-clear/runs/{run_id}",
get(get_puzzle_clear_run).route_layer(middleware::from_fn_with_state(
state.clone(),
require_runtime_principal_auth,
)),
)
.route(
"/api/runtime/puzzle-clear/runs/{run_id}/swap",
post(swap_puzzle_clear_cards).route_layer(middleware::from_fn_with_state(
state.clone(),
require_runtime_principal_auth,
)),
)
.route(
"/api/runtime/puzzle-clear/runs/{run_id}/retry-level",
post(retry_puzzle_clear_level).route_layer(middleware::from_fn_with_state(
state.clone(),
require_runtime_principal_auth,
)),
)
.route(
"/api/runtime/puzzle-clear/runs/{run_id}/next-level",
post(advance_puzzle_clear_next_level).route_layer(middleware::from_fn_with_state(
state.clone(),
require_runtime_principal_auth,
)),
)
.route(
"/api/runtime/puzzle-clear/runs/{run_id}/time-up",
post(mark_puzzle_clear_level_time_up).route_layer(middleware::from_fn_with_state(
state.clone(),
require_runtime_principal_auth,
)),
)
.route(
"/api/runtime/puzzle-clear/gallery",
get(list_puzzle_clear_gallery),
)
.route(
"/api/runtime/puzzle-clear/gallery/{public_work_code}",
get(get_puzzle_clear_gallery_detail),
)
}

View File

@@ -1,16 +1,16 @@
use axum::{
Router, middleware,
routing::{get, post},
routing::{delete, get, post},
};
use crate::{
auth::{require_bearer_auth, require_runtime_principal_auth},
state::AppState,
wooden_fish::{
checkpoint_wooden_fish_run, create_wooden_fish_session, execute_wooden_fish_action,
finish_wooden_fish_run, get_wooden_fish_gallery_detail, get_wooden_fish_runtime_work,
get_wooden_fish_session, list_wooden_fish_gallery, list_wooden_fish_works,
publish_wooden_fish_work, start_wooden_fish_run,
checkpoint_wooden_fish_run, create_wooden_fish_session, delete_wooden_fish_work,
execute_wooden_fish_action, finish_wooden_fish_run, get_wooden_fish_gallery_detail,
get_wooden_fish_runtime_work, get_wooden_fish_session, list_wooden_fish_gallery,
list_wooden_fish_works, publish_wooden_fish_work, start_wooden_fish_run,
},
};
@@ -44,6 +44,13 @@ pub fn router(state: AppState) -> Router<AppState> {
require_bearer_auth,
)),
)
.route(
"/api/creation/wooden-fish/works/{profile_id}",
delete(delete_wooden_fish_work).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/wooden-fish/works/{profile_id}/publish",
post(publish_wooden_fish_work).route_layer(middleware::from_fn_with_state(

View File

@@ -1,5 +1,6 @@
use std::{
collections::BTreeMap,
collections::{BTreeMap, HashSet},
sync::{Mutex, OnceLock},
time::{Instant, SystemTime, UNIX_EPOCH},
};
@@ -130,6 +131,73 @@ const PUZZLE_UI_BACKGROUND_PROMPT_FALLBACK_MARKER: &str =
const PUZZLE_VECTOR_ENGINE_SQUARE_IMAGE_SIZE: &str = "1024x1024";
const PUZZLE_VECTOR_ENGINE_PORTRAIT_IMAGE_SIZE: &str = "1024x1536";
static PUZZLE_BACKGROUND_COMPILE_TASKS: OnceLock<Mutex<HashSet<String>>> = OnceLock::new();
fn puzzle_background_compile_tasks() -> &'static Mutex<HashSet<String>> {
PUZZLE_BACKGROUND_COMPILE_TASKS.get_or_init(|| Mutex::new(HashSet::new()))
}
fn try_register_puzzle_background_compile_task(session_id: &str) -> bool {
match puzzle_background_compile_tasks().lock() {
Ok(mut tasks) => tasks.insert(session_id.to_string()),
Err(error) => {
tracing::warn!(
provider = PUZZLE_AGENT_API_BASE_PROVIDER,
session_id,
error = %error,
"拼图后台生成任务注册表锁已损坏,允许本次任务继续"
);
true
}
}
}
fn unregister_puzzle_background_compile_task(session_id: &str) {
match puzzle_background_compile_tasks().lock() {
Ok(mut tasks) => {
tasks.remove(session_id);
}
Err(error) => {
tracing::warn!(
provider = PUZZLE_AGENT_API_BASE_PROVIDER,
session_id,
error = %error,
"拼图后台生成任务注册表解锁失败,忽略清理"
);
}
}
}
fn has_puzzle_cover_image_src(value: &Option<String>) -> bool {
value
.as_deref()
.map(str::trim)
.is_some_and(|value| !value.is_empty())
}
fn mark_puzzle_initial_generation_started_snapshot(
mut session: PuzzleAgentSessionRecord,
) -> PuzzleAgentSessionRecord {
session.stage = "image_refining".to_string();
session.progress_percent = session.progress_percent.max(88);
if let Some(draft) = session.draft.as_mut() {
let draft_needs_cover = !has_puzzle_cover_image_src(&draft.cover_image_src);
if let Some(primary_level) = draft.levels.first_mut() {
if !has_puzzle_cover_image_src(&primary_level.cover_image_src) {
primary_level.generation_status = "generating".to_string();
}
draft.generation_status = primary_level.generation_status.clone();
draft.candidates = primary_level.candidates.clone();
draft.selected_candidate_id = primary_level.selected_candidate_id.clone();
draft.cover_image_src = primary_level.cover_image_src.clone();
draft.cover_asset_id = primary_level.cover_asset_id.clone();
} else if draft_needs_cover {
draft.generation_status = "generating".to_string();
}
}
session
}
pub(crate) fn format_puzzle_reference_image_upload_bytes(bytes: usize) -> String {
format!("{:.1}MB", bytes as f64 / 1024.0 / 1024.0)
}

View File

@@ -1177,21 +1177,16 @@ pub(crate) fn find_puzzle_level_for_initial_asset_check<'a>(
.or_else(|| levels.first())
}
pub(crate) async fn compile_puzzle_draft_with_initial_cover(
pub(crate) async fn generate_puzzle_initial_cover_from_compiled_session(
state: &PuzzleApiState,
request_context: &RequestContext,
session_id: String,
compiled_session: PuzzleAgentSessionRecord,
owner_user_id: String,
prompt_text: Option<&str>,
reference_image_src: Option<&str>,
image_model: Option<&str>,
now: i64,
) -> Result<PuzzleAgentSessionRecord, AppError> {
let compiled_session = state
.spacetime_client()
.compile_puzzle_agent_draft(session_id.clone(), owner_user_id.clone(), now)
.await
.map_err(map_puzzle_compile_error)?;
let draft = compiled_session.draft.clone().ok_or_else(|| {
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
"provider": PUZZLE_AGENT_API_BASE_PROVIDER,
@@ -1419,7 +1414,7 @@ pub(crate) async fn compile_puzzle_draft_with_initial_cover(
match state
.spacetime_client()
.select_puzzle_cover_image(PuzzleSelectCoverImageRecordInput {
session_id,
session_id: compiled_session.session_id.clone(),
owner_user_id,
level_id: Some(target_level.level_id),
candidate_id: selected_candidate_id,

View File

@@ -623,7 +623,7 @@ pub async fn execute_puzzle_agent_action(
session_id,
owner_user_id,
error_message,
failed_at_micros: now,
failed_at_micros: current_utc_micros(),
})
.await;
if let Err(error) = result {
@@ -668,27 +668,128 @@ pub async fn execute_puzzle_agent_action(
Err(response) => return Err(response),
};
let session = if ai_redraw {
execute_billable_asset_operation_with_cost(
state.root_state(),
&owner_user_id,
"puzzle_initial_image",
&billing_asset_id,
PUZZLE_IMAGE_GENERATION_POINTS_COST,
async {
compile_puzzle_draft_with_initial_cover(
&state,
&request_context,
if !try_register_puzzle_background_compile_task(&compile_session_id) {
tracing::info!(
provider = PUZZLE_AGENT_API_BASE_PROVIDER,
session_id = %compile_session_id,
owner_user_id = %owner_user_id,
"拼图首图后台生成任务已存在,本次 action 直接返回生成中会话"
);
state
.spacetime_client()
.get_puzzle_agent_session(
compile_session_id.clone(),
owner_user_id.clone(),
)
.await
.map(mark_puzzle_initial_generation_started_snapshot)
.map_err(map_puzzle_client_error)
} else {
let compiled_session = state
.spacetime_client()
.compile_puzzle_agent_draft(
compile_session_id.clone(),
owner_user_id.clone(),
prompt_text,
primary_reference_image_src,
payload.image_model.as_deref(),
now,
)
.await
},
)
.await
.map_err(map_puzzle_compile_error);
match compiled_session {
Ok(compiled_session) => {
let response_session =
mark_puzzle_initial_generation_started_snapshot(
compiled_session.clone(),
);
let background_state = state.clone();
let background_request_context = request_context.clone();
let background_session_id = compile_session_id.clone();
let background_owner_user_id = owner_user_id.clone();
let background_prompt_text = prompt_text.map(str::to_string);
let background_reference_image_src =
primary_reference_image_src.map(str::to_string);
let background_image_model = payload.image_model.clone();
let background_billing_asset_id =
format!("{background_session_id}:compile_puzzle_draft");
tokio::spawn(async move {
let operation_owner_user_id =
background_owner_user_id.clone();
let background_root_state =
background_state.root_state().clone();
let operation_state = background_state.clone();
let result = execute_billable_asset_operation_with_cost(
&background_root_state,
&background_owner_user_id,
"puzzle_initial_image",
&background_billing_asset_id,
PUZZLE_IMAGE_GENERATION_POINTS_COST,
async move {
generate_puzzle_initial_cover_from_compiled_session(
&operation_state,
&background_request_context,
compiled_session,
operation_owner_user_id,
background_prompt_text.as_deref(),
background_reference_image_src.as_deref(),
background_image_model.as_deref(),
current_utc_micros(),
)
.await
},
)
.await;
match result {
Ok(session) => {
tracing::info!(
provider = PUZZLE_AGENT_API_BASE_PROVIDER,
session_id = %session.session_id,
owner_user_id = %background_owner_user_id,
"拼图首图后台生成任务完成"
);
}
Err(error) => {
let error_message = error.body_text();
let failure_result = background_state
.spacetime_client()
.mark_puzzle_draft_generation_failed(
PuzzleDraftCompileFailureRecordInput {
session_id: background_session_id.clone(),
owner_user_id: background_owner_user_id
.clone(),
error_message: error_message.clone(),
failed_at_micros: current_utc_micros(),
},
)
.await;
if let Err(mark_error) = failure_result {
tracing::warn!(
provider = PUZZLE_AGENT_API_BASE_PROVIDER,
session_id = %background_session_id,
owner_user_id = %background_owner_user_id,
message = %mark_error,
"拼图首图后台生成失败态回写失败"
);
}
tracing::warn!(
provider = PUZZLE_AGENT_API_BASE_PROVIDER,
session_id = %background_session_id,
owner_user_id = %background_owner_user_id,
message = %error_message,
"拼图首图后台生成任务失败"
);
}
}
unregister_puzzle_background_compile_task(
&background_session_id,
);
});
Ok(response_session)
}
Err(error) => {
unregister_puzzle_background_compile_task(&compile_session_id);
Err(error)
}
}
}
} else {
compile_puzzle_draft_with_uploaded_cover(
&state,
@@ -716,7 +817,7 @@ pub async fn execute_puzzle_agent_action(
"compile_puzzle_draft",
"首关拼图草稿",
if ai_redraw {
"已编译首关草稿、并行生成首关画面和 UI 背景并写入正式草稿"
"已编译首关草稿,并启动首关画面和 UI 资产后台生成"
} else {
"已编译首关草稿,并直接应用上传图片、生成 UI 背景为第一关图片。"
},

View File

@@ -980,6 +980,41 @@ fn puzzle_work_summary_response_keeps_levels_for_shelf_cover() {
);
}
#[test]
fn puzzle_compile_started_snapshot_marks_primary_level_generating() {
let mut session = PuzzleAgentSessionRecord {
session_id: "puzzle-session-1".to_string(),
seed_text: "画面描述:一只猫在雨夜灯牌下回头。".to_string(),
current_turn: 1,
progress_percent: 88,
stage: "draft_ready".to_string(),
anchor_pack: test_puzzle_anchor_pack_record(),
draft: Some(test_puzzle_draft_record()),
messages: Vec::new(),
last_assistant_reply: None,
published_profile_id: None,
suggested_actions: Vec::new(),
result_preview: None,
updated_at: "2024-01-01T00:00:00Z".to_string(),
};
{
let draft = session.draft.as_mut().expect("draft");
draft.generation_status = "idle".to_string();
draft.levels[0].generation_status = "idle".to_string();
draft.levels[0].cover_image_src = None;
draft.levels[0].cover_asset_id = None;
}
let session = mark_puzzle_initial_generation_started_snapshot(session);
let draft = session.draft.expect("draft");
assert_eq!(session.stage, "image_refining");
assert_eq!(draft.generation_status, "generating");
assert_eq!(draft.levels[0].generation_status, "generating");
assert!(draft.cover_image_src.is_none());
assert!(draft.levels[0].cover_image_src.is_none());
}
#[test]
fn puzzle_ui_background_prompt_keeps_generated_slots_out_of_background() {
let prompt = build_puzzle_ui_background_request_prompt_for_test("雨夜猫街", "雨夜猫街主题背景");

File diff suppressed because it is too large Load Diff

View File

@@ -229,6 +229,33 @@ pub async fn list_wooden_fish_works(
))
}
pub async fn delete_wooden_fish_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 works = state
.spacetime_client()
.delete_wooden_fish_work(profile_id, authenticated.claims().user_id().to_string())
.await
.map_err(|error| {
wooden_fish_error_response(
&request_context,
WOODEN_FISH_CREATION_PROVIDER,
map_wooden_fish_client_error(error),
)
})?;
Ok(json_success_body(
Some(&request_context),
WoodenFishWorksResponse {
items: works.into_iter().map(|work| work.summary).collect(),
},
))
}
pub async fn get_wooden_fish_runtime_work(
State(state): State<AppState>,
Path(profile_id): Path<String>,
@@ -1364,6 +1391,7 @@ fn current_utc_micros() -> i64 {
#[cfg(test)]
mod tests {
use super::*;
use crate::AppConfig;
use base64::{Engine as _, engine::general_purpose::STANDARD as BASE64_STANDARD};
#[test]
@@ -1535,8 +1563,7 @@ mod tests {
#[tokio::test]
async fn wooden_fish_draft_uses_default_hit_sound_asset_and_ignores_prompt() {
let state = crate::state::AppState::new(crate::config::AppConfig::default())
.expect("state should build");
let state = AppState::new(AppConfig::default()).expect("state should build");
let payload = WoodenFishWorkspaceCreateRequest {
template_id: WOODEN_FISH_TEMPLATE_ID.to_string(),
work_title: "今日敲木鱼".to_string(),

View File

@@ -57,10 +57,16 @@ pub struct AuthUser {
pub display_name: String,
#[serde(default)]
pub avatar_url: Option<String>,
#[serde(default)]
pub phone_number: Option<String>,
pub phone_number_masked: Option<String>,
pub login_method: AuthLoginMethod,
pub binding_status: AuthBindingStatus,
pub wechat_bound: bool,
#[serde(default)]
pub wechat_display_name: Option<String>,
#[serde(default)]
pub wechat_account: Option<String>,
pub token_version: u64,
#[serde(default)]
pub created_at: String,

View File

@@ -97,6 +97,33 @@ struct StoredWechatIdentity {
session_key: Option<String>,
}
fn hydrate_private_auth_fields(
state: &InMemoryAuthStoreState,
stored_user: &StoredPasswordUser,
) -> StoredPasswordUser {
let mut hydrated = stored_user.clone();
if hydrated.user.phone_number.is_none() {
hydrated.user.phone_number = hydrated.phone_number.clone();
}
let hydrated_wechat_identity = state
.wechat_identity_by_provider_uid
.values()
.find(|identity| identity.user_id == hydrated.user.id);
if hydrated.user.wechat_display_name.is_none() {
hydrated.user.wechat_display_name = hydrated_wechat_identity
.and_then(|identity| identity.display_name.clone())
.or_else(|| {
(hydrated.user.login_method == AuthLoginMethod::Wechat)
.then(|| hydrated.user.display_name.clone())
});
}
if hydrated.user.wechat_account.is_none() {
hydrated.user.wechat_account =
hydrated_wechat_identity.map(|identity| identity.provider_uid.clone());
}
hydrated
}
#[derive(Clone, Debug)]
pub struct PasswordEntryService {
store: InMemoryAuthStore,
@@ -1024,6 +1051,36 @@ impl InMemoryAuthStore {
.map_err(RefreshSessionError::Store)
}
fn resolve_phone_user_locked(
state: &mut InMemoryAuthStoreState,
phone_number: &str,
) -> Option<StoredPasswordUser> {
if let Some(user_id) = state.phone_to_user_id.get(phone_number).cloned() {
if let Some(stored_user) = state
.users_by_username
.values()
.find(|stored_user| stored_user.user.id == user_id)
.cloned()
{
return Some(stored_user);
}
state.phone_to_user_id.remove(phone_number);
}
let Some(stored_user) = state
.users_by_username
.values()
.find(|stored_user| stored_user.phone_number.as_deref() == Some(phone_number))
.cloned()
else {
return None;
};
state
.phone_to_user_id
.insert(phone_number.to_string(), stored_user.user.id.clone());
Some(stored_user)
}
fn find_by_user_id(
&self,
user_id: &str,
@@ -1037,7 +1094,7 @@ impl InMemoryAuthStore {
.users_by_username
.values()
.find(|stored_user| stored_user.user.id == user_id)
.cloned())
.map(|stored_user| hydrate_private_auth_fields(&state, stored_user)))
}
fn ensure_orphan_work_owner_user(
@@ -1077,10 +1134,13 @@ impl InMemoryAuthStore {
username: username.clone(),
display_name,
avatar_url: None,
phone_number: None,
phone_number_masked: None,
login_method: AuthLoginMethod::Password,
binding_status: AuthBindingStatus::Active,
wechat_bound: false,
wechat_display_name: None,
wechat_account: None,
token_version: 1,
created_at,
};
@@ -1111,43 +1171,31 @@ impl InMemoryAuthStore {
.users_by_username
.values()
.find(|stored_user| stored_user.user.public_user_code == public_user_code)
.cloned())
.map(|stored_user| hydrate_private_auth_fields(&state, stored_user)))
}
fn find_by_phone_number(
&self,
phone_number: &str,
) -> Result<Option<StoredPasswordUser>, PhoneAuthError> {
let state = self
let mut state = self
.inner
.lock()
.map_err(|_| PhoneAuthError::Store("用户仓储锁已中毒".to_string()))?;
let Some(user_id) = state.phone_to_user_id.get(phone_number) else {
return Ok(None);
};
Ok(state
.users_by_username
.values()
.find(|stored_user| stored_user.user.id == *user_id)
.cloned())
Ok(Self::resolve_phone_user_locked(&mut state, phone_number)
.map(|stored_user| hydrate_private_auth_fields(&state, &stored_user)))
}
fn find_by_phone_number_for_password(
&self,
phone_number: &str,
) -> Result<Option<StoredPasswordUser>, PasswordEntryError> {
let state = self
let mut state = self
.inner
.lock()
.map_err(|_| PasswordEntryError::Store("用户仓储锁已中毒".to_string()))?;
let Some(user_id) = state.phone_to_user_id.get(phone_number) else {
return Ok(None);
};
Ok(state
.users_by_username
.values()
.find(|stored_user| stored_user.user.id == *user_id)
.cloned())
Ok(Self::resolve_phone_user_locked(&mut state, phone_number)
.map(|stored_user| hydrate_private_auth_fields(&state, &stored_user)))
}
fn update_user_profile(
@@ -1190,17 +1238,10 @@ impl InMemoryAuthStore {
.inner
.lock()
.map_err(|_| PhoneAuthError::Store("用户仓储锁已中毒".to_string()))?;
if let Some(existing_user_id) = state.phone_to_user_id.get(&phone_number.e164).cloned() {
let existing_user_exists = state
.users_by_username
.values()
.any(|stored_user| stored_user.user.id == existing_user_id);
if existing_user_exists {
return Err(PhoneAuthError::Store(
"手机号已存在,无法重复创建账号".to_string(),
));
}
state.phone_to_user_id.remove(&phone_number.e164);
if Self::resolve_phone_user_locked(&mut state, &phone_number.e164).is_some() {
return Err(PhoneAuthError::Store(
"手机号已存在,无法重复创建账号".to_string(),
));
}
let created_at = format_rfc3339(OffsetDateTime::now_utc()).map_err(|message| {
@@ -1217,10 +1258,13 @@ impl InMemoryAuthStore {
username: username.clone(),
display_name,
avatar_url: None,
phone_number: Some(phone_number.e164.clone()),
phone_number_masked: Some(phone_number.masked_national_number.clone()),
login_method: AuthLoginMethod::Phone,
binding_status: AuthBindingStatus::Active,
wechat_bound: false,
wechat_display_name: None,
wechat_account: None,
token_version: 1,
created_at,
};
@@ -1251,15 +1295,8 @@ impl InMemoryAuthStore {
.inner
.lock()
.map_err(|_| PasswordEntryError::Store("用户仓储锁已中毒".to_string()))?;
if let Some(existing_user_id) = state.phone_to_user_id.get(&phone_number.e164).cloned() {
let existing_user_exists = state
.users_by_username
.values()
.any(|stored_user| stored_user.user.id == existing_user_id);
if existing_user_exists {
return Err(PasswordEntryError::InvalidCredentials);
}
state.phone_to_user_id.remove(&phone_number.e164);
if Self::resolve_phone_user_locked(&mut state, &phone_number.e164).is_some() {
return Err(PasswordEntryError::InvalidCredentials);
}
let created_at = format_rfc3339(OffsetDateTime::now_utc()).map_err(|message| {
@@ -1276,10 +1313,13 @@ impl InMemoryAuthStore {
username: username.clone(),
display_name,
avatar_url: None,
phone_number: Some(phone_number.e164.clone()),
phone_number_masked: Some(phone_number.masked_national_number.clone()),
login_method: AuthLoginMethod::Password,
binding_status: AuthBindingStatus::Active,
wechat_bound: false,
wechat_display_name: None,
wechat_account: None,
token_version: 1,
created_at,
};
@@ -1325,17 +1365,23 @@ impl InMemoryAuthStore {
.filter(|value| !value.is_empty())
.unwrap_or("微信旅人")
.to_string();
let wechat_display_name = normalize_optional_string(profile.display_name.clone())
.or_else(|| Some(display_name.clone()));
let username = build_wechat_username(&display_name, &profile.provider_uid);
let provider_uid = normalize_required_string(&profile.provider_uid).unwrap_or_default();
let user = AuthUser {
id: user_id.clone(),
public_user_code,
username: username.clone(),
display_name,
avatar_url: avatar_url.clone(),
phone_number: None,
phone_number_masked: None,
login_method: AuthLoginMethod::Wechat,
binding_status: AuthBindingStatus::PendingBindPhone,
wechat_bound: true,
wechat_display_name,
wechat_account: Some(provider_uid.clone()),
token_version: 1,
created_at,
};
@@ -1350,7 +1396,7 @@ impl InMemoryAuthStore {
);
let identity = StoredWechatIdentity {
user_id: user_id.clone(),
provider_uid: normalize_required_string(&profile.provider_uid).unwrap_or_default(),
provider_uid,
provider_union_id: normalize_optional_string(profile.provider_union_id),
display_name: normalize_optional_string(profile.display_name),
avatar_url,
@@ -1388,7 +1434,7 @@ impl InMemoryAuthStore {
.values()
.find(|stored_user| stored_user.user.id == *user_id)
{
return Ok(Some(stored.user.clone()));
return Ok(Some(hydrate_private_auth_fields(&state, stored).user));
}
let Some(identity) = state
@@ -1401,7 +1447,7 @@ impl InMemoryAuthStore {
.users_by_username
.values()
.find(|stored_user| stored_user.user.id == identity.user_id)
.map(|stored| stored.user.clone()))
.map(|stored| hydrate_private_auth_fields(&state, stored).user))
}
fn get_wechat_identity_by_user_id(
@@ -1490,6 +1536,10 @@ impl InMemoryAuthStore {
{
stored_user.user.display_name = display_name.to_string();
}
stored_user.user.wechat_account = Some(next_provider_uid.clone());
if let Some(display_name) = next_display_name.clone() {
stored_user.user.wechat_display_name = Some(display_name);
}
stored_user.user.clone()
};
self.persist_wechat_state(&state)?;
@@ -1714,7 +1764,9 @@ impl InMemoryAuthStore {
.lock()
.map_err(|_| PhoneAuthError::Store("用户仓储锁已中毒".to_string()))?;
let existing_phone_user_id = state.phone_to_user_id.get(&phone_number.e164).cloned();
let existing_phone_user_id =
Self::resolve_phone_user_locked(&mut state, &phone_number.e164)
.map(|stored_user| stored_user.user.id);
if let Some(target_user_id) = existing_phone_user_id
&& target_user_id != pending_user_id
{
@@ -1724,6 +1776,8 @@ impl InMemoryAuthStore {
.find(|identity| identity.user_id == pending_user_id)
.cloned()
.ok_or(PhoneAuthError::UserStateMismatch)?;
let pending_wechat_account = pending_wechat_identity.provider_uid.clone();
let pending_wechat_display_name = pending_wechat_identity.display_name.clone();
let pending_username = state
.users_by_username
@@ -1752,6 +1806,11 @@ impl InMemoryAuthStore {
.find(|stored| stored.user.id == target_user_id)
.ok_or(PhoneAuthError::UserNotFound)?;
target_user.user.wechat_bound = true;
target_user.user.wechat_account = Some(pending_wechat_account);
target_user.user.wechat_display_name = pending_wechat_display_name;
if target_user.user.phone_number.is_none() {
target_user.user.phone_number = target_user.phone_number.clone();
}
let next_user = target_user.user.clone();
self.persist_phone_state(&state)?;
@@ -1761,15 +1820,32 @@ impl InMemoryAuthStore {
state
.phone_to_user_id
.insert(phone_number.e164.clone(), pending_user_id.to_string());
let bound_wechat_account = state
.wechat_identity_by_provider_uid
.values()
.find(|identity| identity.user_id == pending_user_id)
.map(|identity| identity.provider_uid.clone());
let bound_wechat_display_name = state
.wechat_identity_by_provider_uid
.values()
.find(|identity| identity.user_id == pending_user_id)
.and_then(|identity| identity.display_name.clone());
let stored_user = state
.users_by_username
.values_mut()
.find(|stored| stored.user.id == pending_user_id)
.ok_or(PhoneAuthError::UserNotFound)?;
stored_user.user.phone_number = Some(phone_number.e164.clone());
stored_user.user.phone_number_masked = Some(phone_number.masked_national_number.clone());
stored_user.user.binding_status = AuthBindingStatus::Active;
stored_user.user.wechat_bound = true;
if stored_user.user.wechat_account.is_none() {
stored_user.user.wechat_account = bound_wechat_account;
}
if stored_user.user.wechat_display_name.is_none() {
stored_user.user.wechat_display_name = bound_wechat_display_name;
}
stored_user.phone_number = Some(phone_number.e164);
let next_user = stored_user.user.clone();
self.persist_phone_state(&state)?;
@@ -2100,10 +2176,8 @@ impl InMemoryAuthStore {
.inner
.lock()
.map_err(|_| PhoneAuthError::Store("用户仓储锁已中毒".to_string()))?;
let user_id = state
.phone_to_user_id
.get(phone_number)
.cloned()
let user_id = Self::resolve_phone_user_locked(&mut state, phone_number)
.map(|stored_user| stored_user.user.id)
.ok_or(PhoneAuthError::UserNotFound)?;
for stored_user in state.users_by_username.values_mut() {
@@ -2624,6 +2698,90 @@ mod tests {
assert_eq!(error, PhoneAuthError::UserNotFound);
}
#[tokio::test]
async fn dev_password_registration_ignores_orphan_phone_index() {
let snapshot = PersistentAuthStoreSnapshot {
next_user_id: 7,
users_by_username: HashMap::new(),
phone_to_user_id: HashMap::from([(
"+8613800138004".to_string(),
"user_deleted".to_string(),
)]),
sessions_by_id: HashMap::new(),
session_id_by_refresh_token_hash: HashMap::new(),
wechat_identity_by_provider_uid: HashMap::new(),
user_id_by_provider_union_id: HashMap::new(),
};
let snapshot_json =
serde_json::to_string(&snapshot).expect("snapshot json should serialize");
let service = build_password_service(
InMemoryAuthStore::from_snapshot_json(&snapshot_json).expect("snapshot should restore"),
);
let created = service
.execute_with_dev_registration(PasswordEntryInput {
phone_number: "13800138004".to_string(),
password: "secret123".to_string(),
})
.await
.expect("orphan phone index should not block dev registration");
assert!(created.created);
assert_eq!(
created.user.phone_number_masked.as_deref(),
Some("138****8004")
);
}
#[tokio::test]
async fn phone_login_ignores_orphan_phone_index_after_code_verification() {
let snapshot = PersistentAuthStoreSnapshot {
next_user_id: 8,
users_by_username: HashMap::new(),
phone_to_user_id: HashMap::from([(
"+8613800138005".to_string(),
"user_deleted".to_string(),
)]),
sessions_by_id: HashMap::new(),
session_id_by_refresh_token_hash: HashMap::new(),
wechat_identity_by_provider_uid: HashMap::new(),
user_id_by_provider_union_id: HashMap::new(),
};
let snapshot_json =
serde_json::to_string(&snapshot).expect("snapshot json should serialize");
let phone_service = build_phone_service(
InMemoryAuthStore::from_snapshot_json(&snapshot_json).expect("snapshot should restore"),
);
let now = OffsetDateTime::now_utc();
phone_service
.send_code(
SendPhoneCodeInput {
phone_number: "13800138005".to_string(),
scene: PhoneAuthScene::Login,
},
now,
)
.await
.expect("phone code should send");
let created = phone_service
.login(
PhoneLoginInput {
phone_number: "13800138005".to_string(),
verify_code: "123456".to_string(),
},
now + Duration::seconds(1),
)
.await
.expect("orphan phone index should not turn login into duplicate create");
assert!(created.created);
assert_eq!(
created.user.phone_number_masked.as_deref(),
Some("138****8005")
);
}
#[tokio::test]
async fn snapshot_json_restores_user_and_refresh_session_after_roundtrip() {
let store = InMemoryAuthStore::default();
@@ -3326,6 +3484,10 @@ mod tests {
AuthBindingStatus::PendingBindPhone
);
assert_eq!(first_wechat.user.username, "微信旅人甲_wx-openid-first");
assert_eq!(
first_wechat.user.wechat_display_name.as_deref(),
Some("微信旅人甲")
);
assert!(first_wechat.user.id.starts_with("user_"));
assert!(!first_wechat.user.id.ends_with("00000001"));
@@ -3347,6 +3509,10 @@ mod tests {
assert_ne!(second_wechat.user.id, phone_user.id);
assert_eq!(second_wechat.user.login_method, AuthLoginMethod::Wechat);
assert_eq!(second_wechat.user.username, first_wechat.user.username);
assert_eq!(
second_wechat.user.wechat_display_name.as_deref(),
Some("微信旅人乙")
);
}
#[tokio::test]
@@ -3396,6 +3562,10 @@ mod tests {
wechat_user.binding_status,
AuthBindingStatus::PendingBindPhone
);
assert_eq!(
wechat_user.wechat_display_name.as_deref(),
Some("待绑定微信用户")
);
assert_ne!(wechat_user.id, phone_user.id);
phone_service
@@ -3423,6 +3593,10 @@ mod tests {
assert_eq!(merged.user.id, phone_user.id);
assert_eq!(merged.user.binding_status, AuthBindingStatus::Active);
assert!(merged.user.wechat_bound);
assert_eq!(
merged.user.wechat_display_name.as_deref(),
Some("待绑定微信用户")
);
let reused_wechat_user = wechat_service
.resolve_login(ResolveWechatLoginInput {
@@ -3440,5 +3614,9 @@ mod tests {
assert!(!reused_wechat_user.created);
assert_eq!(reused_wechat_user.user.id, phone_user.id);
assert!(reused_wechat_user.user.wechat_bound);
assert_eq!(
reused_wechat_user.user.wechat_display_name.as_deref(),
Some("已归并微信用户")
);
}
}

View File

@@ -0,0 +1,14 @@
[package]
name = "module-puzzle-clear"
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 }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
use shared_kernel::normalize_required_string;
use crate::{PuzzleClearOrientation, PuzzleClearShapeKind};
pub fn parse_puzzle_clear_shape_kind(value: &str) -> PuzzleClearShapeKind {
match value.trim().to_ascii_lowercase().as_str() {
"1x3" | "one-by-three" => PuzzleClearShapeKind::OneByThree,
"2x2" | "two-by-two" => PuzzleClearShapeKind::TwoByTwo,
"2x3" | "two-by-three" => PuzzleClearShapeKind::TwoByThree,
_ => PuzzleClearShapeKind::OneByTwo,
}
}
pub fn parse_puzzle_clear_orientation(value: &str) -> PuzzleClearOrientation {
match value.trim().to_ascii_lowercase().as_str() {
"vertical" | "纵向" => PuzzleClearOrientation::Vertical,
_ => PuzzleClearOrientation::Horizontal,
}
}
pub fn normalize_puzzle_clear_seed(seed: &str, fallback: &str) -> String {
normalize_required_string(seed)
.or_else(|| normalize_required_string(fallback))
.unwrap_or_else(|| "puzzle-clear".to_string())
}

View File

@@ -0,0 +1,191 @@
use serde::{Deserialize, Serialize};
#[cfg(feature = "spacetime-types")]
use spacetimedb::SpacetimeType;
pub const PUZZLE_CLEAR_PLAY_ID: &str = "puzzle-clear";
pub const PUZZLE_CLEAR_PUBLIC_WORK_CODE_PREFIX: &str = "PC-";
pub const PUZZLE_CLEAR_SESSION_ID_PREFIX: &str = "puzzle-clear-session-";
pub const PUZZLE_CLEAR_PROFILE_ID_PREFIX: &str = "puzzle-clear-profile-";
pub const PUZZLE_CLEAR_WORK_ID_PREFIX: &str = "puzzle-clear-work-";
pub const PUZZLE_CLEAR_RUN_ID_PREFIX: &str = "puzzle-clear-run-";
pub const PUZZLE_CLEAR_LEVEL_DURATION_SECONDS: u32 = 600;
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum PuzzleClearShapeKind {
OneByTwo,
OneByThree,
TwoByTwo,
TwoByThree,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum PuzzleClearOrientation {
Horizontal,
Vertical,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum PuzzleClearRunStatus {
Playing,
LevelFailed,
LevelCleared,
Finished,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearLevelConfig {
pub level_index: u32,
pub board_size: u32,
pub target_clears: u32,
pub duration_seconds: u32,
pub unlocked_shapes: Vec<PuzzleClearShapeKind>,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearShapeQuota {
pub shape: PuzzleClearShapeKind,
pub count: u32,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearPatternGroup {
pub group_id: String,
pub shape: PuzzleClearShapeKind,
pub width: u32,
pub height: u32,
pub atlas_x: u32,
pub atlas_y: u32,
pub atlas_width: u32,
pub atlas_height: u32,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearCard {
pub card_id: String,
pub group_id: String,
pub shape: PuzzleClearShapeKind,
pub orientation: PuzzleClearOrientation,
pub part_x: u32,
pub part_y: u32,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub source_atlas_cell: String,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearCell {
pub row: u32,
pub col: u32,
pub card: Option<PuzzleClearCard>,
pub locked_group_id: Option<String>,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearBoard {
pub rows: u32,
pub cols: u32,
pub cells: Vec<PuzzleClearCell>,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearDeck {
pub ready_columns: Vec<Vec<PuzzleClearCard>>,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearMove {
pub from_row: u32,
pub from_col: u32,
pub to_row: u32,
pub to_col: u32,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearElimination {
pub group_id: String,
pub positions: Vec<(u32, u32)>,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PuzzleClearRunSnapshot {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub status: PuzzleClearRunStatus,
pub level_index: u32,
pub clears_done: u32,
pub board: PuzzleClearBoard,
pub deck: PuzzleClearDeck,
pub started_at_ms: u64,
pub level_started_at_ms: u64,
pub finished_at_ms: Option<u64>,
}
impl PuzzleClearShapeKind {
pub fn as_str(self) -> &'static str {
match self {
Self::OneByTwo => "1x2",
Self::OneByThree => "1x3",
Self::TwoByTwo => "2x2",
Self::TwoByThree => "2x3",
}
}
pub fn base_dimensions(self) -> (u32, u32) {
match self {
Self::OneByTwo => (2, 1),
Self::OneByThree => (3, 1),
Self::TwoByTwo => (2, 2),
Self::TwoByThree => (3, 2),
}
}
pub fn dimensions(self, orientation: PuzzleClearOrientation) -> (u32, u32) {
let (width, height) = self.base_dimensions();
if matches!(orientation, PuzzleClearOrientation::Vertical)
&& matches!(
self,
PuzzleClearShapeKind::OneByTwo
| PuzzleClearShapeKind::OneByThree
| PuzzleClearShapeKind::TwoByThree
)
{
(height, width)
} else {
(width, height)
}
}
}
impl PuzzleClearOrientation {
pub fn as_str(self) -> &'static str {
match self {
Self::Horizontal => "horizontal",
Self::Vertical => "vertical",
}
}
}
impl PuzzleClearRunStatus {
pub fn as_str(self) -> &'static str {
match self {
Self::Playing => "playing",
Self::LevelFailed => "level_failed",
Self::LevelCleared => "level_cleared",
Self::Finished => "finished",
}
}
}

View File

@@ -0,0 +1,37 @@
use std::fmt;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum PuzzleClearError {
MissingRunId,
MissingOwnerUserId,
MissingProfileId,
InvalidLevel,
InvalidBoard,
InvalidPosition,
EmptyDeck,
NoPlayableMove,
RunNotPlaying,
LevelExpired,
MissingCard,
}
impl fmt::Display for PuzzleClearError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let message = match self {
Self::MissingRunId => "puzzle-clear run_id 不能为空",
Self::MissingOwnerUserId => "puzzle-clear owner_user_id 不能为空",
Self::MissingProfileId => "puzzle-clear profile_id 不能为空",
Self::InvalidLevel => "puzzle-clear 关卡配置无效",
Self::InvalidBoard => "puzzle-clear 棋盘状态无效",
Self::InvalidPosition => "puzzle-clear 坐标无效",
Self::EmptyDeck => "puzzle-clear 发牌池为空",
Self::NoPlayableMove => "puzzle-clear 棋盘没有可解拼接",
Self::RunNotPlaying => "puzzle-clear 当前 run 不在 playing 状态",
Self::LevelExpired => "puzzle-clear 当前关卡已经超时",
Self::MissingCard => "puzzle-clear 目标格子没有卡牌",
};
f.write_str(message)
}
}
impl std::error::Error for PuzzleClearError {}

View File

@@ -0,0 +1,31 @@
//! 拼消消领域事件。
//!
//! 事件只表达已经发生的领域事实,持久化、统计投影和前端通知由
//! SpacetimeDB adapter 与 BFF 编排层决定。
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum PuzzleClearDomainEvent {
DraftCompiled {
profile_id: String,
owner_user_id: String,
occurred_at_micros: i64,
},
WorkPublished {
profile_id: String,
owner_user_id: String,
occurred_at_micros: i64,
},
LevelCleared {
run_id: String,
owner_user_id: String,
level_index: u32,
clears_done: u32,
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

@@ -80,7 +80,7 @@ pub fn default_creation_entry_event_banner_snapshots() -> Vec<CreationEntryEvent
ends_at_text: String::new(),
render_mode: "html".to_string(),
html_code: Some(
r#"<section style="box-sizing:border-box;width:100%;min-height:180px;padding:28px 30px;border-radius:24px;background:#fff7ed;color:#6f2f21;font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;"><h1 style="margin:0 0 10px;font-size:28px;">创作公告</h1><p style="margin:0;font-size:16px;line-height:1.7;">这里可以在后台替换成你的公告 HTML。</p></section>"#
r#"<section style="box-sizing:border-box;width:100%;min-height:180px;padding:28px 30px;border-radius:24px;background:linear-gradient(90deg,rgba(255,247,237,0.96) 0%,rgba(255,247,237,0.82) 48%,rgba(255,247,237,0.18) 100%),url('/creation-type-references/puzzle.webp') center/cover no-repeat;color:#6f2f21;font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;"><h1 style="margin:0 0 10px;font-size:28px;">创作公告</h1><p style="margin:0;font-size:16px;line-height:1.7;">这里可以在后台替换成你的公告 HTML。</p></section>"#
.to_string(),
),
}]
@@ -233,11 +233,16 @@ pub fn resolve_creation_entry_event_banner_responses(
event_banners_json: Option<&str>,
fallback_banner: &CreationEntryEventBannerSnapshot,
) -> Vec<CreationEntryEventBannerResponse> {
event_banners_json
let banners = event_banners_json
.and_then(|raw| decode_creation_entry_event_banner_snapshots(raw).ok())
.filter(|banners| !banners.is_empty())
.unwrap_or_else(|| vec![fallback_banner.clone()])
.into_iter()
.unwrap_or_else(default_creation_entry_event_banner_snapshots);
if banners.is_empty() {
vec![fallback_banner.clone()]
} else {
banners
}
.into_iter()
.map(build_creation_entry_event_banner_response)
.collect()
}
@@ -410,6 +415,20 @@ pub fn default_creation_entry_type_snapshots(
20,
updated_at_micros,
),
build_default_creation_entry_type_snapshot(
"puzzle-clear",
"拼消消",
"拼接消除玩法",
"可创建",
"/creation-type-references/puzzle.webp",
true,
true,
46,
"recommended",
"热门推荐",
20,
updated_at_micros,
),
build_default_creation_entry_type_snapshot(
"wooden-fish",
"敲木鱼",

View File

@@ -57,7 +57,7 @@ pub const DEFAULT_CREATION_ENTRY_CATEGORY_LABEL: &str = "热门推荐";
pub const DEFAULT_CREATION_ENTRY_EVENT_TITLE: &str = "主题创作赛";
pub const DEFAULT_CREATION_ENTRY_EVENT_DESCRIPTION: &str = "用温暖的色彩,捏出秋天的故事。";
pub const DEFAULT_CREATION_ENTRY_EVENT_COVER_IMAGE_SRC: &str =
"/branding/taonier-logo-spiral-reference-concepts/taonier-spiral-bouncy-clay.png";
"/creation-type-references/puzzle.webp";
pub const DEFAULT_CREATION_ENTRY_EVENT_PRIZE_POOL_MUD_POINTS: u64 = 58_000;
pub const DEFAULT_CREATION_ENTRY_EVENT_STARTS_AT_TEXT: &str = "2024.10.20 10:00";
pub const DEFAULT_CREATION_ENTRY_EVENT_ENDS_AT_TEXT: &str = "2024.11.20 23:59";

View File

@@ -319,6 +319,35 @@ mod tests {
assert_eq!(banners, default_creation_entry_event_banner_snapshots());
}
#[test]
fn creation_entry_event_banners_none_returns_default_announcements() {
let legacy_banner = CreationEntryEventBannerSnapshot {
title: "旧结构化横幅".to_string(),
description: "旧库单条字段".to_string(),
cover_image_src:
"/branding/taonier-logo-spiral-reference-concepts/taonier-spiral-bouncy-clay.png"
.to_string(),
prize_pool_mud_points: 58_000,
starts_at_text: "2024.10.20 10:00".to_string(),
ends_at_text: "2024.11.20 23:59".to_string(),
render_mode: "structured".to_string(),
html_code: None,
};
let banners = resolve_creation_entry_event_banner_responses(None, &legacy_banner);
assert_eq!(banners.len(), 1);
assert_eq!(banners[0].render_mode, "html");
assert_eq!(banners[0].title, "创作公告");
assert!(banners[0].html_code.as_deref().unwrap_or("").contains("创作公告"));
assert!(banners[0]
.html_code
.as_deref()
.unwrap_or("")
.contains("/creation-type-references/puzzle.webp"));
assert_ne!(banners[0].cover_image_src, legacy_banner.cover_image_src);
}
#[test]
fn creation_entry_event_banners_json_accepts_announcement_html_code() {
let normalized = normalize_creation_entry_event_banners_json(
@@ -417,6 +446,22 @@ mod tests {
assert_eq!(wooden_fish.image_src, "/wooden-fish/default-hit-object.png");
}
#[test]
fn default_creation_entry_types_include_puzzle_clear() {
let configs = default_creation_entry_type_snapshots(1);
let puzzle_clear = configs
.iter()
.find(|item| item.id == "puzzle-clear")
.expect("puzzle-clear creation entry should be seeded");
assert_eq!(puzzle_clear.title, "拼消消");
assert!(puzzle_clear.visible);
assert!(puzzle_clear.open);
assert_eq!(puzzle_clear.badge, "可创建");
assert_eq!(puzzle_clear.sort_order, 46);
assert_eq!(puzzle_clear.category_id, "recommended");
}
#[test]
fn default_creation_entry_types_include_jump_hop_theme_only_entry() {
let configs = default_creation_entry_type_snapshots(1);

View File

@@ -22,7 +22,7 @@ const OSS_V4_SERVICE: &str = "oss";
const OSS_UNSIGNED_PAYLOAD: &str = "UNSIGNED-PAYLOAD";
const OSS_PROVIDER: &str = "aliyun-oss";
pub const LEGACY_PUBLIC_PREFIXES: [&str; 13] = [
pub const LEGACY_PUBLIC_PREFIXES: [&str; 14] = [
"generated-character-drafts",
"generated-characters",
"generated-animations",
@@ -31,6 +31,7 @@ pub const LEGACY_PUBLIC_PREFIXES: [&str; 13] = [
"generated-wooden-fish-assets",
"generated-match3d-assets",
"generated-puzzle-assets",
"generated-puzzle-clear-assets",
"generated-jump-hop-assets",
"generated-custom-world-scenes",
"generated-custom-world-covers",
@@ -55,6 +56,7 @@ pub enum LegacyAssetPrefix {
WoodenFishAssets,
Match3DAssets,
PuzzleAssets,
PuzzleClearAssets,
JumpHopAssets,
CustomWorldScenes,
CustomWorldCovers,
@@ -245,6 +247,7 @@ impl LegacyAssetPrefix {
"generated-wooden-fish-assets" => Some(Self::WoodenFishAssets),
"generated-match3d-assets" => Some(Self::Match3DAssets),
"generated-puzzle-assets" => Some(Self::PuzzleAssets),
"generated-puzzle-clear-assets" => Some(Self::PuzzleClearAssets),
"generated-jump-hop-assets" => Some(Self::JumpHopAssets),
"generated-custom-world-scenes" => Some(Self::CustomWorldScenes),
"generated-custom-world-covers" => Some(Self::CustomWorldCovers),
@@ -264,6 +267,7 @@ impl LegacyAssetPrefix {
Self::WoodenFishAssets => "generated-wooden-fish-assets",
Self::Match3DAssets => "generated-match3d-assets",
Self::PuzzleAssets => "generated-puzzle-assets",
Self::PuzzleClearAssets => "generated-puzzle-clear-assets",
Self::JumpHopAssets => "generated-jump-hop-assets",
Self::CustomWorldScenes => "generated-custom-world-scenes",
Self::CustomWorldCovers => "generated-custom-world-covers",

View File

@@ -19,10 +19,13 @@ pub struct AuthUserPayload {
pub public_user_code: String,
pub display_name: String,
pub avatar_url: Option<String>,
pub phone_number: Option<String>,
pub phone_number_masked: Option<String>,
pub login_method: String,
pub binding_status: String,
pub wechat_bound: bool,
pub wechat_display_name: Option<String>,
pub wechat_account: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]

View File

@@ -19,6 +19,7 @@ pub mod match3d_runtime;
pub mod match3d_works;
pub mod public_work;
pub mod puzzle_agent;
pub mod puzzle_clear;
pub mod puzzle_creative_template;
pub mod puzzle_gallery;
pub mod puzzle_runtime;

View File

@@ -0,0 +1,313 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PuzzleClearGenerationStatus {
Draft,
Generating,
Ready,
Failed,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum PuzzleClearActionType {
CompileDraft,
RegenerateAtlas,
UpdateWorkMeta,
UpdateBoardBackground,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PuzzleClearRunStatus {
Playing,
LevelFailed,
LevelCleared,
Finished,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearImageAsset {
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, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearPatternGroup {
pub group_id: String,
pub shape: String,
pub width: u32,
pub height: u32,
pub atlas_x: u32,
pub atlas_y: u32,
pub atlas_width: u32,
pub atlas_height: u32,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearCardAsset {
pub card_id: String,
pub group_id: String,
pub shape: String,
pub orientation: String,
pub part_x: u32,
pub part_y: u32,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub source_atlas_cell: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearWorkspaceCreateRequest {
pub template_id: String,
pub work_title: String,
pub work_description: String,
pub theme_prompt: String,
#[serde(default)]
pub board_background_prompt: String,
pub generate_board_background: bool,
pub board_background_asset: Option<PuzzleClearImageAsset>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearActionRequest {
pub action_type: PuzzleClearActionType,
pub profile_id: Option<String>,
pub work_title: Option<String>,
pub work_description: Option<String>,
pub theme_prompt: Option<String>,
#[serde(default)]
pub board_background_prompt: Option<String>,
pub generate_board_background: Option<bool>,
pub board_background_asset: Option<PuzzleClearImageAsset>,
pub atlas_asset: Option<PuzzleClearImageAsset>,
pub pattern_groups: Option<Vec<PuzzleClearPatternGroup>>,
pub card_assets: Option<Vec<PuzzleClearCardAsset>>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearDraftResponse {
pub template_id: String,
pub template_name: String,
pub profile_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_prompt: String,
#[serde(default)]
pub board_background_prompt: String,
pub generate_board_background: bool,
pub board_background_asset: Option<PuzzleClearImageAsset>,
pub card_back_image_src: Option<String>,
pub atlas_asset: Option<PuzzleClearImageAsset>,
pub pattern_groups: Vec<PuzzleClearPatternGroup>,
pub card_assets: Vec<PuzzleClearCardAsset>,
pub generation_status: PuzzleClearGenerationStatus,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearSessionSnapshotResponse {
pub session_id: String,
pub owner_user_id: String,
pub status: PuzzleClearGenerationStatus,
pub draft: Option<PuzzleClearDraftResponse>,
pub created_at: String,
pub updated_at: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearSessionResponse {
pub session: PuzzleClearSessionSnapshotResponse,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearActionResponse {
pub action_type: PuzzleClearActionType,
pub session: PuzzleClearSessionSnapshotResponse,
pub work: Option<PuzzleClearWorkProfileResponse>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearWorkSummaryResponse {
pub runtime_kind: String,
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub source_session_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_prompt: String,
pub cover_image_src: Option<String>,
pub publication_status: String,
pub play_count: u32,
pub updated_at: String,
pub published_at: Option<String>,
pub publish_ready: bool,
pub generation_status: PuzzleClearGenerationStatus,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearWorkProfileResponse {
pub summary: PuzzleClearWorkSummaryResponse,
pub draft: PuzzleClearDraftResponse,
pub board_background_asset: Option<PuzzleClearImageAsset>,
pub atlas_asset: PuzzleClearImageAsset,
pub pattern_groups: Vec<PuzzleClearPatternGroup>,
pub card_assets: Vec<PuzzleClearCardAsset>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearWorksResponse {
pub items: Vec<PuzzleClearWorkSummaryResponse>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearWorkDetailResponse {
pub item: PuzzleClearWorkProfileResponse,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearWorkMutationResponse {
pub item: PuzzleClearWorkProfileResponse,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearBoardCell {
pub row: u32,
pub col: u32,
pub card: Option<PuzzleClearCardAsset>,
pub locked_group_id: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearBoardSnapshot {
pub rows: u32,
pub cols: u32,
pub cells: Vec<PuzzleClearBoardCell>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearRuntimeSnapshotResponse {
pub run_id: String,
pub profile_id: String,
pub owner_user_id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub runtime_mode: Option<String>,
pub status: PuzzleClearRunStatus,
pub level_index: u32,
pub clears_done: u32,
pub target_clears: u32,
pub level_duration_seconds: u32,
pub level_started_at_ms: u64,
pub board: PuzzleClearBoardSnapshot,
pub ready_columns: Vec<Vec<PuzzleClearCardAsset>>,
pub started_at_ms: u64,
pub finished_at_ms: Option<u64>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearRunResponse {
pub run: PuzzleClearRuntimeSnapshotResponse,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearStartRunRequest {
pub profile_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearSwapRequest {
pub from_row: u32,
pub from_col: u32,
pub to_row: u32,
pub to_col: u32,
pub client_action_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearRetryLevelRequest {
pub client_action_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearNextLevelRequest {
pub client_action_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PuzzleClearTimeUpRequest {
pub client_action_id: String,
}
#[cfg(test)]
mod tests {
use super::*;
use serde_json::json;
#[test]
fn workspace_create_request_uses_camel_case() {
let payload = PuzzleClearWorkspaceCreateRequest {
template_id: "puzzle-clear".to_string(),
work_title: "花园拼消消".to_string(),
work_description: "轻松消除".to_string(),
theme_prompt: "春日花园".to_string(),
board_background_prompt: "樱花庭院".to_string(),
generate_board_background: true,
board_background_asset: None,
};
let value = serde_json::to_value(payload).expect("request should serialize");
assert_eq!(value["templateId"], json!("puzzle-clear"));
assert_eq!(value["themePrompt"], json!("春日花园"));
assert_eq!(value["boardBackgroundPrompt"], json!("樱花庭院"));
assert_eq!(value["generateBoardBackground"], json!(true));
}
#[test]
fn runtime_swap_request_uses_camel_case() {
let payload = PuzzleClearSwapRequest {
from_row: 1,
from_col: 2,
to_row: 1,
to_col: 3,
client_action_id: "swap-1".to_string(),
};
let value = serde_json::to_value(payload).expect("request should serialize");
assert_eq!(value["fromRow"], json!(1));
assert_eq!(value["toCol"], json!(3));
assert_eq!(value["clientActionId"], json!("swap-1"));
}
}

View File

@@ -16,6 +16,7 @@ module-wooden-fish = { workspace = true }
module-match3d = { workspace = true }
module-npc = { workspace = true }
module-puzzle = { workspace = true }
module-puzzle-clear = { workspace = true }
module-runtime = { workspace = true }
module-runtime-story = { workspace = true }
module-runtime-item = { workspace = true }

View File

@@ -3,6 +3,7 @@ use std::collections::HashMap;
pub type BarkBattleDraftCreateRecordInput = BarkBattleDraftCreateInput;
pub type BarkBattleDraftConfigUpsertRecordInput = BarkBattleDraftConfigUpsertInput;
pub type BarkBattleWorkDeleteRecordInput = BarkBattleWorkDeleteInput;
pub type BarkBattleWorkPublishRecordInput = BarkBattleWorkPublishInput;
pub type BarkBattleRunStartRecordInput = BarkBattleRunStartInput;
pub type BarkBattleRunFinishRecordInput = BarkBattleRunFinishInput;
@@ -88,6 +89,34 @@ impl SpacetimeClient {
.await
}
pub async fn delete_bark_battle_work(
&self,
input: BarkBattleWorkDeleteRecordInput,
) -> Result<Vec<serde_json::Value>, SpacetimeClientError> {
let owner_user_id = input.owner_user_id.clone();
self.call_after_connect("delete_bark_battle_work", move |connection, sender| {
connection
.procedures()
.delete_bark_battle_work_then(input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(|result| {
if result.ok {
Ok(())
} else {
Err(SpacetimeClientError::procedure_failed(
result.error_message,
))
}
});
send_once(&sender, mapped);
});
})
.await?;
self.list_bark_battle_works(owner_user_id).await
}
pub async fn get_bark_battle_runtime_config(
&self,
work_id: String,

View File

@@ -222,6 +222,30 @@ impl SpacetimeClient {
.await
}
pub async fn delete_jump_hop_work(
&self,
profile_id: String,
owner_user_id: String,
) -> Result<Vec<JumpHopWorkProfileResponse>, SpacetimeClientError> {
let procedure_input = JumpHopWorkDeleteInput {
profile_id,
owner_user_id,
};
self.call_after_connect("delete_jump_hop_work", move |connection, sender| {
connection.procedures().delete_jump_hop_work_then(
procedure_input,
move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_jump_hop_works_procedure_result);
send_once(&sender, mapped);
},
);
})
.await
}
pub async fn get_jump_hop_runtime_work(
&self,
profile_id: String,

View File

@@ -52,16 +52,24 @@ pub use mapper::{
PuzzleAgentMessageSubmitRecordInput, PuzzleAgentSessionCreateRecordInput,
PuzzleAgentSessionRecord, PuzzleAgentSuggestedActionRecord, PuzzleAnchorItemRecord,
PuzzleAnchorPackRecord, PuzzleAudioAssetRecord, PuzzleBoardRecord, PuzzleCellPositionRecord,
PuzzleCreatorIntentRecord, PuzzleDraftCompileFailureRecordInput, PuzzleDraftLevelRecord,
PuzzleFormDraftRecord, PuzzleFormDraftSaveRecordInput, PuzzleGalleryCardRecord,
PuzzleGeneratedImageCandidateRecord, PuzzleGeneratedImagesSaveRecordInput,
PuzzleLeaderboardEntryRecord, PuzzleLeaderboardSubmitRecordInput, PuzzleMergedGroupRecord,
PuzzlePieceStateRecord, PuzzlePublishRecordInput, PuzzleRecommendedNextWorkRecord,
PuzzleResultDraftRecord, PuzzleResultPreviewBlockerRecord, PuzzleResultPreviewFindingRecord,
PuzzleResultPreviewRecord, PuzzleRunDragRecordInput, PuzzleRunNextLevelRecordInput,
PuzzleRunPauseRecordInput, PuzzleRunPropRecordInput, PuzzleRunRecord,
PuzzleRunStartRecordInput, PuzzleRunSwapRecordInput, PuzzleRuntimeLevelRecord,
PuzzleSelectCoverImageRecordInput, PuzzleUiBackgroundSaveRecordInput,
PuzzleClearActionRequest, PuzzleClearActionResponse, PuzzleClearActionType,
PuzzleClearBoardCell, PuzzleClearBoardSnapshot, PuzzleClearCardAsset, PuzzleClearDraftResponse,
PuzzleClearGenerationStatus, PuzzleClearImageAsset, PuzzleClearNextLevelRequest,
PuzzleClearPatternGroup, PuzzleClearRetryLevelRequest, PuzzleClearRunResponse,
PuzzleClearRunStatus, PuzzleClearRuntimeSnapshotResponse, PuzzleClearSessionResponse,
PuzzleClearSessionSnapshotResponse, PuzzleClearStartRunRequest, PuzzleClearSwapRequest,
PuzzleClearTimeUpRequest, PuzzleClearWorkDetailResponse, PuzzleClearWorkMutationResponse,
PuzzleClearWorkProfileResponse, PuzzleClearWorkSummaryResponse, PuzzleClearWorksResponse,
PuzzleClearWorkspaceCreateRequest, PuzzleCreatorIntentRecord,
PuzzleDraftCompileFailureRecordInput, PuzzleDraftLevelRecord, PuzzleFormDraftRecord,
PuzzleFormDraftSaveRecordInput, PuzzleGalleryCardRecord, PuzzleGeneratedImageCandidateRecord,
PuzzleGeneratedImagesSaveRecordInput, PuzzleLeaderboardEntryRecord,
PuzzleLeaderboardSubmitRecordInput, PuzzleMergedGroupRecord, PuzzlePieceStateRecord,
PuzzlePublishRecordInput, PuzzleRecommendedNextWorkRecord, PuzzleResultDraftRecord,
PuzzleResultPreviewBlockerRecord, PuzzleResultPreviewFindingRecord, PuzzleResultPreviewRecord,
PuzzleRunDragRecordInput, PuzzleRunNextLevelRecordInput, PuzzleRunPauseRecordInput,
PuzzleRunPropRecordInput, PuzzleRunRecord, PuzzleRunStartRecordInput, PuzzleRunSwapRecordInput,
PuzzleRuntimeLevelRecord, PuzzleSelectCoverImageRecordInput, PuzzleUiBackgroundSaveRecordInput,
PuzzleWorkLikeReportRecordInput, PuzzleWorkPointIncentiveClaimRecordInput,
PuzzleWorkProfileRecord, PuzzleWorkRemixRecordInput, PuzzleWorkUpsertRecordInput,
ResolveCombatActionRecord, ResolveNpcBattleInteractionInput,
@@ -98,7 +106,7 @@ pub mod bark_battle;
pub use bark_battle::{
BarkBattleDraftConfigUpsertRecordInput, BarkBattleDraftCreateRecordInput,
BarkBattleRunFinishRecordInput, BarkBattleRunStartRecordInput,
BarkBattleWorkPublishRecordInput,
BarkBattleWorkDeleteRecordInput, BarkBattleWorkPublishRecordInput,
};
pub mod big_fish;
pub mod combat;
@@ -109,6 +117,7 @@ pub mod match3d;
pub mod npc;
pub mod public_work;
pub mod puzzle;
pub mod puzzle_clear;
pub mod runtime;
pub mod square_hole;
pub mod story;
@@ -575,6 +584,7 @@ impl SpacetimeClient {
"SELECT * FROM public_work_detail_entry",
"SELECT * FROM bark_battle_gallery_view",
"SELECT * FROM puzzle_gallery_card_view",
"SELECT * FROM puzzle_clear_gallery_card_view",
"SELECT * FROM jump_hop_gallery_card_view",
"SELECT * FROM wooden_fish_gallery_card_view",
"SELECT * FROM custom_world_gallery_entry",
@@ -591,6 +601,7 @@ impl SpacetimeClient {
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-clear'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'jump-hop'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'wooden-fish'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'custom-world'",

View File

@@ -14,6 +14,7 @@ mod match3d;
mod npc;
mod public_work;
mod puzzle;
mod puzzle_clear;
mod runtime;
mod runtime_profile;
mod square_hole;
@@ -114,6 +115,17 @@ pub use self::puzzle::{
PuzzleWorkLikeReportRecordInput, PuzzleWorkPointIncentiveClaimRecordInput,
PuzzleWorkProfileRecord, PuzzleWorkRemixRecordInput, PuzzleWorkUpsertRecordInput,
};
pub use self::puzzle_clear::{
PuzzleClearActionRequest, PuzzleClearActionResponse, PuzzleClearActionType,
PuzzleClearBoardCell, PuzzleClearBoardSnapshot, PuzzleClearCardAsset, PuzzleClearDraftResponse,
PuzzleClearGenerationStatus, PuzzleClearImageAsset, PuzzleClearNextLevelRequest,
PuzzleClearPatternGroup, PuzzleClearRetryLevelRequest, PuzzleClearRunResponse,
PuzzleClearRunStatus, PuzzleClearRuntimeSnapshotResponse, PuzzleClearSessionResponse,
PuzzleClearSessionSnapshotResponse, PuzzleClearStartRunRequest, PuzzleClearSwapRequest,
PuzzleClearTimeUpRequest, PuzzleClearWorkDetailResponse, PuzzleClearWorkMutationResponse,
PuzzleClearWorkProfileResponse, PuzzleClearWorkSummaryResponse, PuzzleClearWorksResponse,
PuzzleClearWorkspaceCreateRequest,
};
pub use self::runtime::{
AdminWorkVisibilityRecord, BigFishGameDraftRecord, BigFishRuntimeEntityRecord,
BigFishRuntimeParamsRecord, BigFishRuntimeRunRecord, CreationEntryConfigRecord,
@@ -192,6 +204,11 @@ pub(crate) use self::puzzle::{
map_puzzle_works_procedure_result, map_runtime_profile_wallet_ledger_source_type_back,
parse_puzzle_agent_stage_record,
};
pub(crate) use self::puzzle_clear::{
map_puzzle_clear_agent_session_procedure_result, map_puzzle_clear_gallery_card_view_row,
map_puzzle_clear_run_procedure_result, map_puzzle_clear_work_procedure_result,
map_puzzle_clear_works_procedure_result,
};
pub(crate) use self::runtime::{
build_admin_work_visibility_list_input, build_admin_work_visibility_update_input,
build_creation_entry_config_record_from_rows, map_admin_work_visibility_list_procedure_result,

View File

@@ -0,0 +1,289 @@
use super::*;
pub use shared_contracts::puzzle_clear::{
PuzzleClearActionRequest, PuzzleClearActionResponse, PuzzleClearActionType,
PuzzleClearBoardCell, PuzzleClearBoardSnapshot, PuzzleClearCardAsset, PuzzleClearDraftResponse,
PuzzleClearGenerationStatus, PuzzleClearImageAsset, PuzzleClearNextLevelRequest,
PuzzleClearPatternGroup, PuzzleClearRetryLevelRequest, PuzzleClearRunResponse,
PuzzleClearRunStatus, PuzzleClearRuntimeSnapshotResponse, PuzzleClearSessionResponse,
PuzzleClearSessionSnapshotResponse, PuzzleClearStartRunRequest, PuzzleClearSwapRequest,
PuzzleClearTimeUpRequest, PuzzleClearWorkDetailResponse, PuzzleClearWorkMutationResponse,
PuzzleClearWorkProfileResponse, PuzzleClearWorkSummaryResponse, PuzzleClearWorksResponse,
PuzzleClearWorkspaceCreateRequest,
};
pub(crate) fn map_puzzle_clear_agent_session_procedure_result(
result: PuzzleClearAgentSessionProcedureResult,
) -> Result<PuzzleClearSessionSnapshotResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let session = result
.session
.ok_or_else(|| SpacetimeClientError::missing_snapshot("puzzle clear agent session 快照"))?;
Ok(map_puzzle_clear_session_snapshot(session))
}
pub(crate) fn map_puzzle_clear_work_procedure_result(
result: PuzzleClearWorkProcedureResult,
) -> Result<PuzzleClearWorkProfileResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let work = result
.work
.ok_or_else(|| SpacetimeClientError::missing_snapshot("puzzle clear work 快照"))?;
Ok(map_puzzle_clear_work_snapshot(work))
}
pub(crate) fn map_puzzle_clear_works_procedure_result(
result: PuzzleClearWorksProcedureResult,
) -> Result<Vec<PuzzleClearWorkProfileResponse>, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
Ok(result
.items
.into_iter()
.map(map_puzzle_clear_work_snapshot)
.collect())
}
pub(crate) fn map_puzzle_clear_run_procedure_result(
result: PuzzleClearRunProcedureResult,
) -> Result<PuzzleClearRuntimeSnapshotResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let run = result
.run
.ok_or_else(|| SpacetimeClientError::missing_snapshot("puzzle clear run 快照"))?;
Ok(map_puzzle_clear_run_snapshot(run))
}
pub(crate) fn map_puzzle_clear_gallery_card_view_row(
row: PuzzleClearGalleryCardViewRow,
) -> PuzzleClearWorkSummaryResponse {
PuzzleClearWorkSummaryResponse {
runtime_kind: "puzzle-clear".to_string(),
work_id: row.work_id,
profile_id: row.profile_id,
owner_user_id: row.owner_user_id,
source_session_id: None,
work_title: row.work_title,
work_description: row.work_description,
theme_prompt: row.theme_prompt,
cover_image_src: row.cover_image_src,
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),
publish_ready: true,
generation_status: parse_generation_status(&row.generation_status),
}
}
fn map_puzzle_clear_session_snapshot(
snapshot: PuzzleClearAgentSessionSnapshot,
) -> PuzzleClearSessionSnapshotResponse {
PuzzleClearSessionSnapshotResponse {
session_id: snapshot.session_id,
owner_user_id: snapshot.owner_user_id,
status: parse_generation_status(&snapshot.status),
draft: snapshot.draft.map(map_puzzle_clear_draft_snapshot),
created_at: format_timestamp_micros(snapshot.created_at_micros),
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
}
}
fn map_puzzle_clear_work_snapshot(
snapshot: PuzzleClearWorkSnapshot,
) -> PuzzleClearWorkProfileResponse {
let atlas_asset = map_image_asset(snapshot.atlas_asset.clone());
let pattern_groups = snapshot
.pattern_groups
.clone()
.into_iter()
.map(map_pattern_group)
.collect::<Vec<_>>();
let card_assets = snapshot
.card_assets
.clone()
.into_iter()
.map(map_card_asset)
.collect::<Vec<_>>();
let board_background_asset = snapshot.board_background_asset.clone().map(map_image_asset);
let draft = PuzzleClearDraftResponse {
template_id: "puzzle-clear".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_prompt: snapshot.theme_prompt.clone(),
board_background_prompt: snapshot.board_background_prompt.clone(),
generate_board_background: snapshot.generate_board_background,
board_background_asset: board_background_asset.clone(),
card_back_image_src: snapshot.card_back_image_src.clone(),
atlas_asset: Some(atlas_asset.clone()),
pattern_groups: pattern_groups.clone(),
card_assets: card_assets.clone(),
generation_status: parse_generation_status(&snapshot.generation_status),
};
PuzzleClearWorkProfileResponse {
summary: PuzzleClearWorkSummaryResponse {
runtime_kind: "puzzle-clear".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_prompt: snapshot.theme_prompt,
cover_image_src: 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,
board_background_asset,
atlas_asset,
pattern_groups,
card_assets,
}
}
fn map_puzzle_clear_draft_snapshot(snapshot: PuzzleClearDraftSnapshot) -> PuzzleClearDraftResponse {
PuzzleClearDraftResponse {
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_prompt: snapshot.theme_prompt,
board_background_prompt: snapshot.board_background_prompt,
generate_board_background: snapshot.generate_board_background,
board_background_asset: snapshot.board_background_asset.map(map_image_asset),
card_back_image_src: snapshot.card_back_image_src,
atlas_asset: snapshot.atlas_asset.map(map_image_asset),
pattern_groups: snapshot
.pattern_groups
.into_iter()
.map(map_pattern_group)
.collect(),
card_assets: snapshot
.card_assets
.into_iter()
.map(map_card_asset)
.collect(),
generation_status: parse_generation_status(&snapshot.generation_status),
}
}
fn map_image_asset(snapshot: PuzzleClearImageAssetSnapshot) -> PuzzleClearImageAsset {
PuzzleClearImageAsset {
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_pattern_group(snapshot: PuzzleClearPatternGroupSnapshot) -> PuzzleClearPatternGroup {
PuzzleClearPatternGroup {
group_id: snapshot.group_id,
shape: snapshot.shape,
width: snapshot.width,
height: snapshot.height,
atlas_x: snapshot.atlas_x,
atlas_y: snapshot.atlas_y,
atlas_width: snapshot.atlas_width,
atlas_height: snapshot.atlas_height,
}
}
fn map_card_asset(snapshot: PuzzleClearCardAssetSnapshot) -> PuzzleClearCardAsset {
PuzzleClearCardAsset {
card_id: snapshot.card_id,
group_id: snapshot.group_id,
shape: snapshot.shape,
orientation: snapshot.orientation,
part_x: snapshot.part_x,
part_y: snapshot.part_y,
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,
}
}
fn map_puzzle_clear_run_snapshot(
snapshot: PuzzleClearRuntimeSnapshot,
) -> PuzzleClearRuntimeSnapshotResponse {
PuzzleClearRuntimeSnapshotResponse {
run_id: snapshot.run_id,
profile_id: snapshot.profile_id,
owner_user_id: snapshot.owner_user_id,
runtime_mode: None,
status: parse_run_status(&snapshot.status),
level_index: snapshot.level_index,
clears_done: snapshot.clears_done,
target_clears: snapshot.target_clears,
level_duration_seconds: snapshot.level_duration_seconds,
level_started_at_ms: snapshot.level_started_at_ms,
board: PuzzleClearBoardSnapshot {
rows: snapshot.board.rows,
cols: snapshot.board.cols,
cells: snapshot
.board
.cells
.into_iter()
.map(|cell| PuzzleClearBoardCell {
row: cell.row,
col: cell.col,
card: cell.card.map(map_card_asset),
locked_group_id: cell.locked_group_id,
})
.collect(),
},
ready_columns: snapshot
.ready_columns
.into_iter()
.map(|column| column.into_iter().map(map_card_asset).collect())
.collect(),
started_at_ms: snapshot.started_at_ms,
finished_at_ms: snapshot.finished_at_ms,
}
}
fn parse_generation_status(value: &str) -> PuzzleClearGenerationStatus {
match value {
"generating" => PuzzleClearGenerationStatus::Generating,
"ready" => PuzzleClearGenerationStatus::Ready,
"failed" => PuzzleClearGenerationStatus::Failed,
_ => PuzzleClearGenerationStatus::Draft,
}
}
fn parse_run_status(value: &str) -> PuzzleClearRunStatus {
match value {
"level_failed" => PuzzleClearRunStatus::LevelFailed,
"level_cleared" => PuzzleClearRunStatus::LevelCleared,
"finished" => PuzzleClearRunStatus::Finished,
_ => PuzzleClearRunStatus::Playing,
}
}
fn normalize_publication_status(value: &str) -> &str {
match value {
"Published" | "published" => "published",
_ => "draft",
}
}

View File

@@ -25,6 +25,7 @@ pub mod admin_work_visibility_list_procedure_result_type;
pub mod admin_work_visibility_procedure_result_type;
pub mod admin_work_visibility_snapshot_type;
pub mod admin_work_visibility_update_input_type;
pub mod advance_puzzle_clear_next_level_procedure;
pub mod advance_puzzle_next_level_procedure;
pub mod ai_result_reference_input_type;
pub mod ai_result_reference_kind_type;
@@ -125,6 +126,7 @@ pub mod bark_battle_runtime_run_row_type;
pub mod bark_battle_runtime_run_table;
pub mod bark_battle_score_record_row_type;
pub mod bark_battle_score_record_table;
pub mod bark_battle_work_delete_input_type;
pub mod bark_battle_work_publish_input_type;
pub mod bark_battle_work_stats_projection_row_type;
pub mod bark_battle_work_stats_projection_table;
@@ -212,6 +214,7 @@ 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_puzzle_agent_draft_procedure;
pub mod compile_puzzle_clear_draft_procedure;
pub mod compile_square_hole_draft_procedure;
pub mod compile_visual_novel_work_profile_procedure;
pub mod compile_wooden_fish_draft_procedure;
@@ -234,6 +237,7 @@ pub mod create_jump_hop_agent_session_procedure;
pub mod create_match_3_d_agent_session_procedure;
pub mod create_profile_recharge_order_and_return_procedure;
pub mod create_puzzle_agent_session_procedure;
pub mod create_puzzle_clear_agent_session_procedure;
pub mod create_square_hole_agent_session_procedure;
pub mod create_visual_novel_agent_session_procedure;
pub mod create_wooden_fish_agent_session_procedure;
@@ -325,14 +329,17 @@ pub mod database_migration_procedure_result_type;
pub mod database_migration_revoke_operator_input_type;
pub mod database_migration_table_stat_type;
pub mod database_migration_warning_type;
pub mod delete_bark_battle_work_procedure;
pub mod delete_big_fish_work_procedure;
pub mod delete_custom_world_agent_session_procedure;
pub mod delete_custom_world_profile_and_return_procedure;
pub mod delete_jump_hop_work_procedure;
pub mod delete_match_3_d_work_procedure;
pub mod delete_puzzle_work_procedure;
pub mod delete_runtime_snapshot_and_return_procedure;
pub mod delete_square_hole_work_procedure;
pub mod delete_visual_novel_work_procedure;
pub mod delete_wooden_fish_work_procedure;
pub mod drag_puzzle_piece_or_group_procedure;
pub mod drop_square_hole_shape_procedure;
pub mod ensure_analytics_date_dimension_for_date_reducer;
@@ -380,6 +387,9 @@ pub mod get_profile_recharge_order_and_return_procedure;
pub mod get_profile_referral_invite_center_procedure;
pub mod get_profile_task_center_procedure;
pub mod get_puzzle_agent_session_procedure;
pub mod get_puzzle_clear_agent_session_procedure;
pub mod get_puzzle_clear_runtime_run_procedure;
pub mod get_puzzle_clear_work_profile_procedure;
pub mod get_puzzle_gallery_detail_procedure;
pub mod get_puzzle_run_procedure;
pub mod get_puzzle_work_detail_procedure;
@@ -454,6 +464,7 @@ 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_delete_input_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;
@@ -473,6 +484,7 @@ pub mod list_match_3_d_works_procedure;
pub mod list_platform_browse_history_procedure;
pub mod list_profile_save_archives_procedure;
pub mod list_profile_wallet_ledger_procedure;
pub mod list_puzzle_clear_works_procedure;
pub mod list_puzzle_gallery_procedure;
pub mod list_puzzle_works_procedure;
pub mod list_square_hole_works_procedure;
@@ -480,6 +492,7 @@ pub mod list_visual_novel_runtime_history_procedure;
pub mod list_visual_novel_works_procedure;
pub mod list_wooden_fish_works_procedure;
pub mod mark_profile_recharge_order_paid_and_return_procedure;
pub mod mark_puzzle_clear_level_time_up_procedure;
pub mod mark_puzzle_draft_generation_failed_procedure;
pub mod match_3_d_agent_message_finalize_input_type;
pub mod match_3_d_agent_message_row_type;
@@ -587,6 +600,7 @@ pub mod publish_custom_world_profile_reducer;
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_puzzle_clear_work_procedure;
pub mod publish_puzzle_work_procedure;
pub mod publish_square_hole_work_procedure;
pub mod publish_visual_novel_work_procedure;
@@ -613,6 +627,44 @@ pub mod puzzle_anchor_status_type;
pub mod puzzle_audio_asset_type;
pub mod puzzle_board_snapshot_type;
pub mod puzzle_cell_position_type;
pub mod puzzle_clear_agent_session_create_input_type;
pub mod puzzle_clear_agent_session_get_input_type;
pub mod puzzle_clear_agent_session_procedure_result_type;
pub mod puzzle_clear_agent_session_row_type;
pub mod puzzle_clear_agent_session_snapshot_type;
pub mod puzzle_clear_agent_session_table;
pub mod puzzle_clear_board_cell_snapshot_type;
pub mod puzzle_clear_board_snapshot_type;
pub mod puzzle_clear_card_asset_snapshot_type;
pub mod puzzle_clear_draft_compile_input_type;
pub mod puzzle_clear_draft_snapshot_type;
pub mod puzzle_clear_event_row_type;
pub mod puzzle_clear_event_table;
pub mod puzzle_clear_gallery_card_view_row_type;
pub mod puzzle_clear_gallery_card_view_table;
pub mod puzzle_clear_gallery_view_row_type;
pub mod puzzle_clear_gallery_view_table;
pub mod puzzle_clear_image_asset_snapshot_type;
pub mod puzzle_clear_pattern_group_snapshot_type;
pub mod puzzle_clear_run_get_input_type;
pub mod puzzle_clear_run_next_level_input_type;
pub mod puzzle_clear_run_procedure_result_type;
pub mod puzzle_clear_run_retry_level_input_type;
pub mod puzzle_clear_run_start_input_type;
pub mod puzzle_clear_run_swap_input_type;
pub mod puzzle_clear_run_time_up_input_type;
pub mod puzzle_clear_runtime_run_row_type;
pub mod puzzle_clear_runtime_run_table;
pub mod puzzle_clear_runtime_snapshot_type;
pub mod puzzle_clear_work_get_input_type;
pub mod puzzle_clear_work_procedure_result_type;
pub mod puzzle_clear_work_profile_row_type;
pub mod puzzle_clear_work_profile_table;
pub mod puzzle_clear_work_publish_input_type;
pub mod puzzle_clear_work_snapshot_type;
pub mod puzzle_clear_work_update_input_type;
pub mod puzzle_clear_works_list_input_type;
pub mod puzzle_clear_works_procedure_result_type;
pub mod puzzle_creator_intent_type;
pub mod puzzle_draft_compile_failure_input_type;
pub mod puzzle_draft_compile_input_type;
@@ -733,6 +785,7 @@ pub mod restart_jump_hop_run_procedure;
pub mod restart_match_3_d_run_procedure;
pub mod restart_square_hole_run_procedure;
pub mod resume_profile_save_archive_and_return_procedure;
pub mod retry_puzzle_clear_level_run_procedure;
pub mod revoke_database_migration_operator_procedure;
pub mod rpg_agent_draft_card_kind_type;
pub mod rpg_agent_draft_card_status_type;
@@ -903,6 +956,7 @@ pub mod start_bark_battle_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_puzzle_clear_runtime_run_procedure;
pub mod start_puzzle_run_procedure;
pub mod start_square_hole_run_procedure;
pub mod start_visual_novel_run_procedure;
@@ -931,6 +985,7 @@ pub mod submit_puzzle_agent_message_procedure;
pub mod submit_puzzle_leaderboard_entry_procedure;
pub mod submit_square_hole_agent_message_procedure;
pub mod submit_visual_novel_agent_message_procedure;
pub mod swap_puzzle_clear_cards_procedure;
pub mod swap_puzzle_pieces_procedure;
pub mod tracking_daily_stat_table;
pub mod tracking_daily_stat_type;
@@ -949,6 +1004,7 @@ pub mod unpublish_custom_world_profile_reducer;
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_puzzle_clear_work_procedure;
pub mod update_puzzle_run_pause_procedure;
pub mod update_puzzle_work_procedure;
pub mod update_square_hole_work_procedure;
@@ -1043,6 +1099,7 @@ pub mod wooden_fish_run_status_type;
pub mod wooden_fish_runtime_run_row_type;
pub mod wooden_fish_runtime_run_table;
pub mod wooden_fish_word_counter_type;
pub mod wooden_fish_work_delete_input_type;
pub mod wooden_fish_work_get_input_type;
pub mod wooden_fish_work_procedure_result_type;
pub mod wooden_fish_work_profile_row_type;
@@ -1072,6 +1129,7 @@ pub use admin_work_visibility_list_procedure_result_type::AdminWorkVisibilityLis
pub use admin_work_visibility_procedure_result_type::AdminWorkVisibilityProcedureResult;
pub use admin_work_visibility_snapshot_type::AdminWorkVisibilitySnapshot;
pub use admin_work_visibility_update_input_type::AdminWorkVisibilityUpdateInput;
pub use advance_puzzle_clear_next_level_procedure::advance_puzzle_clear_next_level;
pub use advance_puzzle_next_level_procedure::advance_puzzle_next_level;
pub use ai_result_reference_input_type::AiResultReferenceInput;
pub use ai_result_reference_kind_type::AiResultReferenceKind;
@@ -1172,6 +1230,7 @@ pub use bark_battle_runtime_run_row_type::BarkBattleRuntimeRunRow;
pub use bark_battle_runtime_run_table::*;
pub use bark_battle_score_record_row_type::BarkBattleScoreRecordRow;
pub use bark_battle_score_record_table::*;
pub use bark_battle_work_delete_input_type::BarkBattleWorkDeleteInput;
pub use bark_battle_work_publish_input_type::BarkBattleWorkPublishInput;
pub use bark_battle_work_stats_projection_row_type::BarkBattleWorkStatsProjectionRow;
pub use bark_battle_work_stats_projection_table::*;
@@ -1259,6 +1318,7 @@ pub use compile_custom_world_published_profile_procedure::compile_custom_world_p
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_puzzle_agent_draft_procedure::compile_puzzle_agent_draft;
pub use compile_puzzle_clear_draft_procedure::compile_puzzle_clear_draft;
pub use compile_square_hole_draft_procedure::compile_square_hole_draft;
pub use compile_visual_novel_work_profile_procedure::compile_visual_novel_work_profile;
pub use compile_wooden_fish_draft_procedure::compile_wooden_fish_draft;
@@ -1281,6 +1341,7 @@ 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_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_clear_agent_session_procedure::create_puzzle_clear_agent_session;
pub use create_square_hole_agent_session_procedure::create_square_hole_agent_session;
pub use create_visual_novel_agent_session_procedure::create_visual_novel_agent_session;
pub use create_wooden_fish_agent_session_procedure::create_wooden_fish_agent_session;
@@ -1372,14 +1433,17 @@ pub use database_migration_procedure_result_type::DatabaseMigrationProcedureResu
pub use database_migration_revoke_operator_input_type::DatabaseMigrationRevokeOperatorInput;
pub use database_migration_table_stat_type::DatabaseMigrationTableStat;
pub use database_migration_warning_type::DatabaseMigrationWarning;
pub use delete_bark_battle_work_procedure::delete_bark_battle_work;
pub use delete_big_fish_work_procedure::delete_big_fish_work;
pub use delete_custom_world_agent_session_procedure::delete_custom_world_agent_session;
pub use delete_custom_world_profile_and_return_procedure::delete_custom_world_profile_and_return;
pub use delete_jump_hop_work_procedure::delete_jump_hop_work;
pub use delete_match_3_d_work_procedure::delete_match_3_d_work;
pub use delete_puzzle_work_procedure::delete_puzzle_work;
pub use delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return;
pub use delete_square_hole_work_procedure::delete_square_hole_work;
pub use delete_visual_novel_work_procedure::delete_visual_novel_work;
pub use delete_wooden_fish_work_procedure::delete_wooden_fish_work;
pub use drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group;
pub use drop_square_hole_shape_procedure::drop_square_hole_shape;
pub use ensure_analytics_date_dimension_for_date_reducer::ensure_analytics_date_dimension_for_date;
@@ -1427,6 +1491,9 @@ pub use get_profile_recharge_order_and_return_procedure::get_profile_recharge_or
pub use get_profile_referral_invite_center_procedure::get_profile_referral_invite_center;
pub use get_profile_task_center_procedure::get_profile_task_center;
pub use get_puzzle_agent_session_procedure::get_puzzle_agent_session;
pub use get_puzzle_clear_agent_session_procedure::get_puzzle_clear_agent_session;
pub use get_puzzle_clear_runtime_run_procedure::get_puzzle_clear_runtime_run;
pub use get_puzzle_clear_work_profile_procedure::get_puzzle_clear_work_profile;
pub use get_puzzle_gallery_detail_procedure::get_puzzle_gallery_detail;
pub use get_puzzle_run_procedure::get_puzzle_run;
pub use get_puzzle_work_detail_procedure::get_puzzle_work_detail;
@@ -1501,6 +1568,7 @@ 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_delete_input_type::JumpHopWorkDeleteInput;
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;
@@ -1520,6 +1588,7 @@ 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_profile_save_archives_procedure::list_profile_save_archives;
pub use list_profile_wallet_ledger_procedure::list_profile_wallet_ledger;
pub use list_puzzle_clear_works_procedure::list_puzzle_clear_works;
pub use list_puzzle_gallery_procedure::list_puzzle_gallery;
pub use list_puzzle_works_procedure::list_puzzle_works;
pub use list_square_hole_works_procedure::list_square_hole_works;
@@ -1527,6 +1596,7 @@ pub use list_visual_novel_runtime_history_procedure::list_visual_novel_runtime_h
pub use list_visual_novel_works_procedure::list_visual_novel_works;
pub use list_wooden_fish_works_procedure::list_wooden_fish_works;
pub use mark_profile_recharge_order_paid_and_return_procedure::mark_profile_recharge_order_paid_and_return;
pub use mark_puzzle_clear_level_time_up_procedure::mark_puzzle_clear_level_time_up;
pub use mark_puzzle_draft_generation_failed_procedure::mark_puzzle_draft_generation_failed;
pub use match_3_d_agent_message_finalize_input_type::Match3DAgentMessageFinalizeInput;
pub use match_3_d_agent_message_row_type::Match3DAgentMessageRow;
@@ -1634,6 +1704,7 @@ 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_jump_hop_work_procedure::publish_jump_hop_work;
pub use publish_match_3_d_work_procedure::publish_match_3_d_work;
pub use publish_puzzle_clear_work_procedure::publish_puzzle_clear_work;
pub use publish_puzzle_work_procedure::publish_puzzle_work;
pub use publish_square_hole_work_procedure::publish_square_hole_work;
pub use publish_visual_novel_work_procedure::publish_visual_novel_work;
@@ -1660,6 +1731,44 @@ pub use puzzle_anchor_status_type::PuzzleAnchorStatus;
pub use puzzle_audio_asset_type::PuzzleAudioAsset;
pub use puzzle_board_snapshot_type::PuzzleBoardSnapshot;
pub use puzzle_cell_position_type::PuzzleCellPosition;
pub use puzzle_clear_agent_session_create_input_type::PuzzleClearAgentSessionCreateInput;
pub use puzzle_clear_agent_session_get_input_type::PuzzleClearAgentSessionGetInput;
pub use puzzle_clear_agent_session_procedure_result_type::PuzzleClearAgentSessionProcedureResult;
pub use puzzle_clear_agent_session_row_type::PuzzleClearAgentSessionRow;
pub use puzzle_clear_agent_session_snapshot_type::PuzzleClearAgentSessionSnapshot;
pub use puzzle_clear_agent_session_table::*;
pub use puzzle_clear_board_cell_snapshot_type::PuzzleClearBoardCellSnapshot;
pub use puzzle_clear_board_snapshot_type::PuzzleClearBoardSnapshot;
pub use puzzle_clear_card_asset_snapshot_type::PuzzleClearCardAssetSnapshot;
pub use puzzle_clear_draft_compile_input_type::PuzzleClearDraftCompileInput;
pub use puzzle_clear_draft_snapshot_type::PuzzleClearDraftSnapshot;
pub use puzzle_clear_event_row_type::PuzzleClearEventRow;
pub use puzzle_clear_event_table::*;
pub use puzzle_clear_gallery_card_view_row_type::PuzzleClearGalleryCardViewRow;
pub use puzzle_clear_gallery_card_view_table::*;
pub use puzzle_clear_gallery_view_row_type::PuzzleClearGalleryViewRow;
pub use puzzle_clear_gallery_view_table::*;
pub use puzzle_clear_image_asset_snapshot_type::PuzzleClearImageAssetSnapshot;
pub use puzzle_clear_pattern_group_snapshot_type::PuzzleClearPatternGroupSnapshot;
pub use puzzle_clear_run_get_input_type::PuzzleClearRunGetInput;
pub use puzzle_clear_run_next_level_input_type::PuzzleClearRunNextLevelInput;
pub use puzzle_clear_run_procedure_result_type::PuzzleClearRunProcedureResult;
pub use puzzle_clear_run_retry_level_input_type::PuzzleClearRunRetryLevelInput;
pub use puzzle_clear_run_start_input_type::PuzzleClearRunStartInput;
pub use puzzle_clear_run_swap_input_type::PuzzleClearRunSwapInput;
pub use puzzle_clear_run_time_up_input_type::PuzzleClearRunTimeUpInput;
pub use puzzle_clear_runtime_run_row_type::PuzzleClearRuntimeRunRow;
pub use puzzle_clear_runtime_run_table::*;
pub use puzzle_clear_runtime_snapshot_type::PuzzleClearRuntimeSnapshot;
pub use puzzle_clear_work_get_input_type::PuzzleClearWorkGetInput;
pub use puzzle_clear_work_procedure_result_type::PuzzleClearWorkProcedureResult;
pub use puzzle_clear_work_profile_row_type::PuzzleClearWorkProfileRow;
pub use puzzle_clear_work_profile_table::*;
pub use puzzle_clear_work_publish_input_type::PuzzleClearWorkPublishInput;
pub use puzzle_clear_work_snapshot_type::PuzzleClearWorkSnapshot;
pub use puzzle_clear_work_update_input_type::PuzzleClearWorkUpdateInput;
pub use puzzle_clear_works_list_input_type::PuzzleClearWorksListInput;
pub use puzzle_clear_works_procedure_result_type::PuzzleClearWorksProcedureResult;
pub use puzzle_creator_intent_type::PuzzleCreatorIntent;
pub use puzzle_draft_compile_failure_input_type::PuzzleDraftCompileFailureInput;
pub use puzzle_draft_compile_input_type::PuzzleDraftCompileInput;
@@ -1780,6 +1889,7 @@ 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_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 retry_puzzle_clear_level_run_procedure::retry_puzzle_clear_level_run;
pub use revoke_database_migration_operator_procedure::revoke_database_migration_operator;
pub use rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind;
pub use rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus;
@@ -1950,6 +2060,7 @@ 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_jump_hop_run_procedure::start_jump_hop_run;
pub use start_match_3_d_run_procedure::start_match_3_d_run;
pub use start_puzzle_clear_runtime_run_procedure::start_puzzle_clear_runtime_run;
pub use start_puzzle_run_procedure::start_puzzle_run;
pub use start_square_hole_run_procedure::start_square_hole_run;
pub use start_visual_novel_run_procedure::start_visual_novel_run;
@@ -1978,6 +2089,7 @@ pub use submit_puzzle_agent_message_procedure::submit_puzzle_agent_message;
pub use submit_puzzle_leaderboard_entry_procedure::submit_puzzle_leaderboard_entry;
pub use submit_square_hole_agent_message_procedure::submit_square_hole_agent_message;
pub use submit_visual_novel_agent_message_procedure::submit_visual_novel_agent_message;
pub use swap_puzzle_clear_cards_procedure::swap_puzzle_clear_cards;
pub use swap_puzzle_pieces_procedure::swap_puzzle_pieces;
pub use tracking_daily_stat_table::*;
pub use tracking_daily_stat_type::TrackingDailyStat;
@@ -1996,6 +2108,7 @@ 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_jump_hop_work_procedure::update_jump_hop_work;
pub use update_match_3_d_work_procedure::update_match_3_d_work;
pub use update_puzzle_clear_work_procedure::update_puzzle_clear_work;
pub use update_puzzle_run_pause_procedure::update_puzzle_run_pause;
pub use update_puzzle_work_procedure::update_puzzle_work;
pub use update_square_hole_work_procedure::update_square_hole_work;
@@ -2090,6 +2203,7 @@ pub use wooden_fish_run_status_type::WoodenFishRunStatus;
pub use wooden_fish_runtime_run_row_type::WoodenFishRuntimeRunRow;
pub use wooden_fish_runtime_run_table::*;
pub use wooden_fish_word_counter_type::WoodenFishWordCounter;
pub use wooden_fish_work_delete_input_type::WoodenFishWorkDeleteInput;
pub use wooden_fish_work_get_input_type::WoodenFishWorkGetInput;
pub use wooden_fish_work_procedure_result_type::WoodenFishWorkProcedureResult;
pub use wooden_fish_work_profile_row_type::WoodenFishWorkProfileRow;
@@ -2447,6 +2561,12 @@ pub struct DbUpdate {
public_work_play_daily_stat: __sdk::TableUpdate<PublicWorkPlayDailyStat>,
puzzle_agent_message: __sdk::TableUpdate<PuzzleAgentMessageRow>,
puzzle_agent_session: __sdk::TableUpdate<PuzzleAgentSessionRow>,
puzzle_clear_agent_session: __sdk::TableUpdate<PuzzleClearAgentSessionRow>,
puzzle_clear_event: __sdk::TableUpdate<PuzzleClearEventRow>,
puzzle_clear_gallery_card_view: __sdk::TableUpdate<PuzzleClearGalleryCardViewRow>,
puzzle_clear_gallery_view: __sdk::TableUpdate<PuzzleClearGalleryViewRow>,
puzzle_clear_runtime_run: __sdk::TableUpdate<PuzzleClearRuntimeRunRow>,
puzzle_clear_work_profile: __sdk::TableUpdate<PuzzleClearWorkProfileRow>,
puzzle_event: __sdk::TableUpdate<PuzzleEvent>,
puzzle_gallery_card_view: __sdk::TableUpdate<PuzzleGalleryCardViewRow>,
puzzle_gallery_view: __sdk::TableUpdate<PuzzleWorkProfile>,
@@ -2726,6 +2846,26 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
"puzzle_agent_session" => db_update.puzzle_agent_session.append(
puzzle_agent_session_table::parse_table_update(table_update)?,
),
"puzzle_clear_agent_session" => db_update.puzzle_clear_agent_session.append(
puzzle_clear_agent_session_table::parse_table_update(table_update)?,
),
"puzzle_clear_event" => db_update
.puzzle_clear_event
.append(puzzle_clear_event_table::parse_table_update(table_update)?),
"puzzle_clear_gallery_card_view" => {
db_update.puzzle_clear_gallery_card_view.append(
puzzle_clear_gallery_card_view_table::parse_table_update(table_update)?,
)
}
"puzzle_clear_gallery_view" => db_update.puzzle_clear_gallery_view.append(
puzzle_clear_gallery_view_table::parse_table_update(table_update)?,
),
"puzzle_clear_runtime_run" => db_update.puzzle_clear_runtime_run.append(
puzzle_clear_runtime_run_table::parse_table_update(table_update)?,
),
"puzzle_clear_work_profile" => db_update.puzzle_clear_work_profile.append(
puzzle_clear_work_profile_table::parse_table_update(table_update)?,
),
"puzzle_event" => db_update
.puzzle_event
.append(puzzle_event_table::parse_table_update(table_update)?),
@@ -3225,6 +3365,30 @@ impl __sdk::DbUpdate for DbUpdate {
&self.puzzle_agent_session,
)
.with_updates_by_pk(|row| &row.session_id);
diff.puzzle_clear_agent_session = cache
.apply_diff_to_table::<PuzzleClearAgentSessionRow>(
"puzzle_clear_agent_session",
&self.puzzle_clear_agent_session,
)
.with_updates_by_pk(|row| &row.session_id);
diff.puzzle_clear_event = cache
.apply_diff_to_table::<PuzzleClearEventRow>(
"puzzle_clear_event",
&self.puzzle_clear_event,
)
.with_updates_by_pk(|row| &row.event_id);
diff.puzzle_clear_runtime_run = cache
.apply_diff_to_table::<PuzzleClearRuntimeRunRow>(
"puzzle_clear_runtime_run",
&self.puzzle_clear_runtime_run,
)
.with_updates_by_pk(|row| &row.run_id);
diff.puzzle_clear_work_profile = cache
.apply_diff_to_table::<PuzzleClearWorkProfileRow>(
"puzzle_clear_work_profile",
&self.puzzle_clear_work_profile,
)
.with_updates_by_pk(|row| &row.profile_id);
diff.puzzle_event = self.puzzle_event.into_event_diff();
diff.puzzle_leaderboard_entry = cache
.apply_diff_to_table::<PuzzleLeaderboardEntryRow>(
@@ -3390,6 +3554,15 @@ impl __sdk::DbUpdate for DbUpdate {
"public_work_gallery_entry",
&self.public_work_gallery_entry,
);
diff.puzzle_clear_gallery_card_view = cache
.apply_diff_to_table::<PuzzleClearGalleryCardViewRow>(
"puzzle_clear_gallery_card_view",
&self.puzzle_clear_gallery_card_view,
);
diff.puzzle_clear_gallery_view = cache.apply_diff_to_table::<PuzzleClearGalleryViewRow>(
"puzzle_clear_gallery_view",
&self.puzzle_clear_gallery_view,
);
diff.puzzle_gallery_card_view = cache.apply_diff_to_table::<PuzzleGalleryCardViewRow>(
"puzzle_gallery_card_view",
&self.puzzle_gallery_card_view,
@@ -3647,6 +3820,24 @@ impl __sdk::DbUpdate for DbUpdate {
"puzzle_agent_session" => db_update
.puzzle_agent_session
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"puzzle_clear_agent_session" => db_update
.puzzle_clear_agent_session
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"puzzle_clear_event" => db_update
.puzzle_clear_event
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"puzzle_clear_gallery_card_view" => db_update
.puzzle_clear_gallery_card_view
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"puzzle_clear_gallery_view" => db_update
.puzzle_clear_gallery_view
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"puzzle_clear_runtime_run" => db_update
.puzzle_clear_runtime_run
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"puzzle_clear_work_profile" => db_update
.puzzle_clear_work_profile
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"puzzle_event" => db_update
.puzzle_event
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
@@ -3993,6 +4184,24 @@ impl __sdk::DbUpdate for DbUpdate {
"puzzle_agent_session" => db_update
.puzzle_agent_session
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"puzzle_clear_agent_session" => db_update
.puzzle_clear_agent_session
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"puzzle_clear_event" => db_update
.puzzle_clear_event
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"puzzle_clear_gallery_card_view" => db_update
.puzzle_clear_gallery_card_view
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"puzzle_clear_gallery_view" => db_update
.puzzle_clear_gallery_view
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"puzzle_clear_runtime_run" => db_update
.puzzle_clear_runtime_run
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"puzzle_clear_work_profile" => db_update
.puzzle_clear_work_profile
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"puzzle_event" => db_update
.puzzle_event
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
@@ -4193,6 +4402,12 @@ pub struct AppliedDiff<'r> {
public_work_play_daily_stat: __sdk::TableAppliedDiff<'r, PublicWorkPlayDailyStat>,
puzzle_agent_message: __sdk::TableAppliedDiff<'r, PuzzleAgentMessageRow>,
puzzle_agent_session: __sdk::TableAppliedDiff<'r, PuzzleAgentSessionRow>,
puzzle_clear_agent_session: __sdk::TableAppliedDiff<'r, PuzzleClearAgentSessionRow>,
puzzle_clear_event: __sdk::TableAppliedDiff<'r, PuzzleClearEventRow>,
puzzle_clear_gallery_card_view: __sdk::TableAppliedDiff<'r, PuzzleClearGalleryCardViewRow>,
puzzle_clear_gallery_view: __sdk::TableAppliedDiff<'r, PuzzleClearGalleryViewRow>,
puzzle_clear_runtime_run: __sdk::TableAppliedDiff<'r, PuzzleClearRuntimeRunRow>,
puzzle_clear_work_profile: __sdk::TableAppliedDiff<'r, PuzzleClearWorkProfileRow>,
puzzle_event: __sdk::TableAppliedDiff<'r, PuzzleEvent>,
puzzle_gallery_card_view: __sdk::TableAppliedDiff<'r, PuzzleGalleryCardViewRow>,
puzzle_gallery_view: __sdk::TableAppliedDiff<'r, PuzzleWorkProfile>,
@@ -4606,6 +4821,36 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
&self.puzzle_agent_session,
event,
);
callbacks.invoke_table_row_callbacks::<PuzzleClearAgentSessionRow>(
"puzzle_clear_agent_session",
&self.puzzle_clear_agent_session,
event,
);
callbacks.invoke_table_row_callbacks::<PuzzleClearEventRow>(
"puzzle_clear_event",
&self.puzzle_clear_event,
event,
);
callbacks.invoke_table_row_callbacks::<PuzzleClearGalleryCardViewRow>(
"puzzle_clear_gallery_card_view",
&self.puzzle_clear_gallery_card_view,
event,
);
callbacks.invoke_table_row_callbacks::<PuzzleClearGalleryViewRow>(
"puzzle_clear_gallery_view",
&self.puzzle_clear_gallery_view,
event,
);
callbacks.invoke_table_row_callbacks::<PuzzleClearRuntimeRunRow>(
"puzzle_clear_runtime_run",
&self.puzzle_clear_runtime_run,
event,
);
callbacks.invoke_table_row_callbacks::<PuzzleClearWorkProfileRow>(
"puzzle_clear_work_profile",
&self.puzzle_clear_work_profile,
event,
);
callbacks.invoke_table_row_callbacks::<PuzzleEvent>(
"puzzle_event",
&self.puzzle_event,
@@ -5033,19 +5278,19 @@ impl __sdk::SubscriptionHandle for SubscriptionHandle {
/// either a [`DbConnection`] or an [`EventContext`] and operate on either.
pub trait RemoteDbContext:
__sdk::DbContext<
DbView = RemoteTables,
Reducers = RemoteReducers,
SubscriptionBuilder = __sdk::SubscriptionBuilder<RemoteModule>,
>
DbView = RemoteTables,
Reducers = RemoteReducers,
SubscriptionBuilder = __sdk::SubscriptionBuilder<RemoteModule>,
>
{
}
impl<
Ctx: __sdk::DbContext<
Ctx: __sdk::DbContext<
DbView = RemoteTables,
Reducers = RemoteReducers,
SubscriptionBuilder = __sdk::SubscriptionBuilder<RemoteModule>,
>,
> RemoteDbContext for Ctx
> RemoteDbContext for Ctx
{
}
@@ -5513,6 +5758,12 @@ impl __sdk::SpacetimeModule for RemoteModule {
public_work_play_daily_stat_table::register_table(client_cache);
puzzle_agent_message_table::register_table(client_cache);
puzzle_agent_session_table::register_table(client_cache);
puzzle_clear_agent_session_table::register_table(client_cache);
puzzle_clear_event_table::register_table(client_cache);
puzzle_clear_gallery_card_view_table::register_table(client_cache);
puzzle_clear_gallery_view_table::register_table(client_cache);
puzzle_clear_runtime_run_table::register_table(client_cache);
puzzle_clear_work_profile_table::register_table(client_cache);
puzzle_event_table::register_table(client_cache);
puzzle_gallery_card_view_table::register_table(client_cache);
puzzle_gallery_view_table::register_table(client_cache);
@@ -5626,6 +5877,12 @@ impl __sdk::SpacetimeModule for RemoteModule {
"public_work_play_daily_stat",
"puzzle_agent_message",
"puzzle_agent_session",
"puzzle_clear_agent_session",
"puzzle_clear_event",
"puzzle_clear_gallery_card_view",
"puzzle_clear_gallery_view",
"puzzle_clear_runtime_run",
"puzzle_clear_work_profile",
"puzzle_event",
"puzzle_gallery_card_view",
"puzzle_gallery_view",

View File

@@ -47,9 +47,11 @@ pub trait accept_quest {
&self,
input: QuestRecordInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl accept_quest for super::RemoteReducers {
&self,
input: QuestRecordInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(AcceptQuestArgs { input }, callback)

View File

@@ -47,9 +47,11 @@ pub trait acknowledge_quest_completion {
&self,
input: QuestCompletionAckInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl acknowledge_quest_completion for super::RemoteReducers {
&self,
input: QuestCompletionAckInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait admin_disable_profile_redeem_code {
input: RuntimeProfileRedeemCodeAdminDisableInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_disable_profile_redeem_code for super::RemoteProcedures {
input: RuntimeProfileRedeemCodeAdminDisableInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_disable_profile_task_config {
input: RuntimeProfileTaskConfigAdminDisableInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_disable_profile_task_config for super::RemoteProcedures {
input: RuntimeProfileTaskConfigAdminDisableInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_list_profile_invite_codes {
input: RuntimeProfileInviteCodeAdminListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_list_profile_invite_codes for super::RemoteProcedures {
input: RuntimeProfileInviteCodeAdminListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileInviteCodeAdminListProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait admin_list_profile_recharge_products {
input: RuntimeProfileRechargeProductAdminListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeProductAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeProductAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -47,10 +47,10 @@ impl admin_list_profile_recharge_products for super::RemoteProcedures {
input: RuntimeProfileRechargeProductAdminListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeProductAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeProductAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp.invoke_procedure_with_callback::<_, RuntimeProfileRechargeProductAdminListProcedureResult>(
"admin_list_profile_recharge_products",

View File

@@ -31,10 +31,10 @@ pub trait admin_list_profile_redeem_codes {
input: RuntimeProfileRedeemCodeAdminListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_list_profile_redeem_codes for super::RemoteProcedures {
input: RuntimeProfileRedeemCodeAdminListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminListProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_list_profile_task_configs {
input: RuntimeProfileTaskConfigAdminListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_list_profile_task_configs for super::RemoteProcedures {
input: RuntimeProfileTaskConfigAdminListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminListProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_list_work_visibility {
input: AdminWorkVisibilityListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AdminWorkVisibilityListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AdminWorkVisibilityListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_list_work_visibility for super::RemoteProcedures {
input: AdminWorkVisibilityListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AdminWorkVisibilityListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AdminWorkVisibilityListProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AdminWorkVisibilityListProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_update_work_visibility {
input: AdminWorkVisibilityUpdateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AdminWorkVisibilityProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AdminWorkVisibilityProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_update_work_visibility for super::RemoteProcedures {
input: AdminWorkVisibilityUpdateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AdminWorkVisibilityProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AdminWorkVisibilityProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AdminWorkVisibilityProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_upsert_profile_invite_code {
input: RuntimeProfileInviteCodeAdminUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_upsert_profile_invite_code for super::RemoteProcedures {
input: RuntimeProfileInviteCodeAdminUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileInviteCodeAdminProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait admin_upsert_profile_recharge_product {
input: RuntimeProfileRechargeProductAdminUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeProductAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeProductAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -47,10 +47,10 @@ impl admin_upsert_profile_recharge_product for super::RemoteProcedures {
input: RuntimeProfileRechargeProductAdminUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeProductAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeProductAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRechargeProductAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_upsert_profile_redeem_code {
input: RuntimeProfileRedeemCodeAdminUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_upsert_profile_redeem_code for super::RemoteProcedures {
input: RuntimeProfileRedeemCodeAdminUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_upsert_profile_task_config {
input: RuntimeProfileTaskConfigAdminUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl admin_upsert_profile_task_config for super::RemoteProcedures {
input: RuntimeProfileTaskConfigAdminUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminProcedureResult>(

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::puzzle_clear_run_next_level_input_type::PuzzleClearRunNextLevelInput;
use super::puzzle_clear_run_procedure_result_type::PuzzleClearRunProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct AdvancePuzzleClearNextLevelArgs {
pub input: PuzzleClearRunNextLevelInput,
}
impl __sdk::InModule for AdvancePuzzleClearNextLevelArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `advance_puzzle_clear_next_level`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait advance_puzzle_clear_next_level {
fn advance_puzzle_clear_next_level(&self, input: PuzzleClearRunNextLevelInput) {
self.advance_puzzle_clear_next_level_then(input, |_, _| {});
}
fn advance_puzzle_clear_next_level_then(
&self,
input: PuzzleClearRunNextLevelInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleClearRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl advance_puzzle_clear_next_level for super::RemoteProcedures {
fn advance_puzzle_clear_next_level_then(
&self,
input: PuzzleClearRunNextLevelInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleClearRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, PuzzleClearRunProcedureResult>(
"advance_puzzle_clear_next_level",
AdvancePuzzleClearNextLevelArgs { input },
__callback,
);
}
}

View File

@@ -31,10 +31,10 @@ pub trait advance_puzzle_next_level {
input: PuzzleRunNextLevelInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl advance_puzzle_next_level for super::RemoteProcedures {
input: PuzzleRunNextLevelInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait append_ai_text_chunk_and_return {
input: AiTextChunkAppendInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl append_ai_text_chunk_and_return for super::RemoteProcedures {
input: AiTextChunkAppendInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait append_visual_novel_runtime_history_entry {
input: VisualNovelRuntimeHistoryAppendInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<VisualNovelHistoryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<VisualNovelHistoryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -47,10 +47,10 @@ impl append_visual_novel_runtime_history_entry for super::RemoteProcedures {
input: VisualNovelRuntimeHistoryAppendInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<VisualNovelHistoryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<VisualNovelHistoryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, VisualNovelHistoryProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait apply_chapter_progression_ledger_entry_and_return {
input: ChapterProgressionLedgerInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -47,10 +47,10 @@ impl apply_chapter_progression_ledger_entry_and_return for super::RemoteProcedur
input: ChapterProgressionLedgerInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>(

View File

@@ -50,9 +50,11 @@ pub trait apply_chapter_progression_ledger_entry {
&self,
input: ChapterProgressionLedgerInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -61,9 +63,11 @@ impl apply_chapter_progression_ledger_entry for super::RemoteReducers {
&self,
input: ChapterProgressionLedgerInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback(
ApplyChapterProgressionLedgerEntryArgs { input },

View File

@@ -47,9 +47,11 @@ pub trait apply_inventory_mutation {
&self,
input: InventoryMutationInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl apply_inventory_mutation for super::RemoteReducers {
&self,
input: InventoryMutationInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input }, callback)

View File

@@ -47,9 +47,11 @@ pub trait apply_quest_signal {
&self,
input: QuestSignalApplyInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl apply_quest_signal for super::RemoteReducers {
&self,
input: QuestSignalApplyInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(ApplyQuestSignalArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait attach_ai_result_reference_and_return {
input: AiResultReferenceInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl attach_ai_result_reference_and_return for super::RemoteProcedures {
input: AiResultReferenceInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait authorize_database_migration_operator {
input: DatabaseMigrationAuthorizeOperatorInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<DatabaseMigrationOperatorProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<DatabaseMigrationOperatorProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -47,10 +47,10 @@ impl authorize_database_migration_operator for super::RemoteProcedures {
input: DatabaseMigrationAuthorizeOperatorInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<DatabaseMigrationOperatorProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<DatabaseMigrationOperatorProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, DatabaseMigrationOperatorProcedureResult>(

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 BarkBattleWorkDeleteInput {
pub work_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for BarkBattleWorkDeleteInput {
type Module = super::RemoteModule;
}

View File

@@ -31,10 +31,10 @@ pub trait begin_story_session_and_return {
input: StorySessionInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl begin_story_session_and_return for super::RemoteProcedures {
input: StorySessionInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, StorySessionProcedureResult>(

View File

@@ -47,9 +47,11 @@ pub trait begin_story_session {
&self,
input: StorySessionInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl begin_story_session for super::RemoteReducers {
&self,
input: StorySessionInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(BeginStorySessionArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait bind_asset_object_to_entity_and_return {
input: AssetEntityBindingInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AssetEntityBindingProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AssetEntityBindingProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl bind_asset_object_to_entity_and_return for super::RemoteProcedures {
input: AssetEntityBindingInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AssetEntityBindingProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AssetEntityBindingProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AssetEntityBindingProcedureResult>(

View File

@@ -47,9 +47,11 @@ pub trait bind_asset_object_to_entity {
&self,
input: AssetEntityBindingInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl bind_asset_object_to_entity for super::RemoteReducers {
&self,
input: AssetEntityBindingInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(BindAssetObjectToEntityArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait cancel_ai_task_and_return {
input: AiTaskCancelInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl cancel_ai_task_and_return for super::RemoteProcedures {
input: AiTaskCancelInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait checkpoint_wooden_fish_run {
input: WoodenFishRunCheckpointInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl checkpoint_wooden_fish_run for super::RemoteProcedures {
input: WoodenFishRunCheckpointInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishRunProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait claim_profile_task_reward_and_return {
input: RuntimeProfileTaskClaimInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileTaskClaimProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileTaskClaimProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl claim_profile_task_reward_and_return for super::RemoteProcedures {
input: RuntimeProfileTaskClaimInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileTaskClaimProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileTaskClaimProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileTaskClaimProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait claim_puzzle_work_point_incentive {
input: PuzzleWorkPointIncentiveClaimInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<PuzzleWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl claim_puzzle_work_point_incentive for super::RemoteProcedures {
input: PuzzleWorkPointIncentiveClaimInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<PuzzleWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait clear_database_migration_import_chunks {
input: DatabaseMigrationImportChunksClearInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<DatabaseMigrationProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<DatabaseMigrationProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -47,10 +47,10 @@ impl clear_database_migration_import_chunks for super::RemoteProcedures {
input: DatabaseMigrationImportChunksClearInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<DatabaseMigrationProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<DatabaseMigrationProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait clear_platform_browse_history_and_return {
input: RuntimeBrowseHistoryClearInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl clear_platform_browse_history_and_return for super::RemoteProcedures {
input: RuntimeBrowseHistoryClearInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait click_match_3_d_item {
input: Match3DRunClickInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<Match3DClickItemProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<Match3DClickItemProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl click_match_3_d_item for super::RemoteProcedures {
input: Match3DRunClickInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<Match3DClickItemProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<Match3DClickItemProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, Match3DClickItemProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_big_fish_draft {
input: BigFishDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl compile_big_fish_draft for super::RemoteProcedures {
input: BigFishDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait compile_custom_world_published_profile {
input: CustomWorldPublishedProfileCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -47,10 +47,10 @@ impl compile_custom_world_published_profile for super::RemoteProcedures {
input: CustomWorldPublishedProfileCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, CustomWorldPublishedProfileCompileResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_jump_hop_draft {
input: JumpHopDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl compile_jump_hop_draft for super::RemoteProcedures {
input: JumpHopDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<JumpHopAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, JumpHopAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_match_3_d_draft {
input: Match3DDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl compile_match_3_d_draft for super::RemoteProcedures {
input: Match3DDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_puzzle_agent_draft {
input: PuzzleDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl compile_puzzle_agent_draft for super::RemoteProcedures {
input: PuzzleDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(

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::puzzle_clear_agent_session_procedure_result_type::PuzzleClearAgentSessionProcedureResult;
use super::puzzle_clear_draft_compile_input_type::PuzzleClearDraftCompileInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct CompilePuzzleClearDraftArgs {
pub input: PuzzleClearDraftCompileInput,
}
impl __sdk::InModule for CompilePuzzleClearDraftArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `compile_puzzle_clear_draft`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait compile_puzzle_clear_draft {
fn compile_puzzle_clear_draft(&self, input: PuzzleClearDraftCompileInput) {
self.compile_puzzle_clear_draft_then(input, |_, _| {});
}
fn compile_puzzle_clear_draft_then(
&self,
input: PuzzleClearDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleClearAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl compile_puzzle_clear_draft for super::RemoteProcedures {
fn compile_puzzle_clear_draft_then(
&self,
input: PuzzleClearDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleClearAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, PuzzleClearAgentSessionProcedureResult>(
"compile_puzzle_clear_draft",
CompilePuzzleClearDraftArgs { input },
__callback,
);
}
}

View File

@@ -31,10 +31,10 @@ pub trait compile_square_hole_draft {
input: SquareHoleDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl compile_square_hole_draft for super::RemoteProcedures {
input: SquareHoleDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_visual_novel_work_profile {
input: VisualNovelWorkCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<VisualNovelAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<VisualNovelAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl compile_visual_novel_work_profile for super::RemoteProcedures {
input: VisualNovelWorkCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<VisualNovelAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<VisualNovelAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, VisualNovelAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_wooden_fish_draft {
input: WoodenFishDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl compile_wooden_fish_draft for super::RemoteProcedures {
input: WoodenFishDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait complete_ai_stage_and_return {
input: AiStageCompletionInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl complete_ai_stage_and_return for super::RemoteProcedures {
input: AiStageCompletionInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait complete_ai_task_and_return {
input: AiTaskFinishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl complete_ai_task_and_return for super::RemoteProcedures {
input: AiTaskFinishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait confirm_asset_object_and_return {
input: AssetObjectUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AssetObjectProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AssetObjectProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl confirm_asset_object_and_return for super::RemoteProcedures {
input: AssetObjectUpsertInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AssetObjectProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AssetObjectProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AssetObjectProcedureResult>(

View File

@@ -47,9 +47,11 @@ pub trait confirm_asset_object {
&self,
input: AssetObjectUpsertInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl confirm_asset_object for super::RemoteReducers {
&self,
input: AssetObjectUpsertInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(ConfirmAssetObjectArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait consume_profile_wallet_points_and_return {
input: RuntimeProfileWalletAdjustmentInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileWalletAdjustmentProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileWalletAdjustmentProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl consume_profile_wallet_points_and_return for super::RemoteProcedures {
input: RuntimeProfileWalletAdjustmentInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileWalletAdjustmentProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<RuntimeProfileWalletAdjustmentProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileWalletAdjustmentProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait continue_story_and_return {
input: StoryContinueInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl continue_story_and_return for super::RemoteProcedures {
input: StoryContinueInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, StorySessionProcedureResult>(

View File

@@ -47,9 +47,11 @@ pub trait continue_story {
&self,
input: StoryContinueInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl continue_story for super::RemoteReducers {
&self,
input: StoryContinueInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(ContinueStoryArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait create_ai_task_and_return {
input: AiTaskCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl create_ai_task_and_return for super::RemoteProcedures {
input: AiTaskCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -47,9 +47,11 @@ pub trait create_ai_task {
&self,
input: AiTaskCreateInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl create_ai_task for super::RemoteReducers {
&self,
input: AiTaskCreateInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(CreateAiTaskArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait create_bark_battle_draft {
input: BarkBattleDraftCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<BarkBattleProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<BarkBattleProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl create_bark_battle_draft for super::RemoteProcedures {
input: BarkBattleDraftCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<BarkBattleProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<BarkBattleProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, BarkBattleProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait create_battle_state_and_return {
input: BattleStateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<BattleStateProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<BattleStateProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl create_battle_state_and_return for super::RemoteProcedures {
input: BattleStateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<BattleStateProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<BattleStateProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, BattleStateProcedureResult>(

View File

@@ -47,9 +47,11 @@ pub trait create_battle_state {
&self,
input: BattleStateInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
@@ -58,9 +60,11 @@ impl create_battle_state for super::RemoteReducers {
&self,
input: BattleStateInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
+ Send
+ 'static,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(CreateBattleStateArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait create_big_fish_session {
input: BigFishSessionCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
@@ -44,10 +44,10 @@ impl create_big_fish_session for super::RemoteProcedures {
input: BigFishSessionCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
&super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(

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