mirror of
https://github.com/lcdr/lu_packets.git
synced 2026-05-12 13:48:26 -05:00
Add support for module assembly component
This commit is contained in:
@@ -19,6 +19,7 @@ use lu_packets::{
|
||||
inventory::{InventoryConstruction, InventorySerialization},
|
||||
item::{ItemConstruction, ItemSerialization},
|
||||
level_progression::{LevelProgressionConstruction, LevelProgressionSerialization},
|
||||
module_assembly::ModuleAssemblyConstruction,
|
||||
moving_platform::{MovingPlatformConstruction, MovingPlatformSerialization},
|
||||
mutable_model_behavior::{MutableModelBehaviorConstruction, MutableModelBehaviorSerialization},
|
||||
phantom_physics::{PhantomPhysicsConstruction, PhantomPhysicsSerialization},
|
||||
@@ -134,6 +135,7 @@ impl ZipContext<'_> {
|
||||
48 => { constrs.push(|x| Ok(Box::new(QuickbuildConstruction::deserialize(x)?))); }
|
||||
49 => { constrs.push(|x| Ok(Box::new(SwitchConstruction::deserialize(x)?))); }
|
||||
60 => { constrs.push(|x| Ok(Box::new(BaseCombatAiConstruction::deserialize(x)?))); }
|
||||
61 => { constrs.push(|x| Ok(Box::new(ModuleAssemblyConstruction::deserialize(x)?))); }
|
||||
98 => { constrs.push(|x| Ok(Box::new(BuffConstruction::deserialize(x)?))); }
|
||||
100 => { constrs.push(|x| Ok(Box::new(DonationVendorConstruction::deserialize(x)?))); }
|
||||
106 => { constrs.push(|x| Ok(Box::new(PlayerForcedMovementConstruction::deserialize(x)?))); }
|
||||
|
||||
@@ -12,6 +12,7 @@ pub mod inventory;
|
||||
pub mod item;
|
||||
pub mod level_progression;
|
||||
pub mod mutable_model_behavior;
|
||||
pub mod module_assembly;
|
||||
pub mod moving_platform;
|
||||
pub mod phantom_physics;
|
||||
pub mod player_forced_movement;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
use std::io::Result as Res;
|
||||
|
||||
use endio::Serialize;
|
||||
use endio_bit::BEBitWriter;
|
||||
use lu_packets_derive::{BitVariantTests, ReplicaSerde};
|
||||
|
||||
use crate::common::{LuVarWString, ObjId};
|
||||
use super::{ComponentConstruction, ComponentSerialization};
|
||||
|
||||
#[derive(Debug, PartialEq, ReplicaSerde)]
|
||||
pub struct ModuleAssemblyInfo {
|
||||
pub assembly_id: Option<ObjId>,
|
||||
pub use_optional_parts: bool,
|
||||
pub blob: LuVarWString<u16>,
|
||||
}
|
||||
|
||||
#[derive(BitVariantTests, Debug, PartialEq, ReplicaSerde)]
|
||||
pub struct ModuleAssemblyConstruction {
|
||||
pub module_assembly_info: Option<ModuleAssemblyInfo>,
|
||||
}
|
||||
|
||||
impl ComponentConstruction for ModuleAssemblyConstruction {
|
||||
fn ser(&self, writer: &mut BEBitWriter<Vec<u8>>) -> Res<()> {
|
||||
self.serialize(writer)
|
||||
}
|
||||
}
|
||||
|
||||
pub type ModuleAssemblySerialization = ModuleAssemblyConstruction;
|
||||
|
||||
impl ComponentSerialization for ModuleAssemblySerialization {
|
||||
fn ser(&self, writer: &mut BEBitWriter<Vec<u8>>) -> Res<()> {
|
||||
self.serialize(writer)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
ModuleAssemblyConstruction {
|
||||
module_assembly_info: Some(ModuleAssemblyInfo {
|
||||
assembly_id: Some(1152921507960010807),
|
||||
use_optional_parts: true,
|
||||
blob: lu!("blob"),
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user