抓大鹅B4+B5进行中 2
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-05-01 01:08:59 +08:00
parent 38b5db553e
commit dd48861c59
6 changed files with 73 additions and 74 deletions

View File

@@ -24,15 +24,15 @@ pub use mapper::{
CustomWorldProfileUpsertRecordInput, CustomWorldPublishGateRecord,
CustomWorldPublishWorldRecord, CustomWorldPublishWorldRecordInput,
CustomWorldPublishedProfileCompileRecord, CustomWorldResultPreviewBlockerRecord,
CustomWorldSupportedActionRecord, CustomWorldWorkSummaryRecord, NpcBattleInteractionRecord,
CustomWorldSupportedActionRecord, CustomWorldWorkSummaryRecord,
Match3DAgentMessageFinalizeRecordInput, Match3DAgentMessageRecord,
Match3DAgentMessageSubmitRecordInput, Match3DAgentSessionCreateRecordInput,
Match3DAgentSessionRecord, Match3DAnchorItemRecord, Match3DAnchorPackRecord,
Match3DClickConfirmationRecord, Match3DCompileDraftRecordInput,
Match3DCreatorConfigRecord, Match3DItemSnapshotRecord, Match3DResultDraftRecord,
Match3DRunClickRecordInput, Match3DRunRecord, Match3DRunRestartRecordInput,
Match3DRunStartRecordInput, Match3DRunStopRecordInput, Match3DRunTimeUpRecordInput,
Match3DTraySlotRecord, Match3DWorkProfileRecord, Match3DWorkUpdateRecordInput,
Match3DClickConfirmationRecord, Match3DCompileDraftRecordInput, Match3DCreatorConfigRecord,
Match3DItemSnapshotRecord, Match3DResultDraftRecord, Match3DRunClickRecordInput,
Match3DRunRecord, Match3DRunRestartRecordInput, Match3DRunStartRecordInput,
Match3DRunStopRecordInput, Match3DRunTimeUpRecordInput, Match3DTraySlotRecord,
Match3DWorkProfileRecord, Match3DWorkUpdateRecordInput, NpcBattleInteractionRecord,
NpcInteractionRecord, NpcStateRecord, PuzzleAgentMessageFinalizeRecordInput,
PuzzleAgentMessageRecord, PuzzleAgentMessageSubmitRecordInput,
PuzzleAgentSessionCreateRecordInput, PuzzleAgentSessionRecord,

View File

@@ -1404,8 +1404,8 @@ pub(crate) fn map_match3d_agent_session_procedure_result(
"SpacetimeDB procedure 未返回 match3d agent session 快照".to_string(),
)
})?;
let session = serde_json::from_str::<Match3DAgentSessionJsonRecord>(&session_json)
.map_err(|error| {
let session =
serde_json::from_str::<Match3DAgentSessionJsonRecord>(&session_json).map_err(|error| {
SpacetimeClientError::Runtime(format!("match3d session_json 非法: {error}"))
})?;
@@ -1424,7 +1424,9 @@ pub(crate) fn map_match3d_work_procedure_result(
}
let work_json = result.work_json.ok_or_else(|| {
SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回 match3d work 快照".to_string())
SpacetimeClientError::Procedure(
"SpacetimeDB procedure 未返回 match3d work 快照".to_string(),
)
})?;
let work = serde_json::from_str::<Match3DWorkJsonRecord>(&work_json).map_err(|error| {
SpacetimeClientError::Runtime(format!("match3d work_json 非法: {error}"))
@@ -1449,8 +1451,8 @@ pub(crate) fn map_match3d_works_procedure_result(
"SpacetimeDB procedure 未返回 match3d works 快照".to_string(),
)
})?;
let items = serde_json::from_str::<Vec<Match3DWorkJsonRecord>>(&items_json)
.map_err(|error| {
let items =
serde_json::from_str::<Vec<Match3DWorkJsonRecord>>(&items_json).map_err(|error| {
SpacetimeClientError::Runtime(format!("match3d works items_json 非法: {error}"))
})?;
@@ -2519,9 +2521,7 @@ fn map_match3d_agent_message_snapshot(
}
}
fn map_match3d_work_snapshot(
snapshot: Match3DWorkJsonRecord,
) -> Match3DWorkProfileRecord {
fn map_match3d_work_snapshot(snapshot: Match3DWorkJsonRecord) -> Match3DWorkProfileRecord {
let config = map_match3d_creator_config(snapshot.config);
Match3DWorkProfileRecord {
work_id: snapshot.profile_id.clone(),
@@ -2566,7 +2566,9 @@ fn map_match3d_run_snapshot(snapshot: Match3DRunJsonRecord) -> Match3DRunRecord
.map(|item| {
let tray_slot_index = tray_slots
.iter()
.find(|slot| slot.item_instance_id.as_deref() == Some(item.item_instance_id.as_str()))
.find(|slot| {
slot.item_instance_id.as_deref() == Some(item.item_instance_id.as_str())
})
.map(|slot| slot.slot_index);
map_match3d_item_snapshot(item, tray_slot_index)
})
@@ -2610,9 +2612,7 @@ fn map_match3d_item_snapshot(
}
}
fn map_match3d_tray_slot_snapshot(
snapshot: Match3DTraySlotJsonRecord,
) -> Match3DTraySlotRecord {
fn map_match3d_tray_slot_snapshot(snapshot: Match3DTraySlotJsonRecord) -> Match3DTraySlotRecord {
Match3DTraySlotRecord {
slot_index: snapshot.slot_index,
item_instance_id: snapshot.item_instance_id,
@@ -2626,16 +2626,8 @@ fn build_match3d_anchor_pack(config: &Match3DCreatorConfigRecord) -> Match3DAnch
let difficulty = config.difficulty.to_string();
Match3DAnchorPackRecord {
theme: build_match3d_anchor_item("theme", "题材主题", config.theme_text.as_str()),
clear_count: build_match3d_anchor_item(
"clearCount",
"需要消除次数",
clear_count.as_str(),
),
difficulty: build_match3d_anchor_item(
"difficulty",
"难度",
difficulty.as_str(),
),
clear_count: build_match3d_anchor_item("clearCount", "需要消除次数", clear_count.as_str()),
difficulty: build_match3d_anchor_item("difficulty", "难度", difficulty.as_str()),
}
}

View File

@@ -298,9 +298,9 @@ impl SpacetimeClient {
};
self.call_after_connect(move |connection, sender| {
connection.procedures().start_match_3_d_run_then(
procedure_input,
move |_, result| {
connection
.procedures()
.start_match_3_d_run_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_match3d_run_procedure_result)
@@ -309,8 +309,7 @@ impl SpacetimeClient {
run
});
send_once(&sender, mapped);
},
);
});
})
.await
}
@@ -321,12 +320,15 @@ impl SpacetimeClient {
owner_user_id: String,
) -> Result<Match3DRunRecord, SpacetimeClientError> {
let procedure_owner_user_id = owner_user_id.clone();
let procedure_input = Match3DRunGetInput { run_id, owner_user_id };
let procedure_input = Match3DRunGetInput {
run_id,
owner_user_id,
};
self.call_after_connect(move |connection, sender| {
connection.procedures().get_match_3_d_run_then(
procedure_input,
move |_, result| {
connection
.procedures()
.get_match_3_d_run_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_match3d_run_procedure_result)
@@ -335,8 +337,7 @@ impl SpacetimeClient {
run
});
send_once(&sender, mapped);
},
);
});
})
.await
}
@@ -357,9 +358,9 @@ impl SpacetimeClient {
};
self.call_after_connect(move |connection, sender| {
connection.procedures().click_match_3_d_item_then(
procedure_input,
move |_, result| {
connection
.procedures()
.click_match_3_d_item_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_match3d_click_item_procedure_result)
@@ -371,8 +372,7 @@ impl SpacetimeClient {
confirmation
});
send_once(&sender, mapped);
},
);
});
})
.await
}
@@ -389,9 +389,9 @@ impl SpacetimeClient {
};
self.call_after_connect(move |connection, sender| {
connection.procedures().stop_match_3_d_run_then(
procedure_input,
move |_, result| {
connection
.procedures()
.stop_match_3_d_run_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_match3d_run_procedure_result)
@@ -400,8 +400,7 @@ impl SpacetimeClient {
run
});
send_once(&sender, mapped);
},
);
});
})
.await
}