1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Add intercom functionality for setting factory thumbnails

This commit is contained in:
NG (Graham)
2025-12-13 16:10:45 -05:00
parent aedec62b8d
commit f6f6e1f127
17 changed files with 96 additions and 36 deletions

View File

@@ -15,11 +15,15 @@ async fn do_handling(params: ParameterTable<()>, user: &crate::UserTy, factory:
let upload_info = crate::data::crf::UploadData::from_transmissibles(version.string, data)?;
let user_info = user.user()?;
let prepared = user_info.prepare_factory_upload(upload_info.into_core()).await?;
let success = factory.upload(prepared).await.map_err(|e| {
let result = factory.upload(prepared).await.map_err(|e| {
log::error!("Failed to upload to factory: {}", e);
oj_rc_core::data::error_codes::WebServicesError::UnexpectedError as i16
})?;
params.insert(SUCCESS_PARAM_KEY, Typed::Bool(success));
if result.needs_upload {
user_info.save_factory_thumbnail(result.id, result.thumbnail).await?;
}
params.insert(SUCCESS_PARAM_KEY, Typed::Bool(true));
}
}
Ok(params.into())

View File

@@ -220,5 +220,6 @@ pub fn handler(init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy>
.add(garage_slot_copy::garage_slot_copy_provider())
.add(polariton_server::operations::Ack::<12, _>::default()) // TODO handle UpdatePlayerDailyQuestProgressRequest instead of ignoring it
.add(polariton_server::operations::Ack::<90, _>::default()) // TODO handle SubmitCRFRatingRequest instead of ignoring it
//.add(polariton_server::operations::Ack::<97, _>::default()) // TODO handle UpdateShopRobotOffsetRequest instead of ignoring it (this seems to break newly-uploaded vehicles for now)
.add(steam_promo::steam_promos_provider())
}