diff --git a/Cargo.lock b/Cargo.lock index dec520e93..04fd01215 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1114,18 +1114,18 @@ dependencies = [ [[package]] name = "rbx_binary" version = "0.1.0" -source = "git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad#8442d57a7a21072a380134962724281d044c65ad" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lz4 1.23.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rbx_tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad)", + "rbx_tree 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rbx_tree" version = "0.1.0" -source = "git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad#8442d57a7a21072a380134962724281d044c65ad" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1135,10 +1135,10 @@ dependencies = [ [[package]] name = "rbx_xml" version = "0.1.0" -source = "git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad#8442d57a7a21072a380134962724281d044c65ad" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rbx_tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad)", + "rbx_tree 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1233,9 +1233,9 @@ dependencies = [ "maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "notify 4.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rbx_binary 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad)", - "rbx_tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad)", - "rbx_xml 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad)", + "rbx_binary 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rbx_tree 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rbx_xml 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)", "rouille 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1983,9 +1983,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand_os 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f46fbd5550acf75b0c2730f5dd1873751daf9beb8f11b44027778fae50d7feca" "checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"checksum rbx_binary 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad)" = "" -"checksum rbx_tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad)" = "" -"checksum rbx_xml 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git?rev=8442d57a7a21072a380134962724281d044c65ad)" = "" +"checksum rbx_binary 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "646399297679f409cdc669b1b7b38a4f31cf97f1f5b6b2d56b5f03eaed8fa468" +"checksum rbx_tree 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea5723859bf48caa1ae9fdb94dbd24dd436d17543147081fca2862446bcaaec7" +"checksum rbx_xml 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdc27210e7e234f5af5af22f55c280a07fcc12566c37446d5b4fd0ae39ddea78" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)" = "52ee9a534dc1301776eff45b4fa92d2c39b1d8c3d3357e6eb593e0d795506fc2" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" diff --git a/server/Cargo.toml b/server/Cargo.toml index ac3cf933e..b4c4aa224 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -35,9 +35,9 @@ serde = "1.0" serde_derive = "1.0" serde_json = "1.0" uuid = { version = "0.7", features = ["v4", "serde"] } -rbx_tree = { rev = "8442d57a7a21072a380134962724281d044c65ad", git = "https://github.com/LPGhatguy/rbx-tree.git" } -rbx_xml = { rev = "8442d57a7a21072a380134962724281d044c65ad", git = "https://github.com/LPGhatguy/rbx-tree.git" } -rbx_binary = { rev = "8442d57a7a21072a380134962724281d044c65ad", git = "https://github.com/LPGhatguy/rbx-tree.git" } +rbx_tree = "0.1.0" +rbx_xml = "0.1.0" +rbx_binary = "0.1.0" [dev-dependencies] tempfile = "3.0" diff --git a/server/src/commands/build.rs b/server/src/commands/build.rs index 90a5981ce..f488fae4f 100644 --- a/server/src/commands/build.rs +++ b/server/src/commands/build.rs @@ -52,6 +52,9 @@ pub enum BuildError { #[fail(display = "XML model file error")] XmlModelEncodeError(rbx_xml::EncodeError), + + #[fail(display = "Binary model file error")] + BinaryModelEncodeError(rbx_binary::EncodeError) } impl From for BuildError { @@ -72,6 +75,12 @@ impl From for BuildError { } } +impl From for BuildError { + fn from(error: rbx_binary::EncodeError) -> BuildError { + BuildError::BinaryModelEncodeError(error) + } +} + pub fn build(options: &BuildOptions) -> Result<(), BuildError> { let output_kind = options.output_kind .or_else(|| detect_output_kind(options)) diff --git a/server/src/rbx_session.rs b/server/src/rbx_session.rs index 071ced150..c8266c556 100644 --- a/server/src/rbx_session.rs +++ b/server/src/rbx_session.rs @@ -9,7 +9,7 @@ use std::{ use failure::Fail; -use rbx_tree::{RbxTree, RbxInstance, RbxValue, RbxId}; +use rbx_tree::{RbxTree, RbxInstanceProperties, RbxValue, RbxId}; use crate::{ project::{Project, ProjectNode, InstanceProjectNodeMetadata}, @@ -346,7 +346,7 @@ fn snapshot_xml_model<'a>( instance_name: Cow<'a, str>, file: &ImfsFile, ) -> Result>, SnapshotError> { - let mut temp_tree = RbxTree::new(RbxInstance { + let mut temp_tree = RbxTree::new(RbxInstanceProperties { name: "Temp".to_owned(), class_name: "Folder".to_owned(), properties: HashMap::new(), @@ -377,7 +377,7 @@ fn snapshot_binary_model<'a>( instance_name: Cow<'a, str>, file: &ImfsFile, ) -> Result>, SnapshotError> { - let mut temp_tree = RbxTree::new(RbxInstance { + let mut temp_tree = RbxTree::new(RbxInstanceProperties { name: "Temp".to_owned(), class_name: "Folder".to_owned(), properties: HashMap::new(), diff --git a/server/src/rbx_snapshot.rs b/server/src/rbx_snapshot.rs index 4ffac64ae..6d8387b19 100644 --- a/server/src/rbx_snapshot.rs +++ b/server/src/rbx_snapshot.rs @@ -6,7 +6,7 @@ use std::{ path::PathBuf, }; -use rbx_tree::{RbxTree, RbxId, RbxInstance, RbxValue}; +use rbx_tree::{RbxTree, RbxId, RbxInstanceProperties, RbxValue}; use crate::{ path_map::PathMap, @@ -159,14 +159,14 @@ pub fn reconcile_subtree( reconcile_instance_children(tree, id, snapshot, path_map, instance_metadata_map, changes); } -fn reify_core(snapshot: &RbxSnapshotInstance) -> RbxInstance { +fn reify_core(snapshot: &RbxSnapshotInstance) -> RbxInstanceProperties { let mut properties = HashMap::new(); for (key, value) in &snapshot.properties { properties.insert(key.clone(), value.clone()); } - let instance = RbxInstance { + let instance = RbxInstanceProperties { name: snapshot.name.to_string(), class_name: snapshot.class_name.to_string(), properties, @@ -175,7 +175,7 @@ fn reify_core(snapshot: &RbxSnapshotInstance) -> RbxInstance { instance } -fn reconcile_instance_properties(instance: &mut RbxInstance, snapshot: &RbxSnapshotInstance) -> bool { +fn reconcile_instance_properties(instance: &mut RbxInstanceProperties, snapshot: &RbxSnapshotInstance) -> bool { let mut has_diffs = false; if instance.name != snapshot.name { diff --git a/server/src/web.rs b/server/src/web.rs index e02ae511b..6700531a4 100644 --- a/server/src/web.rs +++ b/server/src/web.rs @@ -10,7 +10,7 @@ use rouille::{ Request, Response, }; -use rbx_tree::{RbxId, RootedRbxInstance}; +use rbx_tree::{RbxId, RbxInstance}; use crate::{ session::Session, @@ -28,7 +28,7 @@ use crate::{ #[derive(Debug, Serialize, Deserialize)] pub struct InstanceWithMetadata<'a> { #[serde(flatten)] - pub instance: Cow<'a, RootedRbxInstance>, + pub instance: Cow<'a, RbxInstance>, #[serde(rename = "Metadata")] pub metadata: Option>,