From 495701d88651bb69683d21522276cfcc6dbb3361 Mon Sep 17 00:00:00 2001 From: "NG (Graham)" Date: Thu, 1 Jan 2026 21:25:24 -0500 Subject: [PATCH] Re-add a good way to disable factory uploading --- assets/robocraft/config.json | 2 +- rc_factory/src/arc/adapter.rs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/assets/robocraft/config.json b/assets/robocraft/config.json index 86d5484..9054b9d 100644 --- a/assets/robocraft/config.json +++ b/assets/robocraft/config.json @@ -14539,7 +14539,7 @@ "factory": { "adapter": { "variant": "Arc", - "uri": "sqlite:../data/robocraft/rc_archive.db?mode=rw" + "uri": "sqlite:../data/robocraft/rc_archive.db?mode=ro" } }, "shop": {}, diff --git a/rc_factory/src/arc/adapter.rs b/rc_factory/src/arc/adapter.rs index a54e0dc..566acda 100644 --- a/rc_factory/src/arc/adapter.rs +++ b/rc_factory/src/arc/adapter.rs @@ -8,6 +8,7 @@ pub struct ArcAdapter { cdn: String, override_cdn: bool, spoof_users: bool, + is_readonly: bool, } impl ArcAdapter { @@ -21,6 +22,7 @@ impl ArcAdapter { cdn: cdn.to_owned(), override_cdn, spoof_users: username_spoofing, + is_readonly: uri.ends_with("?mode=ro") }; // do query to ensure database is ok adapter.default_query().one(&adapter.orm).await?; @@ -184,6 +186,13 @@ impl crate::VehicleFactoryAdapter for ArcAdapter { } async fn upload(&self, vehicle: crate::VehicleUploadInfo) -> Result> { + if self.is_readonly { + return Ok(crate::VehicleThumbnailInfo { + id: 0, + thumbnail: Vec::default(), + needs_upload: false, + }) + } let transaction = self.orm.begin().await?; let cube_amounts = {