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:
@@ -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())
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user