summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/src/packets.rs10
-rw-r--r--shared/src/respack.rs2
2 files changed, 12 insertions, 0 deletions
diff --git a/shared/src/packets.rs b/shared/src/packets.rs
index f44a953..11b5f8a 100644
--- a/shared/src/packets.rs
+++ b/shared/src/packets.rs
@@ -41,6 +41,16 @@ impl<T> Hash for Resource<T> {
self.0.hash(state);
}
}
+impl<T> PartialOrd for Resource<T> {
+ fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
+ Some(self.cmp(other))
+ }
+}
+impl<T> Ord for Resource<T> {
+ fn cmp(&self, other: &Self) -> std::cmp::Ordering {
+ self.0.cmp(&other.0)
+ }
+}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Object(pub u128);
diff --git a/shared/src/respack.rs b/shared/src/respack.rs
index dee0cd0..e724fd5 100644
--- a/shared/src/respack.rs
+++ b/shared/src/respack.rs
@@ -31,6 +31,7 @@ pub fn save_respack(
resources: &[Resource],
entry: Option<Resource<RespackEntry>>,
) -> Result<()> {
+ info!("begin save");
output.write_all(MAGIC)?;
output.write_all(&entry.map(|e| e.0).unwrap_or([0u8; 32]))?;
output.write_all(&u64::to_be_bytes(resources.len() as u64))?;
@@ -47,6 +48,7 @@ pub fn save_respack(
for r in resources {
output.write_all(&store.get_raw(*r)?.unwrap())?;
}
+ info!("end save");
Ok(())
}