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

Prefix all crates with oj_ and use release version of dependencies

This commit is contained in:
NG (Graham)
2025-06-03 21:09:03 -04:00
parent d0c2b1ec03
commit f678426e10
85 changed files with 773 additions and 763 deletions

View File

@@ -1,12 +1,12 @@
pub enum Factory {
Arc(rc_factory::arc::ArcAdapter),
Custom(Box<dyn rc_factory::VehicleFactoryAdapter + Send + Sync + 'static>),
Arc(oj_rc_factory::arc::ArcAdapter),
Custom(Box<dyn oj_rc_factory::VehicleFactoryAdapter + Send + Sync + 'static>),
None,
}
#[async_trait::async_trait]
impl rc_factory::VehicleFactoryAdapter for Factory {
async fn vehicle(&self, id: u32) -> Result<Option<(rc_factory::VehicleInfo, rc_factory::VehicleQueryInfo)>, Box<dyn std::error::Error>> {
impl oj_rc_factory::VehicleFactoryAdapter for Factory {
async fn vehicle(&self, id: u32) -> Result<Option<(oj_rc_factory::VehicleInfo, oj_rc_factory::VehicleQueryInfo)>, Box<dyn std::error::Error>> {
match self {
Self::Arc(x) => x.vehicle(id).await,
Self::Custom(x) => x.vehicle(id).await,
@@ -14,7 +14,7 @@ impl rc_factory::VehicleFactoryAdapter for Factory {
}
}
async fn list(&self, query: libfj::robocraft::ListQuery) -> Result<Vec<rc_factory::VehicleQueryInfo>, Box<dyn std::error::Error>> {
async fn list(&self, query: libfj::robocraft::ListQuery) -> Result<Vec<oj_rc_factory::VehicleQueryInfo>, Box<dyn std::error::Error>> {
match self {
Self::Arc(x) => x.list(query).await,
Self::Custom(x) => x.list(query).await,
@@ -22,7 +22,7 @@ impl rc_factory::VehicleFactoryAdapter for Factory {
}
}
async fn upload(&self, vehicle: rc_factory::VehicleUploadInfo) -> Result<bool, Box<dyn std::error::Error>> {
async fn upload(&self, vehicle: oj_rc_factory::VehicleUploadInfo) -> Result<bool, Box<dyn std::error::Error>> {
match self {
Self::Arc(x) => x.upload(vehicle).await,
Self::Custom(x) => x.upload(vehicle).await,
@@ -34,7 +34,7 @@ impl rc_factory::VehicleFactoryAdapter for Factory {
impl Factory {
pub async fn from_config(conf: &crate::persist::FactoryConfig) -> Result<Self, Box<dyn std::error::Error + 'static>> {
Ok(match &conf.adapter {
crate::persist::AdapterSettings::Arc(x) => Self::Arc(rc_factory::arc::ArcAdapter::init(&x.uri, x.show_expired, x.override_cdn.clone()).await?),
crate::persist::AdapterSettings::Arc(x) => Self::Arc(oj_rc_factory::arc::ArcAdapter::init(&x.uri, x.show_expired, x.override_cdn.clone()).await?),
crate::persist::AdapterSettings::None => Self::None,
})
}