Add user played work stats for puzzle and big fish
Some checks failed
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-04-28 12:58:31 +08:00
parent bb4100fca4
commit 377d7d0412
21 changed files with 1028 additions and 82 deletions

View File

@@ -250,4 +250,28 @@ impl SpacetimeClient {
})
.await
}
pub async fn record_big_fish_play(
&self,
input: BigFishPlayReportRecordInput,
) -> Result<BigFishSessionRecord, SpacetimeClientError> {
let procedure_input = BigFishPlayReportInput {
session_id: input.session_id,
user_id: input.user_id,
elapsed_ms: input.elapsed_ms,
reported_at_micros: input.reported_at_micros,
};
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.record_big_fish_play_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_big_fish_session_procedure_result);
send_once(&sender, mapped);
});
})
.await
}
}