mirror of
https://github.com/lcdr/lu_packets.git
synced 2026-01-06 00:50:29 -06:00
Add support for level progression serialization
This commit is contained in:
@@ -17,7 +17,7 @@ use lu_packets::{
|
||||
destroyable::{DestroyableConstruction, DestroyableSerialization},
|
||||
fx::FxConstruction,
|
||||
inventory::InventoryConstruction,
|
||||
level_progression::LevelProgressionConstruction,
|
||||
level_progression::{LevelProgressionConstruction, LevelProgressionSerialization},
|
||||
player_forced_movement::PlayerForcedMovementConstruction,
|
||||
possession_control::{PossessionControlConstruction, PossessionControlSerialization},
|
||||
skill::SkillConstruction,
|
||||
@@ -77,6 +77,7 @@ impl ReplicaContext for PlayerContext<'_> {
|
||||
|x| Ok(Box::new(ControllablePhysicsSerialization::deserialize(x)?)),
|
||||
|x| Ok(Box::new(DestroyableSerialization::deserialize(x)?)),
|
||||
|x| Ok(Box::new(PossessionControlSerialization::deserialize(x)?)),
|
||||
|x| Ok(Box::new(LevelProgressionSerialization::deserialize(x)?)),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use endio::Serialize;
|
||||
use endio_bit::BEBitWriter;
|
||||
use lu_packets_derive::{BitVariantTests, ReplicaSerde};
|
||||
|
||||
use super::ComponentConstruction;
|
||||
use super::{ComponentConstruction, ComponentSerialization};
|
||||
|
||||
#[derive(BitVariantTests, Debug, PartialEq, ReplicaSerde)]
|
||||
pub struct LevelProgressionConstruction {
|
||||
@@ -16,3 +16,11 @@ impl ComponentConstruction for LevelProgressionConstruction {
|
||||
self.serialize(writer)
|
||||
}
|
||||
}
|
||||
|
||||
pub type LevelProgressionSerialization = LevelProgressionConstruction;
|
||||
|
||||
impl ComponentSerialization for LevelProgressionSerialization {
|
||||
fn ser(&self, writer: &mut BEBitWriter<Vec<u8>>) -> Res<()> {
|
||||
self.serialize(writer)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user