mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Switch factory trait over to i32 IDs
This commit is contained in:
@@ -6,7 +6,7 @@ pub enum Factory {
|
||||
|
||||
#[async_trait::async_trait]
|
||||
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>> {
|
||||
async fn vehicle(&self, id: i32) -> 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,
|
||||
|
||||
@@ -311,7 +311,7 @@ pub struct VehicleInfo {
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum VehicleDescriptor {
|
||||
Factory {
|
||||
factory: u32,
|
||||
factory: i32,
|
||||
},
|
||||
Database {
|
||||
garage: i32,
|
||||
|
||||
@@ -200,7 +200,7 @@ impl PrefabVehicle {
|
||||
pub enum PrefabId {
|
||||
Factory {
|
||||
#[serde(alias="crf")]
|
||||
factory: u32,
|
||||
factory: i32,
|
||||
},
|
||||
Database {
|
||||
garage: i32,
|
||||
|
||||
@@ -451,7 +451,7 @@ impl UserData {
|
||||
Ok(Some(factory_vehicle)) => {
|
||||
let uuid_i64 = crate::persist::user::uuid_sanitize(
|
||||
standard_uuid_uniqueness
|
||||
^ crate::persist::user::i64_join((1 << 30, *factory_id))
|
||||
^ crate::persist::user::i64_join((1 << 30, *factory_id as u32))
|
||||
);
|
||||
let uuid_str = crate::persist::user::i64_as_uuid_str(uuid_i64);
|
||||
let weapons_guess = weapon_order.guess_weapons(&mut std::io::Cursor::new(&factory_vehicle.0.cube_data));
|
||||
|
||||
Reference in New Issue
Block a user