From 38d1ff62abed0ab0f1f47ffb0417a83f1d27164a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 5 Sep 2023 03:41:37 -0400 Subject: [PATCH 001/125] Initial commit --- LICENSE | 9 +++++++++ README.md | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..2071b23b --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..dc0184d2 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# map-tool + From 9e482891ba1531c8822bdfe1bc78b8e1bc2f8ed8 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 4 Sep 2023 12:24:00 -0700 Subject: [PATCH 002/125] Initial commit --- .gitignore | 1 + Cargo.lock | 424 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 9 ++ src/main.rs | 3 + 4 files changed, 437 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..ea8c4bf7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..c79c66e7 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,424 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake3" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "profiling" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45f10e75d83c7aec79a6aa46f897075890e156b105eebe51cfa0abce51af025f" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74c55e9e629af5298a40e0fa106435b2da30484c4ec76b41d19bc4d00dd8b903" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rbx_binary" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e50573021d04b680018955662eba7dc4aac3de92219231798f6c9b41e38ab01" +dependencies = [ + "log", + "lz4", + "profiling", + "rbx_dom_weak", + "rbx_reflection", + "rbx_reflection_database", + "thiserror", +] + +[[package]] +name = "rbx_dom_weak" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161729449bbb0cfa657ce7bcca6a160d0af06d8b8d9efdc9abe14735dccacdb9" +dependencies = [ + "rbx_types", + "serde", +] + +[[package]] +name = "rbx_reflection" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bd48487192046fec8f805f3fa29f3d7d5beb9890b0859b1a92bd8aff580343" +dependencies = [ + "rbx_types", + "serde", + "thiserror", +] + +[[package]] +name = "rbx_reflection_database" +version = "0.2.7+roblox-588" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1be6cf674182806f11ad4899dd1feafe977591f1ae035ae05a58d4b74e487276" +dependencies = [ + "lazy_static", + "rbx_reflection", + "rmp-serde", + "serde", +] + +[[package]] +name = "rbx_types" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "070106e926b8ae54c7bc443e5db4d868d7f0af51c1d7cfd7efe1364c1753d8a3" +dependencies = [ + "base64", + "bitflags", + "blake3", + "lazy_static", + "rand", + "serde", + "thiserror", +] + +[[package]] +name = "rmp" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "strafesnet-scanner" +version = "0.1.0" +dependencies = [ + "rbx_binary", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "2.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..0117d13f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "strafesnet-scanner" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rbx_binary = "0.7.1" diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 00000000..e7a11a96 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} From 4c1632c0b65143c9a67a18529eb45f163f24119c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 4 Sep 2023 17:16:02 -0700 Subject: [PATCH 003/125] v1 POC (proof of concept) --- Cargo.lock | 2 ++ Cargo.toml | 2 ++ src/main.rs | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c79c66e7..2bc06124 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -360,6 +360,8 @@ name = "strafesnet-scanner" version = "0.1.0" dependencies = [ "rbx_binary", + "rbx_dom_weak", + "rbx_reflection_database", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0117d13f..dca4fad2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,5 @@ edition = "2021" [dependencies] rbx_binary = "0.7.1" +rbx_dom_weak = "2.5.0" +rbx_reflection_database = "0.2.7" diff --git a/src/main.rs b/src/main.rs index e7a11a96..34c88a57 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,64 @@ -fn main() { - println!("Hello, world!"); +fn class_is_a(class: &str, superclass: &str) -> bool { + if class==superclass { + return true + } + let class_descriptor=rbx_reflection_database::get().classes.get(class); + if let Some(descriptor) = &class_descriptor { + if let Some(class_super) = &descriptor.superclass { + return class_is_a(&class_super, superclass) + } + } + return false +} + +fn recursive_collect_scripts(scripts: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance){ + for &referent in instance.children() { + let c = dom.get_by_ref(referent).unwrap(); + if class_is_a(c.class.as_str(), "LuaSourceContainer") { + if let Some(rbx_dom_weak::types::Variant::String(s)) = c.properties.get("Source") { + scripts.push(s.clone()); + } + } + recursive_collect_scripts(scripts,dom,c); + } +} + +fn main() -> Result<(), Box> { + // Using buffered I/O is recommended with rbx_binary + let input = std::io::BufReader::new(std::fs::File::open("map.rbxm")?); + + let dom = rbx_binary::from_reader(input)?; + + //Construct allowed scripts + let mut allowed = std::collections::HashSet::::new(); + for entry in std::fs::read_dir("allowed")? { + allowed.insert(std::fs::read_to_string(entry?.path())?); + } + + let mut scripts = std::vec::Vec::::new(); + recursive_collect_scripts(&mut scripts, &dom, dom.root()); + + //check scribb + let mut any_failed=false; + for (i,script) in scripts.iter().enumerate() { + if allowed.contains(script) { + println!("pass"); + }else{ + println!("fail"); + any_failed=true; + std::fs::write(format!("blocked/{}.lua",i),script)?; + } + } + if any_failed { + println!("One or more scripts are not allowed."); + return Ok(())//everything is not ok but idk how to return an error LMAO + } + println!("All scripts passed!"); + // std::process::Command::new("rbxcompiler") + // .arg("--compile=false") + // .arg("--group=6980477") + // .arg("--asset=5692139100") + // .arg("--input=map.rbxm") + // .spawn()?; + Ok(()) } From df24bc9945a8a5bf429d6fb2c4c5609975ba5f3c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 4 Sep 2023 17:34:31 -0700 Subject: [PATCH 004/125] collect referent instead of Source --- src/main.rs | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index 34c88a57..65d54bad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,15 +11,14 @@ fn class_is_a(class: &str, superclass: &str) -> bool { return false } -fn recursive_collect_scripts(scripts: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance){ +fn recursive_collect_scripts(scripts: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance){ for &referent in instance.children() { - let c = dom.get_by_ref(referent).unwrap(); - if class_is_a(c.class.as_str(), "LuaSourceContainer") { - if let Some(rbx_dom_weak::types::Variant::String(s)) = c.properties.get("Source") { - scripts.push(s.clone()); + if let Some(c) = dom.get_by_ref(referent) { + if class_is_a(c.class.as_str(), "LuaSourceContainer") { + scripts.push(c.referent());//copy ref } + recursive_collect_scripts(scripts,dom,c); } - recursive_collect_scripts(scripts,dom,c); } } @@ -35,18 +34,28 @@ fn main() -> Result<(), Box> { allowed.insert(std::fs::read_to_string(entry?.path())?); } - let mut scripts = std::vec::Vec::::new(); + let mut scripts = std::vec::Vec::::new(); recursive_collect_scripts(&mut scripts, &dom, dom.root()); //check scribb let mut any_failed=false; - for (i,script) in scripts.iter().enumerate() { - if allowed.contains(script) { - println!("pass"); + for (i,&referent) in scripts.iter().enumerate() { + if let Some(script) = dom.get_by_ref(referent) { + if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { + if allowed.contains(s) { + println!("pass"); + }else{ + println!("fail"); + any_failed=true; + std::fs::write(format!("blocked/{}.lua",i),s)?; + } + }else{ + println!("failed to get source"); + any_failed=true; + } }else{ - println!("fail"); + println!("failed to deref script"); any_failed=true; - std::fs::write(format!("blocked/{}.lua",i),script)?; } } if any_failed { From 206bb01c1a0526ba1f979f8e24e27d5a5ffb539e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 5 Sep 2023 00:40:39 -0700 Subject: [PATCH 005/125] rename to map-tool --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2bc06124..b9bdd8ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,6 +162,15 @@ dependencies = [ "libc", ] +[[package]] +name = "map-tool" +version = "0.1.0" +dependencies = [ + "rbx_binary", + "rbx_dom_weak", + "rbx_reflection_database", +] + [[package]] name = "num-traits" version = "0.2.16" @@ -355,15 +364,6 @@ dependencies = [ "syn", ] -[[package]] -name = "strafesnet-scanner" -version = "0.1.0" -dependencies = [ - "rbx_binary", - "rbx_dom_weak", - "rbx_reflection_database", -] - [[package]] name = "subtle" version = "2.5.0" diff --git a/Cargo.toml b/Cargo.toml index dca4fad2..5accf441 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "strafesnet-scanner" +name = "map-tool" version = "0.1.0" edition = "2021" From 3f15d2f5a863d83e878d17f6862bfe2458522a70 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 18:16:45 -0700 Subject: [PATCH 006/125] delete recursive function --- src/main.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index 65d54bad..93ac7c09 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,15 +11,16 @@ fn class_is_a(class: &str, superclass: &str) -> bool { return false } -fn recursive_collect_scripts(scripts: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance){ - for &referent in instance.children() { - if let Some(c) = dom.get_by_ref(referent) { - if class_is_a(c.class.as_str(), "LuaSourceContainer") { - scripts.push(c.referent());//copy ref - } - recursive_collect_scripts(scripts,dom,c); +fn get_scripts(dom:rbx_dom_weak::WeakDom) -> Vec{ + let mut scripts = std::vec::Vec::::new(); + + let (_,mut instances) = dom.into_raw(); + for (_,instance) in instances.drain() { + if class_is_a(instance.class.as_str(), "LuaSourceContainer") { + scripts.push(instance); } } + scripts } fn main() -> Result<(), Box> { @@ -34,13 +35,13 @@ fn main() -> Result<(), Box> { allowed.insert(std::fs::read_to_string(entry?.path())?); } - let mut scripts = std::vec::Vec::::new(); - recursive_collect_scripts(&mut scripts, &dom, dom.root()); - //check scribb - let mut any_failed=false; - for (i,&referent) in scripts.iter().enumerate() { - if let Some(script) = dom.get_by_ref(referent) { + + let scripts = get_scripts(dom); + + //check scribb + let mut any_failed=false; + for script in scripts.iter() { if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { if allowed.contains(s) { println!("pass"); From 553ad2cca535d1953e325679ec1b51d3e6e23e30 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 18:17:03 -0700 Subject: [PATCH 007/125] add clap dep --- Cargo.lock | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + 2 files changed, 180 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index b9bdd8ff..2f133c07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,54 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "anstream" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +dependencies = [ + "anstyle", + "windows-sys", +] + [[package]] name = "arrayref" version = "0.3.7" @@ -76,6 +124,52 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clap" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "constant_time_eq" version = "0.3.0" @@ -124,6 +218,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "lazy_static" version = "1.4.0" @@ -166,6 +266,7 @@ dependencies = [ name = "map-tool" version = "0.1.0" dependencies = [ + "clap", "rbx_binary", "rbx_dom_weak", "rbx_reflection_database", @@ -364,6 +465,12 @@ dependencies = [ "syn", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "subtle" version = "2.5.0" @@ -413,6 +520,12 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "version_check" version = "0.9.4" @@ -424,3 +537,69 @@ name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" diff --git a/Cargo.toml b/Cargo.toml index 5accf441..f48b7322 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +clap = { version = "4.4.2", features = ["derive"] } rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" From 4334a6f330379848df25b266f372dde5e82c48bf Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 18:16:25 -0700 Subject: [PATCH 008/125] v2 with clap --- src/main.rs | 159 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 141 insertions(+), 18 deletions(-) diff --git a/src/main.rs b/src/main.rs index 93ac7c09..c76ddf61 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,28 @@ +use std::unimplemented; + +use clap::{Args, Parser, Subcommand}; + +#[derive(Parser)] +#[command(author, version, about, long_about = None)] +#[command(propagate_version = true)] +struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + Download(MapList), + Scan, + Replace, + Upload, +} + +#[derive(Args)] +struct MapList { + maps: Vec, +} + fn class_is_a(class: &str, superclass: &str) -> bool { if class==superclass { return true @@ -11,6 +36,19 @@ fn class_is_a(class: &str, superclass: &str) -> bool { return false } +//download + //download list of maps to maps/unprocessed +//scan (scripts) + //iter maps/unprocessed + //passing moves to maps/verified + //failing moves to maps/purgatory +//replace (edits & deletions) + //iter maps/purgatory + //replace scripts and put in maps/unprocessed +//upload + //iter maps/verified + //interactively print DisplayName/Creator and ask for target upload ids + fn get_scripts(dom:rbx_dom_weak::WeakDom) -> Vec{ let mut scripts = std::vec::Vec::::new(); @@ -23,19 +61,33 @@ fn get_scripts(dom:rbx_dom_weak::WeakDom) -> Vec{ scripts } -fn main() -> Result<(), Box> { - // Using buffered I/O is recommended with rbx_binary - let input = std::io::BufReader::new(std::fs::File::open("map.rbxm")?); - - let dom = rbx_binary::from_reader(input)?; - +fn download(map_list: Vec) -> Result<(), Box>{ + unimplemented!() +} +fn scan() -> Result<(), Box>{ + let mut id = 0u32; + match std::fs::read_to_string("id"){ + Ok(id_file)=>id=id_file.parse::()?, + Err(e) => match e.kind() { + std::io::ErrorKind::NotFound => println!("id file does not exist: starting from 0"),//continue on, implicitly take on id=0, write the id file at the end + _ => return Err(e)?, + } + } //Construct allowed scripts - let mut allowed = std::collections::HashSet::::new(); - for entry in std::fs::read_dir("allowed")? { - allowed.insert(std::fs::read_to_string(entry?.path())?); + let mut allowed_set = std::collections::HashSet::::new(); + for entry in std::fs::read_dir("scripts/allowed")? { + allowed_set.insert(std::fs::read_to_string(entry?.path())?); + } + let mut blocked = std::collections::HashSet::::new(); + for entry in std::fs::read_dir("scripts/blocked")? { + blocked.insert(std::fs::read_to_string(entry?.path())?); } + for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let dom = rbx_binary::from_reader(input)?; let scripts = get_scripts(dom); @@ -43,32 +95,103 @@ fn main() -> Result<(), Box> { let mut any_failed=false; for script in scripts.iter() { if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { - if allowed.contains(s) { + if allowed_set.contains(s) { println!("pass"); + continue; }else{ println!("fail"); any_failed=true; - std::fs::write(format!("blocked/{}.lua",i),s)?; + if !blocked.contains(s) { + blocked.insert(s.clone());//all fixed! just clone! + std::fs::write(format!("scripts/blocked/{}.lua",id),s)?; + id+=1; + } } }else{ println!("failed to get source"); any_failed=true; } + } + if any_failed { + println!("One or more scripts are not allowed."); }else{ - println!("failed to deref script"); - any_failed=true; + let mut dest=std::path::PathBuf::from("maps/processed"); + dest.set_file_name(file_thing.file_name()); + dest.set_extension("rbxl");//extension is always rbxl even if source file is extensionless + std::fs::rename(file_thing.path(), dest)?; } } - if any_failed { - println!("One or more scripts are not allowed."); - return Ok(())//everything is not ok but idk how to return an error LMAO + std::fs::write("id",id.to_string())?; + Ok(()) +} +fn replace() -> Result<(), Box>{ + //Construct allowed scripts + let mut allowed_map = std::collections::HashMap::::new(); + for entry in std::fs::read_dir("scripts/allowed")? { + let entry=entry?; + allowed_map.insert(entry.file_name().to_str().unwrap().parse::()?,std::fs::read_to_string(entry.path())?); } - println!("All scripts passed!"); + let mut replace = std::collections::HashMap::::new(); + for entry in std::fs::read_dir("scripts/replace")? { + let entry=entry?; + replace.insert(std::fs::read_to_string(entry.path())?,entry.file_name().to_str().unwrap().parse::()?); + } + + for entry in std::fs::read_dir("maps/purgatory")? { + let file_thing=entry?; + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + + let dom = rbx_binary::from_reader(input)?; + + let mut write_dom = rbx_dom_weak::WeakDom::new(rbx_dom_weak::InstanceBuilder::empty()); + dom.clone_into_external(dom.root_ref(), &mut write_dom); + + let scripts = get_scripts(dom); + + //check scribb + let mut any_failed=false; + for script in scripts.iter() { + if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { + if let (Some(replace_id),Some(replace_script))=(replace.get(source),write_dom.get_by_ref_mut(script.referent())) { + println!("replace {}",replace_id); + //replace the source + if let Some(replace_source)=allowed_map.get(replace_id){ + replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); + }else{ + println!("failed to get replacement source {}",replace_id); + any_failed=true; + } + } + } + } + if any_failed { + println!("One or more scripts failed to replace."); + }else{ + let mut dest=std::path::PathBuf::from("maps/unprocessed"); + dest.set_file_name(file_thing.file_name()); + dest.set_extension("rbxl");//extension is always rbxl even if source file is extensionless + let output = std::io::BufWriter::new(std::fs::File::open(dest)?); + rbx_binary::to_writer(output, &write_dom, &[write_dom.root_ref()])?; + } + } + Ok(()) +} +fn upload() -> Result<(), Box>{ // std::process::Command::new("rbxcompiler") // .arg("--compile=false") // .arg("--group=6980477") // .arg("--asset=5692139100") // .arg("--input=map.rbxm") // .spawn()?; - Ok(()) + unimplemented!() +} + +fn main() -> Result<(), Box> { + let cli = Cli::parse(); + match cli.command { + Commands::Download(map_list)=>download(map_list.maps), + Commands::Scan=>scan(), + Commands::Replace=>replace(), + Commands::Upload=>upload(), + } } From 755e1d4d5bc7d7912d033928b929997bade26750 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Sep 2023 16:46:56 -0700 Subject: [PATCH 009/125] optimize release binary size --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index f48b7322..3427a0b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,8 @@ clap = { version = "4.4.2", features = ["derive"] } rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" + +[profile.release] +lto = true +strip = true +codegen-units = 1 From 694440bd29641223b929c310e74d930854df99f2 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Sep 2023 17:42:03 -0700 Subject: [PATCH 010/125] use wget to download maps --- src/main.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c76ddf61..23c504cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,7 +62,21 @@ fn get_scripts(dom:rbx_dom_weak::WeakDom) -> Vec{ } fn download(map_list: Vec) -> Result<(), Box>{ - unimplemented!() + let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); + let shared_args=&[ + "-q", + "--header", + header.as_str(), + "-O", + ]; + for map_id in map_list.iter() { + std::process::Command::new("wget") + .args(shared_args) + .arg(format!("maps/unprocessed/{}.rbxl",map_id)) + .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",map_id)) + .spawn()?; + } + Ok(()) } fn scan() -> Result<(), Box>{ let mut id = 0u32; From 7523c4313a4c4764fead3e8a55f835d044a6f96c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Sep 2023 19:18:55 -0700 Subject: [PATCH 011/125] scan enum, Source property missing if fatal --- src/main.rs | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index 23c504cf..d5395aa4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -78,6 +78,11 @@ fn download(map_list: Vec) -> Result<(), Box>{ } Ok(()) } + +enum Scan{ + Passed, + Blocked, +} fn scan() -> Result<(), Box>{ let mut id = 0u32; match std::fs::read_to_string("id"){ @@ -106,15 +111,15 @@ fn scan() -> Result<(), Box>{ let scripts = get_scripts(dom); //check scribb - let mut any_failed=false; + let mut fail_count=0; + let mut fail_type=Scan::Passed; for script in scripts.iter() { if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { if allowed_set.contains(s) { - println!("pass"); continue; }else{ - println!("fail"); - any_failed=true; + fail_type=Scan::Blocked;//no need to check for Flagged, it breaks the loop. + fail_count+=1; if !blocked.contains(s) { blocked.insert(s.clone());//all fixed! just clone! std::fs::write(format!("scripts/blocked/{}.lua",id),s)?; @@ -122,18 +127,18 @@ fn scan() -> Result<(), Box>{ } } }else{ - println!("failed to get source"); - any_failed=true; + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); } } - if any_failed { - println!("One or more scripts are not allowed."); - }else{ - let mut dest=std::path::PathBuf::from("maps/processed"); - dest.set_file_name(file_thing.file_name()); - dest.set_extension("rbxl");//extension is always rbxl even if source file is extensionless - std::fs::rename(file_thing.path(), dest)?; - } + let mut dest=match fail_type { + Scan::Passed => std::path::PathBuf::from("maps/processed"), + Scan::Blocked => { + println!("{:?} - {} {} not allowed.",file_thing.file_name(),fail_count,if fail_count==1 {"script"}else{"scripts"}); + std::path::PathBuf::from("maps/purgatory") + } + }; + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; } std::fs::write("id",id.to_string())?; Ok(()) From 593b6902fdc0ed2165988ec6059ee33c13116718 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Sep 2023 19:18:38 -0700 Subject: [PATCH 012/125] Scan::Flagged --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index d5395aa4..fba58ea4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -82,6 +82,7 @@ fn download(map_list: Vec) -> Result<(), Box>{ enum Scan{ Passed, Blocked, + Flagged, } fn scan() -> Result<(), Box>{ let mut id = 0u32; @@ -115,6 +116,12 @@ fn scan() -> Result<(), Box>{ let mut fail_type=Scan::Passed; for script in scripts.iter() { if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { + //flag keywords and instantly fail + if s.find("getfenv").is_some()||s.find("require").is_some(){ + println!("{:?} - flagged.",file_thing.file_name()); + fail_type=Scan::Flagged; + break; + } if allowed_set.contains(s) { continue; }else{ @@ -136,6 +143,7 @@ fn scan() -> Result<(), Box>{ println!("{:?} - {} {} not allowed.",file_thing.file_name(),fail_count,if fail_count==1 {"script"}else{"scripts"}); std::path::PathBuf::from("maps/purgatory") } + Scan::Flagged => std::path::PathBuf::from("maps/flagged") }; dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?; From 4ca3d56f0fe1c374bc32725945653abb09941bd4 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Sep 2023 19:18:44 -0700 Subject: [PATCH 013/125] upload comments --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index fba58ea4..c9ad47a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -204,6 +204,10 @@ fn replace() -> Result<(), Box>{ Ok(()) } fn upload() -> Result<(), Box>{ + //interactive prompt per upload: + //Creator: [auto fill creator] + //DisplayName: [auto fill DisplayName] + //id: ["New" for blank because of my double enter key] // std::process::Command::new("rbxcompiler") // .arg("--compile=false") // .arg("--group=6980477") From 41d8e700c59200d4700231bf84d1492ed9f98f76 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Sep 2023 19:37:37 -0700 Subject: [PATCH 014/125] Commands::Interactive --- src/main.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index c9ad47a6..00e9489a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,9 +13,10 @@ struct Cli { #[derive(Subcommand)] enum Commands { Download(MapList), + Upload, Scan, Replace, - Upload, + Interactive, } #[derive(Args)] @@ -48,6 +49,11 @@ fn class_is_a(class: &str, superclass: &str) -> bool { //upload //iter maps/verified //interactively print DisplayName/Creator and ask for target upload ids +//interactive + //iter maps/unprocessed + //for each unique script, load it into the file current.lua and have it open in sublime text + //I can edit the file and it will edit it in place + //I pass/fail(with comment)/allow each script fn get_scripts(dom:rbx_dom_weak::WeakDom) -> Vec{ let mut scripts = std::vec::Vec::::new(); @@ -217,12 +223,17 @@ fn upload() -> Result<(), Box>{ unimplemented!() } +fn interactive() -> Result<(), Box>{ + unimplemented!() +} + fn main() -> Result<(), Box> { let cli = Cli::parse(); match cli.command { Commands::Download(map_list)=>download(map_list.maps), + Commands::Upload=>upload(), Commands::Scan=>scan(), Commands::Replace=>replace(), - Commands::Upload=>upload(), + Commands::Interactive=>interactive(), } } From 7234065bd80b8aee9541ee28ad148e62b3f90446 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Sep 2023 19:53:42 -0700 Subject: [PATCH 015/125] fail better --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 00e9489a..c2f02437 100644 --- a/src/main.rs +++ b/src/main.rs @@ -194,7 +194,13 @@ fn replace() -> Result<(), Box>{ println!("failed to get replacement source {}",replace_id); any_failed=true; } + }else{ + println!("failed to failed to get replace_id and replace_script"); + any_failed=true; } + }else{ + println!("failed to failed to get source"); + any_failed=true; } } if any_failed { From 6ef8fd2f69c47a8b3ea776e3e649b9f585b3d855 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 13:57:47 -0700 Subject: [PATCH 016/125] get_full_name --- src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.rs b/src/main.rs index c2f02437..a8aa2862 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,6 +37,17 @@ fn class_is_a(class: &str, superclass: &str) -> bool { return false } +fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance) -> String{ + let mut full_name=instance.name.clone(); + let mut pref=instance.parent(); + while let Some(parent)=dom.get_by_ref(pref){ + full_name.insert(0, '.'); + full_name.insert_str(0, &parent.name); + pref=parent.parent(); + } + full_name +} + //download //download list of maps to maps/unprocessed //scan (scripts) From b434dce0f6f0cc2ac4a9a20726aed0767366a4b1 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 16:28:10 -0700 Subject: [PATCH 017/125] helper funcs --- src/main.rs | 84 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/src/main.rs b/src/main.rs index a8aa2862..aa86a6fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -78,6 +78,54 @@ fn get_scripts(dom:rbx_dom_weak::WeakDom) -> Vec{ scripts } +fn get_id() -> Result>{ + match std::fs::read_to_string("id"){ + Ok(id_file)=>Ok(id_file.parse::()?), + Err(e) => match e.kind() { + std::io::ErrorKind::NotFound => Ok(0),//implicitly take on id=0 + _ => Err(e)?, + } + } +} + +fn get_set_from_file(file:&str) -> Result, Box>{ + let mut set=std::collections::HashSet::::new(); + for entry in std::fs::read_dir(file)? { + set.insert(std::fs::read_to_string(entry?.path())?); + } + Ok(set) +} + +fn get_allowed_set() -> Result, Box>{ + get_set_from_file("scripts/allowed") +} + +fn get_blocked() -> Result, Box>{ + get_set_from_file("scripts/blocked") +} + +fn get_allowed_map() -> Result, Box>{ + let mut allowed_map = std::collections::HashMap::::new(); + for entry in std::fs::read_dir("scripts/allowed")? { + let entry=entry?; + allowed_map.insert(entry.file_name().to_str().unwrap().parse::()?,std::fs::read_to_string(entry.path())?); + } + Ok(allowed_map) +} + +fn get_replace_map() -> Result, Box>{ + let mut replace = std::collections::HashMap::::new(); + for entry in std::fs::read_dir("scripts/replace")? { + let entry=entry?; + replace.insert(std::fs::read_to_string(entry.path())?,entry.file_name().to_str().unwrap().parse::()?); + } + Ok(replace) +} + +fn check_source_illegal_keywords(source:&String)->bool{ + source.find("getfenv").is_some()||source.find("require").is_some() +} + fn download(map_list: Vec) -> Result<(), Box>{ let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); let shared_args=&[ @@ -102,23 +150,10 @@ enum Scan{ Flagged, } fn scan() -> Result<(), Box>{ - let mut id = 0u32; - match std::fs::read_to_string("id"){ - Ok(id_file)=>id=id_file.parse::()?, - Err(e) => match e.kind() { - std::io::ErrorKind::NotFound => println!("id file does not exist: starting from 0"),//continue on, implicitly take on id=0, write the id file at the end - _ => return Err(e)?, - } - } + let mut id = get_id()?; //Construct allowed scripts - let mut allowed_set = std::collections::HashSet::::new(); - for entry in std::fs::read_dir("scripts/allowed")? { - allowed_set.insert(std::fs::read_to_string(entry?.path())?); - } - let mut blocked = std::collections::HashSet::::new(); - for entry in std::fs::read_dir("scripts/blocked")? { - blocked.insert(std::fs::read_to_string(entry?.path())?); - } + let allowed_set = get_allowed_set()?; + let mut blocked = get_blocked()?; for entry in std::fs::read_dir("maps/unprocessed")? { let file_thing=entry?; @@ -134,7 +169,7 @@ fn scan() -> Result<(), Box>{ for script in scripts.iter() { if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { //flag keywords and instantly fail - if s.find("getfenv").is_some()||s.find("require").is_some(){ + if check_source_illegal_keywords(s){ println!("{:?} - flagged.",file_thing.file_name()); fail_type=Scan::Flagged; break; @@ -169,17 +204,8 @@ fn scan() -> Result<(), Box>{ Ok(()) } fn replace() -> Result<(), Box>{ - //Construct allowed scripts - let mut allowed_map = std::collections::HashMap::::new(); - for entry in std::fs::read_dir("scripts/allowed")? { - let entry=entry?; - allowed_map.insert(entry.file_name().to_str().unwrap().parse::()?,std::fs::read_to_string(entry.path())?); - } - let mut replace = std::collections::HashMap::::new(); - for entry in std::fs::read_dir("scripts/replace")? { - let entry=entry?; - replace.insert(std::fs::read_to_string(entry.path())?,entry.file_name().to_str().unwrap().parse::()?); - } + let allowed_map=get_allowed_map()?; + let replace_map=get_replace_map()?; for entry in std::fs::read_dir("maps/purgatory")? { let file_thing=entry?; @@ -196,7 +222,7 @@ fn replace() -> Result<(), Box>{ let mut any_failed=false; for script in scripts.iter() { if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { - if let (Some(replace_id),Some(replace_script))=(replace.get(source),write_dom.get_by_ref_mut(script.referent())) { + if let (Some(replace_id),Some(replace_script))=(replace_map.get(source),write_dom.get_by_ref_mut(script.referent())) { println!("replace {}",replace_id); //replace the source if let Some(replace_source)=allowed_map.get(replace_id){ From e0e8744bfd93eafce36784f1ccb6c5c6cb2692f1 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 16:41:24 -0700 Subject: [PATCH 018/125] interactive mode v1 --- src/main.rs | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 153 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index aa86a6fb..f7cbc723 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,9 +53,9 @@ fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance) -> //scan (scripts) //iter maps/unprocessed //passing moves to maps/verified - //failing moves to maps/purgatory + //failing moves to maps/blocked //replace (edits & deletions) - //iter maps/purgatory + //iter maps/blocked //replace scripts and put in maps/unprocessed //upload //iter maps/verified @@ -193,7 +193,7 @@ fn scan() -> Result<(), Box>{ Scan::Passed => std::path::PathBuf::from("maps/processed"), Scan::Blocked => { println!("{:?} - {} {} not allowed.",file_thing.file_name(),fail_count,if fail_count==1 {"script"}else{"scripts"}); - std::path::PathBuf::from("maps/purgatory") + std::path::PathBuf::from("maps/blocked") } Scan::Flagged => std::path::PathBuf::from("maps/flagged") }; @@ -207,7 +207,7 @@ fn replace() -> Result<(), Box>{ let allowed_map=get_allowed_map()?; let replace_map=get_replace_map()?; - for entry in std::fs::read_dir("maps/purgatory")? { + for entry in std::fs::read_dir("maps/blocked")? { let file_thing=entry?; let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); @@ -266,8 +266,156 @@ fn upload() -> Result<(), Box>{ unimplemented!() } +enum Interactive{ + Passed, + Blocked, + Flagged, + ReplaceFailed, +} +enum ScriptAction { + Pass, + Replace(u32), + Flag, + Block, +} +enum ScriptActionParseResult { + Pass, + Block, +} +struct ParseScriptActionErr; +impl std::str::FromStr for ScriptActionParseResult { + type Err=ParseScriptActionErr; + fn from_str(s: &str) -> Result{ + if s=="pass"||s=="1"{ + Ok(Self::Pass) + }else if s=="block"{ + Ok(Self::Block) + }else{ + Err(ParseScriptActionErr) + } + } +} + fn interactive() -> Result<(), Box>{ - unimplemented!() + let mut id=get_id()?; + //Construct allowed scripts + let mut allowed_set=get_allowed_set()?; + let mut allowed_map=get_allowed_map()?; + let mut replace_map=get_replace_map()?; + + for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + println!("processing map={:?}",file_thing.file_name()); + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + + let dom = rbx_binary::from_reader(input)?; + + let mut write_dom = rbx_dom_weak::WeakDom::new(rbx_dom_weak::InstanceBuilder::empty()); + dom.clone_into_external(dom.root_ref(), &mut write_dom); + + let scripts = get_scripts(dom); + + //check scribb + let mut fail_type=Interactive::Passed; + for script in scripts.iter() { + if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { + let source_action=if check_source_illegal_keywords(source) { + ScriptAction::Flag//script triggers flagging -> Flag + } else if allowed_set.contains(source) { + ScriptAction::Pass//script is allowed -> Pass + }else if let Some(replace_id)=replace_map.get(source) { + ScriptAction::Replace(*replace_id) + }else{ + //interactive logic goes here + //load source into current.lua + std::fs::write("current.lua",source)?; + //prompt action in terminal + println!("unresolved source location={}",get_full_name(&write_dom, script)); + //wait for input + let script_action; + loop{ + let mut action_string = String::new(); + std::io::stdin().read_line(&mut action_string)?; + if let Ok(parsed_script_action)=action_string.parse::(){ + script_action=parsed_script_action; + break; + }else{ + println!("illegal action string."); + } + } + //update allowed/replace/blocked + match script_action{ + ScriptActionParseResult::Pass => { + //if current.lua was updated, create an allowed and replace file and set script_action to replace(new_id) + let modified_source=std::fs::read_to_string("current.lua")?; + if &modified_source==source{ + //it's always new. + //insert allowed_set + allowed_set.insert(modified_source.clone()); + //insert allowed_map + allowed_map.insert(id,modified_source.clone()); + //write allowed/id.lua + std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; + id+=1; + ScriptAction::Pass + }else{ + //insert allowed_set + allowed_set.insert(modified_source.clone()); + //insert allowed_map + allowed_map.insert(id,modified_source.clone()); + //insert replace_map + replace_map.insert(source.clone(),id);//this cannot be reached if it already exists + //write allowed/id.lua + std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; + //write replace/id.lua + std::fs::write(format!("scripts/replace/{}.lua",id),source)?; + let ret=ScriptAction::Replace(id); + id+=1; + ret + } + }, + ScriptActionParseResult::Block => ScriptAction::Block, + } + }; + + match source_action{ + ScriptAction::Pass => println!("passed source location={}",get_full_name(&write_dom, script)), + ScriptAction::Replace(replace_id)=>{ + //replace the source + let location=get_full_name(&write_dom, script); + if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),write_dom.get_by_ref_mut(script.referent())){ + println!("replaced source id={} location={}",replace_id,location); + replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); + }else{ + println!("failed to get replacement source id={} location={}",replace_id,location); + fail_type=Interactive::ReplaceFailed; + } + } + ScriptAction::Flag => { + println!("flagged source location={}",get_full_name(&write_dom, script)); + fail_type=Interactive::Flagged; + }, + ScriptAction::Block => { + println!("blocked source location={}",get_full_name(&write_dom, script)); + match fail_type{ + Interactive::Passed => fail_type=Interactive::Blocked, + _=>(), + } + }, + } + } + } + let mut dest=match fail_type{ + Interactive::Passed => std::path::PathBuf::from("maps/processed"),//write map into maps/processed + Interactive::Blocked => std::path::PathBuf::from("maps/blocked"),//write map into maps/blocked + Interactive::Flagged => std::path::PathBuf::from("maps/flagged"),//write map into maps/flagged + Interactive::ReplaceFailed => continue,//do nothing, map is still unprocessed + }; + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + std::fs::write("id",id.to_string())?; + Ok(()) } fn main() -> Result<(), Box> { From cad29af4bbb97678ce0de7cbd932860ceeac651a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 17:02:05 -0700 Subject: [PATCH 019/125] panic lol --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f7cbc723..d4497ec3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -270,7 +270,6 @@ enum Interactive{ Passed, Blocked, Flagged, - ReplaceFailed, } enum ScriptAction { Pass, @@ -387,8 +386,7 @@ fn interactive() -> Result<(), Box>{ println!("replaced source id={} location={}",replace_id,location); replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); }else{ - println!("failed to get replacement source id={} location={}",replace_id,location); - fail_type=Interactive::ReplaceFailed; + panic!("failed to get replacement source id={} location={}",replace_id,location); } } ScriptAction::Flag => { @@ -403,13 +401,14 @@ fn interactive() -> Result<(), Box>{ } }, } + }else{ + panic!("script source property is none!"); } } let mut dest=match fail_type{ Interactive::Passed => std::path::PathBuf::from("maps/processed"),//write map into maps/processed Interactive::Blocked => std::path::PathBuf::from("maps/blocked"),//write map into maps/blocked Interactive::Flagged => std::path::PathBuf::from("maps/flagged"),//write map into maps/flagged - Interactive::ReplaceFailed => continue,//do nothing, map is still unprocessed }; dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?; From 420dbaa0223bac304925847151bd850f1f5f8dea Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 16:56:07 -0700 Subject: [PATCH 020/125] implement blocked in interactive --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d4497ec3..be9e4f6a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -301,6 +301,7 @@ fn interactive() -> Result<(), Box>{ let mut allowed_set=get_allowed_set()?; let mut allowed_map=get_allowed_map()?; let mut replace_map=get_replace_map()?; + let mut blocked = get_blocked()?; for entry in std::fs::read_dir("maps/unprocessed")? { let file_thing=entry?; @@ -320,6 +321,8 @@ fn interactive() -> Result<(), Box>{ if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { let source_action=if check_source_illegal_keywords(source) { ScriptAction::Flag//script triggers flagging -> Flag + } else if blocked.contains(source) { + ScriptAction::Block//script is blocked -> Block } else if allowed_set.contains(source) { ScriptAction::Pass//script is allowed -> Pass }else if let Some(replace_id)=replace_map.get(source) { @@ -373,7 +376,12 @@ fn interactive() -> Result<(), Box>{ ret } }, - ScriptActionParseResult::Block => ScriptAction::Block, + ScriptActionParseResult::Block => { + blocked.insert(source.clone()); + std::fs::write(format!("scripts/blocked/{}.lua",id),source)?; + id+=1; + ScriptAction::Block + }, } }; From 327d0a49924ad48da7d3af4713af8d76d6b26fc6 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 16:56:43 -0700 Subject: [PATCH 021/125] print map script stats on completion --- src/main.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index be9e4f6a..7826eb4f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -316,9 +316,12 @@ fn interactive() -> Result<(), Box>{ let scripts = get_scripts(dom); //check scribb + let mut script_count=0; + let mut block_count=0; let mut fail_type=Interactive::Passed; for script in scripts.iter() { if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { + script_count+=1; let source_action=if check_source_illegal_keywords(source) { ScriptAction::Flag//script triggers flagging -> Flag } else if blocked.contains(source) { @@ -402,6 +405,7 @@ fn interactive() -> Result<(), Box>{ fail_type=Interactive::Flagged; }, ScriptAction::Block => { + block_count+=1; println!("blocked source location={}",get_full_name(&write_dom, script)); match fail_type{ Interactive::Passed => fail_type=Interactive::Blocked, @@ -414,9 +418,18 @@ fn interactive() -> Result<(), Box>{ } } let mut dest=match fail_type{ - Interactive::Passed => std::path::PathBuf::from("maps/processed"),//write map into maps/processed - Interactive::Blocked => std::path::PathBuf::from("maps/blocked"),//write map into maps/blocked - Interactive::Flagged => std::path::PathBuf::from("maps/flagged"),//write map into maps/flagged + Interactive::Passed => { + println!("map={:?} passed with {} {}",file_thing.file_name(),script_count,if script_count==1 {"script"}else{"scripts"}); + std::path::PathBuf::from("maps/processed") + },//write map into maps/processed + Interactive::Blocked => { + println!("map={:?} blocked with {}/{} {} blocked",file_thing.file_name(),block_count,script_count,if script_count==1 {"script"}else{"scripts"}); + std::path::PathBuf::from("maps/blocked") + },//write map into maps/blocked + Interactive::Flagged => { + println!("map={:?} flagged",file_thing.file_name()); + std::path::PathBuf::from("maps/flagged") + },//write map into maps/flagged }; dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?; From 01449b185034e1bf208c9b4bcc3b188a08c8fc2b Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 17:18:44 -0700 Subject: [PATCH 022/125] fix int parsing --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7826eb4f..352f8b2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -108,7 +108,7 @@ fn get_allowed_map() -> Result, Box::new(); for entry in std::fs::read_dir("scripts/allowed")? { let entry=entry?; - allowed_map.insert(entry.file_name().to_str().unwrap().parse::()?,std::fs::read_to_string(entry.path())?); + allowed_map.insert(entry.path().file_stem().unwrap().to_str().unwrap().parse::()?,std::fs::read_to_string(entry.path())?); } Ok(allowed_map) } @@ -117,7 +117,7 @@ fn get_replace_map() -> Result, Box::new(); for entry in std::fs::read_dir("scripts/replace")? { let entry=entry?; - replace.insert(std::fs::read_to_string(entry.path())?,entry.file_name().to_str().unwrap().parse::()?); + replace.insert(std::fs::read_to_string(entry.path())?,entry.path().file_stem().unwrap().to_str().unwrap().parse::()?); } Ok(replace) } From 432ec11ea603e36282f1a5d2b930ac5042b647b7 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 17:25:01 -0700 Subject: [PATCH 023/125] fix write_dom --- src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 352f8b2c..9dfe3aef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -209,12 +209,12 @@ fn replace() -> Result<(), Box>{ for entry in std::fs::read_dir("maps/blocked")? { let file_thing=entry?; - let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); let dom = rbx_binary::from_reader(input)?; - let mut write_dom = rbx_dom_weak::WeakDom::new(rbx_dom_weak::InstanceBuilder::empty()); - dom.clone_into_external(dom.root_ref(), &mut write_dom); + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut write_dom = rbx_binary::from_reader(input)?; let scripts = get_scripts(dom); @@ -307,11 +307,10 @@ fn interactive() -> Result<(), Box>{ let file_thing=entry?; println!("processing map={:?}",file_thing.file_name()); let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let dom = rbx_binary::from_reader(input)?; - let mut write_dom = rbx_dom_weak::WeakDom::new(rbx_dom_weak::InstanceBuilder::empty()); - dom.clone_into_external(dom.root_ref(), &mut write_dom); + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut write_dom = rbx_binary::from_reader(input)?; let scripts = get_scripts(dom); From b7d04d1f40101213ac37994b14c39bad7478a19e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 17:33:47 -0700 Subject: [PATCH 024/125] this is wrong --- src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 9dfe3aef..94302077 100644 --- a/src/main.rs +++ b/src/main.rs @@ -245,7 +245,6 @@ fn replace() -> Result<(), Box>{ }else{ let mut dest=std::path::PathBuf::from("maps/unprocessed"); dest.set_file_name(file_thing.file_name()); - dest.set_extension("rbxl");//extension is always rbxl even if source file is extensionless let output = std::io::BufWriter::new(std::fs::File::open(dest)?); rbx_binary::to_writer(output, &write_dom, &[write_dom.root_ref()])?; } From 29374e4ff5c2ac3de44174392939257c422bac58 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 17:34:43 -0700 Subject: [PATCH 025/125] write edited file and report how many scripts were replaced --- src/main.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 94302077..b1001633 100644 --- a/src/main.rs +++ b/src/main.rs @@ -315,6 +315,7 @@ fn interactive() -> Result<(), Box>{ //check scribb let mut script_count=0; + let mut replace_count=0; let mut block_count=0; let mut fail_type=Interactive::Passed; for script in scripts.iter() { @@ -392,6 +393,7 @@ fn interactive() -> Result<(), Box>{ //replace the source let location=get_full_name(&write_dom, script); if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),write_dom.get_by_ref_mut(script.referent())){ + replace_count+=1; println!("replaced source id={} location={}",replace_id,location); replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); }else{ @@ -418,7 +420,18 @@ fn interactive() -> Result<(), Box>{ let mut dest=match fail_type{ Interactive::Passed => { println!("map={:?} passed with {} {}",file_thing.file_name(),script_count,if script_count==1 {"script"}else{"scripts"}); - std::path::PathBuf::from("maps/processed") + if replace_count==0{ + std::path::PathBuf::from("maps/passed") + }else{ + //create new file + println!("{} {} replaced - generating new file...",replace_count,if replace_count==1 {"script was"}else{"scripts were"}); + let mut dest=std::path::PathBuf::from("maps/passed"); + dest.push(file_thing.file_name()); + let output = std::io::BufWriter::new(std::fs::File::create(dest)?); + rbx_binary::to_writer(output, &dom, &[dom.root_ref()])?; + //move original to processed folder + std::path::PathBuf::from("maps/unaltered") + } },//write map into maps/processed Interactive::Blocked => { println!("map={:?} blocked with {}/{} {} blocked",file_thing.file_name(),block_count,script_count,if script_count==1 {"script"}else{"scripts"}); From e309f15cb8ed006cb853d34c6aec2571f9333431 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 17:52:45 -0700 Subject: [PATCH 026/125] implement extract --- src/main.rs | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/main.rs b/src/main.rs index b1001633..20da11f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,10 +15,16 @@ enum Commands { Download(MapList), Upload, Scan, + Extract(Map), Replace, Interactive, } +#[derive(Args)] +struct Map { + id:u64, +} + #[derive(Args)] struct MapList { maps: Vec, @@ -203,6 +209,42 @@ fn scan() -> Result<(), Box>{ std::fs::write("id",id.to_string())?; Ok(()) } +fn extract(file_id:u64) -> Result<(), Box>{ + let mut id = 0; + //Construct allowed scripts + let mut script_set = std::collections::HashSet::::new(); + + let file_id_string=file_id.to_string(); + + for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + if file_thing.file_name().to_str().unwrap().find(&file_id_string).is_none(){ + continue; + } + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + + let dom = rbx_binary::from_reader(input)?; + + let scripts = get_scripts(dom); + + //extract scribb + for script in scripts.iter() { + if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { + if script_set.contains(s) { + continue; + }else{ + script_set.insert(s.clone()); + std::fs::write(format!("scripts/extracted/{:?}_{}_{}.lua",file_thing.file_name(),id,script.name),s)?; + id+=1; + } + }else{ + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); + } + } + } + println!("extracted {} {}",id,if id==1 {"script"}else{"scripts"}); + Ok(()) +} fn replace() -> Result<(), Box>{ let allowed_map=get_allowed_map()?; let replace_map=get_replace_map()?; @@ -457,5 +499,6 @@ fn main() -> Result<(), Box> { Commands::Scan=>scan(), Commands::Replace=>replace(), Commands::Interactive=>interactive(), + Commands::Extract(map)=>extract(map.id), } } From 37f0dad7a18a06cf3ae173fc02652763a649e3e0 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 18:30:34 -0700 Subject: [PATCH 027/125] ref cannot refer to object in another dom --- src/main.rs | 314 +++++++++++++++++++++++++++------------------------- 1 file changed, 163 insertions(+), 151 deletions(-) diff --git a/src/main.rs b/src/main.rs index 20da11f4..42a554f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,16 @@ fn class_is_a(class: &str, superclass: &str) -> bool { } return false } - +fn recursive_collect_scripts(scripts: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance){ + for &referent in instance.children() { + if let Some(c) = dom.get_by_ref(referent) { + if class_is_a(c.class.as_str(), "LuaSourceContainer") { + scripts.push(c.referent());//copy ref + } + recursive_collect_scripts(scripts,dom,c); + } + } +} fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance) -> String{ let mut full_name=instance.name.clone(); let mut pref=instance.parent(); @@ -72,15 +81,9 @@ fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance) -> //I can edit the file and it will edit it in place //I pass/fail(with comment)/allow each script -fn get_scripts(dom:rbx_dom_weak::WeakDom) -> Vec{ - let mut scripts = std::vec::Vec::::new(); - - let (_,mut instances) = dom.into_raw(); - for (_,instance) in instances.drain() { - if class_is_a(instance.class.as_str(), "LuaSourceContainer") { - scripts.push(instance); - } - } +fn get_script_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ + let mut scripts = std::vec::Vec::new(); + recursive_collect_scripts(&mut scripts, dom, dom.root()); scripts } @@ -167,32 +170,36 @@ fn scan() -> Result<(), Box>{ let dom = rbx_binary::from_reader(input)?; - let scripts = get_scripts(dom); + let script_refs = get_script_refs(&dom); //check scribb let mut fail_count=0; let mut fail_type=Scan::Passed; - for script in scripts.iter() { - if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { - //flag keywords and instantly fail - if check_source_illegal_keywords(s){ - println!("{:?} - flagged.",file_thing.file_name()); - fail_type=Scan::Flagged; - break; - } - if allowed_set.contains(s) { - continue; - }else{ - fail_type=Scan::Blocked;//no need to check for Flagged, it breaks the loop. - fail_count+=1; - if !blocked.contains(s) { - blocked.insert(s.clone());//all fixed! just clone! - std::fs::write(format!("scripts/blocked/{}.lua",id),s)?; - id+=1; + for &script_ref in script_refs.iter() { + if let Some(script)=dom.get_by_ref(script_ref){ + if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { + //flag keywords and instantly fail + if check_source_illegal_keywords(s){ + println!("{:?} - flagged.",file_thing.file_name()); + fail_type=Scan::Flagged; + break; } + if allowed_set.contains(s) { + continue; + }else{ + fail_type=Scan::Blocked;//no need to check for Flagged, it breaks the loop. + fail_count+=1; + if !blocked.contains(s) { + blocked.insert(s.clone());//all fixed! just clone! + std::fs::write(format!("scripts/blocked/{}.lua",id),s)?; + id+=1; + } + } + }else{ + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); } }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); + panic!("FATAL: failed to get_by_ref {:?}",script_ref); } } let mut dest=match fail_type { @@ -225,20 +232,24 @@ fn extract(file_id:u64) -> Result<(), Box>{ let dom = rbx_binary::from_reader(input)?; - let scripts = get_scripts(dom); + let script_refs = get_script_refs(&dom); //extract scribb - for script in scripts.iter() { - if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { - if script_set.contains(s) { - continue; + for &script_ref in script_refs.iter() { + if let Some(script)=dom.get_by_ref(script_ref){ + if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { + if script_set.contains(s) { + continue; + }else{ + script_set.insert(s.clone()); + std::fs::write(format!("scripts/extracted/{:?}_{}_{}.lua",file_thing.file_name(),id,script.name),s)?; + id+=1; + } }else{ - script_set.insert(s.clone()); - std::fs::write(format!("scripts/extracted/{:?}_{}_{}.lua",file_thing.file_name(),id,script.name),s)?; - id+=1; + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); } }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); + panic!("FATAL: failed to get_by_ref {:?}",script_ref); } } } @@ -253,33 +264,33 @@ fn replace() -> Result<(), Box>{ let file_thing=entry?; let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let dom = rbx_binary::from_reader(input)?; + let mut dom = rbx_binary::from_reader(input)?; - let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut write_dom = rbx_binary::from_reader(input)?; - - let scripts = get_scripts(dom); + let script_refs = get_script_refs(&dom); //check scribb let mut any_failed=false; - for script in scripts.iter() { - if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { - if let (Some(replace_id),Some(replace_script))=(replace_map.get(source),write_dom.get_by_ref_mut(script.referent())) { - println!("replace {}",replace_id); - //replace the source - if let Some(replace_source)=allowed_map.get(replace_id){ - replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); + for &script_ref in script_refs.iter() { + if let Some(script)=dom.get_by_ref(script_ref){ + if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { + if let (Some(replace_id),Some(replace_script))=(replace_map.get(source),dom.get_by_ref_mut(script.referent())) { + println!("replace {}",replace_id); + //replace the source + if let Some(replace_source)=allowed_map.get(replace_id){ + replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); + }else{ + println!("failed to get replacement source {}",replace_id); + any_failed=true; + } }else{ - println!("failed to get replacement source {}",replace_id); + println!("failed to failed to get replace_id and replace_script"); any_failed=true; } }else{ - println!("failed to failed to get replace_id and replace_script"); - any_failed=true; + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); } }else{ - println!("failed to failed to get source"); - any_failed=true; + panic!("FATAL: failed to get_by_ref {:?}",script_ref); } } if any_failed { @@ -288,7 +299,7 @@ fn replace() -> Result<(), Box>{ let mut dest=std::path::PathBuf::from("maps/unprocessed"); dest.set_file_name(file_thing.file_name()); let output = std::io::BufWriter::new(std::fs::File::open(dest)?); - rbx_binary::to_writer(output, &write_dom, &[write_dom.root_ref()])?; + rbx_binary::to_writer(output, &dom, &[dom.root_ref()])?; } } Ok(()) @@ -348,115 +359,116 @@ fn interactive() -> Result<(), Box>{ let file_thing=entry?; println!("processing map={:?}",file_thing.file_name()); let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let dom = rbx_binary::from_reader(input)?; + let mut dom = rbx_binary::from_reader(input)?; - let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut write_dom = rbx_binary::from_reader(input)?; - - let scripts = get_scripts(dom); + let script_refs = get_script_refs(&dom); //check scribb let mut script_count=0; let mut replace_count=0; let mut block_count=0; let mut fail_type=Interactive::Passed; - for script in scripts.iter() { - if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { - script_count+=1; - let source_action=if check_source_illegal_keywords(source) { - ScriptAction::Flag//script triggers flagging -> Flag - } else if blocked.contains(source) { - ScriptAction::Block//script is blocked -> Block - } else if allowed_set.contains(source) { - ScriptAction::Pass//script is allowed -> Pass - }else if let Some(replace_id)=replace_map.get(source) { - ScriptAction::Replace(*replace_id) - }else{ - //interactive logic goes here - //load source into current.lua - std::fs::write("current.lua",source)?; - //prompt action in terminal - println!("unresolved source location={}",get_full_name(&write_dom, script)); - //wait for input - let script_action; - loop{ - let mut action_string = String::new(); - std::io::stdin().read_line(&mut action_string)?; - if let Ok(parsed_script_action)=action_string.parse::(){ - script_action=parsed_script_action; - break; - }else{ - println!("illegal action string."); - } - } - //update allowed/replace/blocked - match script_action{ - ScriptActionParseResult::Pass => { - //if current.lua was updated, create an allowed and replace file and set script_action to replace(new_id) - let modified_source=std::fs::read_to_string("current.lua")?; - if &modified_source==source{ - //it's always new. - //insert allowed_set - allowed_set.insert(modified_source.clone()); - //insert allowed_map - allowed_map.insert(id,modified_source.clone()); - //write allowed/id.lua - std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; - id+=1; - ScriptAction::Pass + for &script_ref in script_refs.iter() { + if let Some(script)=dom.get_by_ref(script_ref){ + if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { + script_count+=1; + let source_action=if check_source_illegal_keywords(source) { + ScriptAction::Flag//script triggers flagging -> Flag + } else if blocked.contains(source) { + ScriptAction::Block//script is blocked -> Block + } else if allowed_set.contains(source) { + ScriptAction::Pass//script is allowed -> Pass + }else if let Some(replace_id)=replace_map.get(source) { + ScriptAction::Replace(*replace_id) + }else{ + //interactive logic goes here + //load source into current.lua + std::fs::write("current.lua",source)?; + //prompt action in terminal + println!("unresolved source location={}",get_full_name(&dom, script)); + //wait for input + let script_action; + loop{ + let mut action_string = String::new(); + std::io::stdin().read_line(&mut action_string)?; + if let Ok(parsed_script_action)=action_string.parse::(){ + script_action=parsed_script_action; + break; }else{ - //insert allowed_set - allowed_set.insert(modified_source.clone()); - //insert allowed_map - allowed_map.insert(id,modified_source.clone()); - //insert replace_map - replace_map.insert(source.clone(),id);//this cannot be reached if it already exists - //write allowed/id.lua - std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; - //write replace/id.lua - std::fs::write(format!("scripts/replace/{}.lua",id),source)?; - let ret=ScriptAction::Replace(id); + println!("illegal action string."); + } + } + //update allowed/replace/blocked + match script_action{ + ScriptActionParseResult::Pass => { + //if current.lua was updated, create an allowed and replace file and set script_action to replace(new_id) + let modified_source=std::fs::read_to_string("current.lua")?; + if &modified_source==source{ + //it's always new. + //insert allowed_set + allowed_set.insert(modified_source.clone()); + //insert allowed_map + allowed_map.insert(id,modified_source.clone()); + //write allowed/id.lua + std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; + id+=1; + ScriptAction::Pass + }else{ + //insert allowed_set + allowed_set.insert(modified_source.clone()); + //insert allowed_map + allowed_map.insert(id,modified_source.clone()); + //insert replace_map + replace_map.insert(source.clone(),id);//this cannot be reached if it already exists + //write allowed/id.lua + std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; + //write replace/id.lua + std::fs::write(format!("scripts/replace/{}.lua",id),source)?; + let ret=ScriptAction::Replace(id); + id+=1; + ret + } + }, + ScriptActionParseResult::Block => { + blocked.insert(source.clone()); + std::fs::write(format!("scripts/blocked/{}.lua",id),source)?; id+=1; - ret + ScriptAction::Block + }, + } + }; + + match source_action{ + ScriptAction::Pass => println!("passed source location={}",get_full_name(&dom, script)), + ScriptAction::Replace(replace_id)=>{ + //replace the source + let location=get_full_name(&dom, script); + if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),dom.get_by_ref_mut(script.referent())){ + replace_count+=1; + println!("replaced source id={} location={}",replace_id,location); + replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); + }else{ + panic!("failed to get replacement source id={} location={}",replace_id,location); + } + } + ScriptAction::Flag => { + println!("flagged source location={}",get_full_name(&dom, script)); + fail_type=Interactive::Flagged; + }, + ScriptAction::Block => { + block_count+=1; + println!("blocked source location={}",get_full_name(&dom, script)); + match fail_type{ + Interactive::Passed => fail_type=Interactive::Blocked, + _=>(), } }, - ScriptActionParseResult::Block => { - blocked.insert(source.clone()); - std::fs::write(format!("scripts/blocked/{}.lua",id),source)?; - id+=1; - ScriptAction::Block - }, } - }; - - match source_action{ - ScriptAction::Pass => println!("passed source location={}",get_full_name(&write_dom, script)), - ScriptAction::Replace(replace_id)=>{ - //replace the source - let location=get_full_name(&write_dom, script); - if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),write_dom.get_by_ref_mut(script.referent())){ - replace_count+=1; - println!("replaced source id={} location={}",replace_id,location); - replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); - }else{ - panic!("failed to get replacement source id={} location={}",replace_id,location); - } - } - ScriptAction::Flag => { - println!("flagged source location={}",get_full_name(&write_dom, script)); - fail_type=Interactive::Flagged; - }, - ScriptAction::Block => { - block_count+=1; - println!("blocked source location={}",get_full_name(&write_dom, script)); - match fail_type{ - Interactive::Passed => fail_type=Interactive::Blocked, - _=>(), - } - }, + }else{ + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); } }else{ - panic!("script source property is none!"); + panic!("FATAL: failed to get_by_ref {:?}",script_ref); } } let mut dest=match fail_type{ From a7554da1c5826c071b50945bbbf2767b532f9acf Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 18:47:57 -0700 Subject: [PATCH 028/125] flush prompt --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 42a554f6..d88fb7e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -382,10 +382,11 @@ fn interactive() -> Result<(), Box>{ ScriptAction::Replace(*replace_id) }else{ //interactive logic goes here + print!("unresolved source location={}\naction: ",get_full_name(&dom, script)); + std::io::Write::flush(&mut std::io::stdout())?; //load source into current.lua std::fs::write("current.lua",source)?; //prompt action in terminal - println!("unresolved source location={}",get_full_name(&dom, script)); //wait for input let script_action; loop{ From 7ab20f36a7c4ea72370437947dcfbc24639a8a72 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 18:48:07 -0700 Subject: [PATCH 029/125] fix parse --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d88fb7e1..5ab8fc89 100644 --- a/src/main.rs +++ b/src/main.rs @@ -337,9 +337,9 @@ struct ParseScriptActionErr; impl std::str::FromStr for ScriptActionParseResult { type Err=ParseScriptActionErr; fn from_str(s: &str) -> Result{ - if s=="pass"||s=="1"{ + if s=="pass\n"||s=="1\n"{ Ok(Self::Pass) - }else if s=="block"{ + }else if s=="block\n"{ Ok(Self::Block) }else{ Err(ParseScriptActionErr) From 52d911a25a6f0232c40e8e2371213aef9cbc93ae Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 19:28:13 -0700 Subject: [PATCH 030/125] implement Exit/Delete --- src/main.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5ab8fc89..e3bf209c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -328,10 +328,13 @@ enum ScriptAction { Replace(u32), Flag, Block, + Delete, } enum ScriptActionParseResult { Pass, Block, + Exit, + Delete, } struct ParseScriptActionErr; impl std::str::FromStr for ScriptActionParseResult { @@ -341,6 +344,10 @@ impl std::str::FromStr for ScriptActionParseResult { Ok(Self::Pass) }else if s=="block\n"{ Ok(Self::Block) + }else if s=="exit\n"{ + Ok(Self::Exit) + }else if s=="delete\n"{ + Ok(Self::Delete) }else{ Err(ParseScriptActionErr) } @@ -355,7 +362,7 @@ fn interactive() -> Result<(), Box>{ let mut replace_map=get_replace_map()?; let mut blocked = get_blocked()?; - for entry in std::fs::read_dir("maps/unprocessed")? { + 'map_loop: for entry in std::fs::read_dir("maps/unprocessed")? { let file_thing=entry?; println!("processing map={:?}",file_thing.file_name()); let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); @@ -436,6 +443,8 @@ fn interactive() -> Result<(), Box>{ id+=1; ScriptAction::Block }, + ScriptActionParseResult::Exit => break 'map_loop, + ScriptActionParseResult::Delete => ScriptAction::Delete, } }; @@ -451,7 +460,12 @@ fn interactive() -> Result<(), Box>{ }else{ panic!("failed to get replacement source id={} location={}",replace_id,location); } - } + }, + ScriptAction::Delete => { + println!("deleted source location={}",get_full_name(&dom, script)); + replace_count+=1; + dom.destroy(script.referent()); + }, ScriptAction::Flag => { println!("flagged source location={}",get_full_name(&dom, script)); fail_type=Interactive::Flagged; From e5cca9ed041665ec8c81e93f48648f8aefd9c592 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 19:29:43 -0700 Subject: [PATCH 031/125] common location --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index e3bf209c..c1262f98 100644 --- a/src/main.rs +++ b/src/main.rs @@ -448,11 +448,11 @@ fn interactive() -> Result<(), Box>{ } }; + let location=get_full_name(&dom, script); match source_action{ - ScriptAction::Pass => println!("passed source location={}",get_full_name(&dom, script)), + ScriptAction::Pass => println!("passed source location={}",location), ScriptAction::Replace(replace_id)=>{ //replace the source - let location=get_full_name(&dom, script); if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),dom.get_by_ref_mut(script.referent())){ replace_count+=1; println!("replaced source id={} location={}",replace_id,location); @@ -462,17 +462,17 @@ fn interactive() -> Result<(), Box>{ } }, ScriptAction::Delete => { - println!("deleted source location={}",get_full_name(&dom, script)); + println!("deleted source location={}",location); replace_count+=1; dom.destroy(script.referent()); }, ScriptAction::Flag => { - println!("flagged source location={}",get_full_name(&dom, script)); + println!("flagged source location={}",location); fail_type=Interactive::Flagged; }, ScriptAction::Block => { block_count+=1; - println!("blocked source location={}",get_full_name(&dom, script)); + println!("blocked source location={}",location); match fail_type{ Interactive::Passed => fail_type=Interactive::Blocked, _=>(), From 2cb346f49a0f66cee42727eb98f418ab682b442c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 21:36:38 -0700 Subject: [PATCH 032/125] re-prompt action --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c1262f98..a8c37a82 100644 --- a/src/main.rs +++ b/src/main.rs @@ -403,7 +403,8 @@ fn interactive() -> Result<(), Box>{ script_action=parsed_script_action; break; }else{ - println!("illegal action string."); + print!("action: "); + std::io::Write::flush(&mut std::io::stdout())?; } } //update allowed/replace/blocked From 742f7b4ec05da98cf028f459e18d34003663704e Mon Sep 17 00:00:00 2001 From: Jeft <67933106+Jeftaei@users.noreply.github.com> Date: Wed, 13 Sep 2023 09:13:23 -0500 Subject: [PATCH 033/125] we Love errors --- src/error.rs | 21 +++++++++++++++++++++ src/main.rs | 37 +++++++++++++++++++++++-------------- src/prelude.rs | 19 +++++++++++++++++++ 3 files changed, 63 insertions(+), 14 deletions(-) create mode 100644 src/error.rs create mode 100644 src/prelude.rs diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 00000000..eac64752 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,21 @@ +#[derive(Debug)] +pub struct Error { + pub message: String, +} + +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for Error {} + +impl Error { + // has to be Box to fit with the result in prelude.rs + pub fn new(message: &str) -> Box { + Box::new(Self { + message: message.to_string(), + }) + } +} diff --git a/src/main.rs b/src/main.rs index a8c37a82..33346fe3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,14 @@ use std::unimplemented; use clap::{Args, Parser, Subcommand}; +mod error; +mod prelude; + +// this * means we are importing everything from the prelude module and in turn we overwrite the default `Result` with our own +// if you want the original back you can use StdResult or just std::result::Result +// using the new result also means the error type is implicitly Box (works for any errors that implement the std::error::Error trait) +use crate::prelude::*; + #[derive(Parser)] #[command(author, version, about, long_about = None)] #[command(propagate_version = true)] @@ -87,7 +95,7 @@ fn get_script_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ scripts } -fn get_id() -> Result>{ +fn get_id() -> Result{ match std::fs::read_to_string("id"){ Ok(id_file)=>Ok(id_file.parse::()?), Err(e) => match e.kind() { @@ -97,7 +105,7 @@ fn get_id() -> Result>{ } } -fn get_set_from_file(file:&str) -> Result, Box>{ +fn get_set_from_file(file:&str) -> Result>{ let mut set=std::collections::HashSet::::new(); for entry in std::fs::read_dir(file)? { set.insert(std::fs::read_to_string(entry?.path())?); @@ -105,15 +113,15 @@ fn get_set_from_file(file:&str) -> Result, Box Ok(set) } -fn get_allowed_set() -> Result, Box>{ +fn get_allowed_set() -> Result>{ get_set_from_file("scripts/allowed") } -fn get_blocked() -> Result, Box>{ +fn get_blocked() -> Result>{ get_set_from_file("scripts/blocked") } -fn get_allowed_map() -> Result, Box>{ +fn get_allowed_map() -> Result>{ let mut allowed_map = std::collections::HashMap::::new(); for entry in std::fs::read_dir("scripts/allowed")? { let entry=entry?; @@ -122,7 +130,7 @@ fn get_allowed_map() -> Result, Box Result, Box>{ +fn get_replace_map() -> Result>{ let mut replace = std::collections::HashMap::::new(); for entry in std::fs::read_dir("scripts/replace")? { let entry=entry?; @@ -135,7 +143,7 @@ fn check_source_illegal_keywords(source:&String)->bool{ source.find("getfenv").is_some()||source.find("require").is_some() } -fn download(map_list: Vec) -> Result<(), Box>{ +fn download(map_list: Vec) -> Result<()>{ let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); let shared_args=&[ "-q", @@ -158,7 +166,8 @@ enum Scan{ Blocked, Flagged, } -fn scan() -> Result<(), Box>{ + +fn scan() -> Result<()>{ let mut id = get_id()?; //Construct allowed scripts let allowed_set = get_allowed_set()?; @@ -216,7 +225,7 @@ fn scan() -> Result<(), Box>{ std::fs::write("id",id.to_string())?; Ok(()) } -fn extract(file_id:u64) -> Result<(), Box>{ +fn extract(file_id:u64) -> Result<()>{ let mut id = 0; //Construct allowed scripts let mut script_set = std::collections::HashSet::::new(); @@ -256,7 +265,7 @@ fn extract(file_id:u64) -> Result<(), Box>{ println!("extracted {} {}",id,if id==1 {"script"}else{"scripts"}); Ok(()) } -fn replace() -> Result<(), Box>{ +fn replace() -> Result<()>{ let allowed_map=get_allowed_map()?; let replace_map=get_replace_map()?; @@ -304,7 +313,7 @@ fn replace() -> Result<(), Box>{ } Ok(()) } -fn upload() -> Result<(), Box>{ +fn upload() -> Result<()>{ //interactive prompt per upload: //Creator: [auto fill creator] //DisplayName: [auto fill DisplayName] @@ -339,7 +348,7 @@ enum ScriptActionParseResult { struct ParseScriptActionErr; impl std::str::FromStr for ScriptActionParseResult { type Err=ParseScriptActionErr; - fn from_str(s: &str) -> Result{ + fn from_str(s: &str) -> StdResult{ if s=="pass\n"||s=="1\n"{ Ok(Self::Pass) }else if s=="block\n"{ @@ -354,7 +363,7 @@ impl std::str::FromStr for ScriptActionParseResult { } } -fn interactive() -> Result<(), Box>{ +fn interactive() -> Result<()>{ let mut id=get_id()?; //Construct allowed scripts let mut allowed_set=get_allowed_set()?; @@ -519,7 +528,7 @@ fn interactive() -> Result<(), Box>{ Ok(()) } -fn main() -> Result<(), Box> { +fn main() -> Result<()> { let cli = Cli::parse(); match cli.command { Commands::Download(map_list)=>download(map_list.maps), diff --git a/src/prelude.rs b/src/prelude.rs new file mode 100644 index 00000000..3f69da48 --- /dev/null +++ b/src/prelude.rs @@ -0,0 +1,19 @@ +pub use crate::error::Error; + +pub type Result = std::result::Result>; +pub type StdResult = std::result::Result; + +// i just wanted to mess around with macros a bit +// so heres labelprint as a macro +#[macro_export] +macro_rules! lprint { + ($expr:expr) => { + let ___this_file = std::file!(); + let ___line = std::line!(); + // let ___column = column!(); + println!("[{}:{}] {}", ___this_file, ___line, $expr); + }; + ($expr:expr, $($arg:tt)*) => { + lprint!(format!($expr, $($arg)*)); + }; +} From 2a55ef90dfbd933219226a81acd19562455d3db4 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 13 Sep 2023 21:03:17 -0700 Subject: [PATCH 034/125] don't replace std Result --- src/main.rs | 28 ++++++++++++++-------------- src/prelude.rs | 3 +-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/main.rs b/src/main.rs index 33346fe3..6490f6c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -95,7 +95,7 @@ fn get_script_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ scripts } -fn get_id() -> Result{ +fn get_id() -> BoxResult{ match std::fs::read_to_string("id"){ Ok(id_file)=>Ok(id_file.parse::()?), Err(e) => match e.kind() { @@ -105,7 +105,7 @@ fn get_id() -> Result{ } } -fn get_set_from_file(file:&str) -> Result>{ +fn get_set_from_file(file:&str) -> BoxResult>{ let mut set=std::collections::HashSet::::new(); for entry in std::fs::read_dir(file)? { set.insert(std::fs::read_to_string(entry?.path())?); @@ -113,15 +113,15 @@ fn get_set_from_file(file:&str) -> Result>{ Ok(set) } -fn get_allowed_set() -> Result>{ +fn get_allowed_set() -> BoxResult>{ get_set_from_file("scripts/allowed") } -fn get_blocked() -> Result>{ +fn get_blocked() -> BoxResult>{ get_set_from_file("scripts/blocked") } -fn get_allowed_map() -> Result>{ +fn get_allowed_map() -> BoxResult>{ let mut allowed_map = std::collections::HashMap::::new(); for entry in std::fs::read_dir("scripts/allowed")? { let entry=entry?; @@ -130,7 +130,7 @@ fn get_allowed_map() -> Result>{ Ok(allowed_map) } -fn get_replace_map() -> Result>{ +fn get_replace_map() -> BoxResult>{ let mut replace = std::collections::HashMap::::new(); for entry in std::fs::read_dir("scripts/replace")? { let entry=entry?; @@ -143,7 +143,7 @@ fn check_source_illegal_keywords(source:&String)->bool{ source.find("getfenv").is_some()||source.find("require").is_some() } -fn download(map_list: Vec) -> Result<()>{ +fn download(map_list: Vec) -> BoxResult<()>{ let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); let shared_args=&[ "-q", @@ -167,7 +167,7 @@ enum Scan{ Flagged, } -fn scan() -> Result<()>{ +fn scan() -> BoxResult<()>{ let mut id = get_id()?; //Construct allowed scripts let allowed_set = get_allowed_set()?; @@ -225,7 +225,7 @@ fn scan() -> Result<()>{ std::fs::write("id",id.to_string())?; Ok(()) } -fn extract(file_id:u64) -> Result<()>{ +fn extract(file_id:u64) -> BoxResult<()>{ let mut id = 0; //Construct allowed scripts let mut script_set = std::collections::HashSet::::new(); @@ -265,7 +265,7 @@ fn extract(file_id:u64) -> Result<()>{ println!("extracted {} {}",id,if id==1 {"script"}else{"scripts"}); Ok(()) } -fn replace() -> Result<()>{ +fn replace() -> BoxResult<()>{ let allowed_map=get_allowed_map()?; let replace_map=get_replace_map()?; @@ -313,7 +313,7 @@ fn replace() -> Result<()>{ } Ok(()) } -fn upload() -> Result<()>{ +fn upload() -> BoxResult<()>{ //interactive prompt per upload: //Creator: [auto fill creator] //DisplayName: [auto fill DisplayName] @@ -348,7 +348,7 @@ enum ScriptActionParseResult { struct ParseScriptActionErr; impl std::str::FromStr for ScriptActionParseResult { type Err=ParseScriptActionErr; - fn from_str(s: &str) -> StdResult{ + fn from_str(s: &str) -> Result{ if s=="pass\n"||s=="1\n"{ Ok(Self::Pass) }else if s=="block\n"{ @@ -363,7 +363,7 @@ impl std::str::FromStr for ScriptActionParseResult { } } -fn interactive() -> Result<()>{ +fn interactive() -> BoxResult<()>{ let mut id=get_id()?; //Construct allowed scripts let mut allowed_set=get_allowed_set()?; @@ -528,7 +528,7 @@ fn interactive() -> Result<()>{ Ok(()) } -fn main() -> Result<()> { +fn main() -> BoxResult<()> { let cli = Cli::parse(); match cli.command { Commands::Download(map_list)=>download(map_list.maps), diff --git a/src/prelude.rs b/src/prelude.rs index 3f69da48..4fe9e9c5 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -1,7 +1,6 @@ pub use crate::error::Error; -pub type Result = std::result::Result>; -pub type StdResult = std::result::Result; +pub type BoxResult = std::result::Result>; // i just wanted to mess around with macros a bit // so heres labelprint as a macro From 0d05cc99969f7fcd70a806cd9511db5b8a1aa99d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 13 Sep 2023 21:22:28 -0700 Subject: [PATCH 035/125] comment on laziness --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 6490f6c7..309dd656 100644 --- a/src/main.rs +++ b/src/main.rs @@ -473,7 +473,7 @@ fn interactive() -> BoxResult<()>{ }, ScriptAction::Delete => { println!("deleted source location={}",location); - replace_count+=1; + replace_count+=1;//trigger a new file generation dom.destroy(script.referent()); }, ScriptAction::Flag => { From eff55af1b49eec0b7d6f7e195eef40de03137b3d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 12:06:02 -0700 Subject: [PATCH 036/125] models are rbxm --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 309dd656..0429d30c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -154,7 +154,7 @@ fn download(map_list: Vec) -> BoxResult<()>{ for map_id in map_list.iter() { std::process::Command::new("wget") .args(shared_args) - .arg(format!("maps/unprocessed/{}.rbxl",map_id)) + .arg(format!("maps/unprocessed/{}.rbxm",map_id)) .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",map_id)) .spawn()?; } From 7bbb9ca24f8a6a81b1ca749e93d5b1883fa016fe Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 13:53:52 -0700 Subject: [PATCH 037/125] have to write the model ref to make a valid model file --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0429d30c..ef02c2a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -507,7 +507,12 @@ fn interactive() -> BoxResult<()>{ let mut dest=std::path::PathBuf::from("maps/passed"); dest.push(file_thing.file_name()); let output = std::io::BufWriter::new(std::fs::File::create(dest)?); - rbx_binary::to_writer(output, &dom, &[dom.root_ref()])?; + //write workspace:GetChildren()[1] + let workspace_children=dom.root().children(); + if workspace_children.len()!=1{ + return Err(Error::new("there can only be one model")); + } + rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; //move original to processed folder std::path::PathBuf::from("maps/unaltered") } From 4c485e76e4f0c743ebf1e03405080ebf7e99957d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 13:54:08 -0700 Subject: [PATCH 038/125] implement upload --- src/main.rs | 78 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index ef02c2a3..eb588f34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -use std::unimplemented; - use clap::{Args, Parser, Subcommand}; mod error; @@ -143,6 +141,38 @@ fn check_source_illegal_keywords(source:&String)->bool{ source.find("getfenv").is_some()||source.find("require").is_some() } +fn find_first_child_class<'a>(dom:&'a rbx_dom_weak::WeakDom,instance:&'a rbx_dom_weak::Instance,name:&'a str,class:&'a str) -> Option<&'a rbx_dom_weak::Instance> { + for &referent in instance.children() { + if let Some(c) = dom.get_by_ref(referent) { + if c.name==name&&class_is_a(c.class.as_str(),class) { + return Some(c); + } + } + } + None +} + +fn get_mapinfo(dom:&rbx_dom_weak::WeakDom) -> BoxResult<(String,String,String)>{ + let workspace_children=dom.root().children(); + if workspace_children.len()!=1{ + return Err(Error::new("there can only be one model")); + } + if let Some(model_instance) = dom.get_by_ref(workspace_children[0]) { + if let (Some(creator),Some(displayname))=(find_first_child_class(dom, model_instance, "Creator", "StringValue"),find_first_child_class(dom, model_instance, "DisplayName", "StringValue")){ + if let ( + Some(rbx_dom_weak::types::Variant::String(creator_string)), + Some(rbx_dom_weak::types::Variant::String(displayname_string)) + )=( + creator.properties.get("Value"), + displayname.properties.get("Value") + ){ + return Ok((model_instance.name.clone(),creator_string.clone(),displayname_string.clone())); + } + } + } + return Err(Error::new("no stuff in map")); +} + fn download(map_list: Vec) -> BoxResult<()>{ let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); let shared_args=&[ @@ -315,16 +345,40 @@ fn replace() -> BoxResult<()>{ } fn upload() -> BoxResult<()>{ //interactive prompt per upload: - //Creator: [auto fill creator] - //DisplayName: [auto fill DisplayName] - //id: ["New" for blank because of my double enter key] - // std::process::Command::new("rbxcompiler") - // .arg("--compile=false") - // .arg("--group=6980477") - // .arg("--asset=5692139100") - // .arg("--input=map.rbxm") - // .spawn()?; - unimplemented!() + for entry in std::fs::read_dir("maps/passed")? { + let file_thing=entry?; + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + + let dom = rbx_binary::from_reader(input)?; + let (modelname,creator,displayname) = get_mapinfo(&dom)?; + + //Creator: [auto fill creator] + //DisplayName: [auto fill DisplayName] + //id: ["New" for blank because of my double enter key] + print!("Model name: {}\nCreator: {}\nDisplayName: {}\nAsset Id: ",modelname,creator,displayname); + std::io::Write::flush(&mut std::io::stdout())?; + let asset_id; + loop{ + let mut asset_id_string = String::new(); + std::io::stdin().read_line(&mut asset_id_string)?; + asset_id_string.pop();//drop newline + if let Ok(parsed_asset_id)=asset_id_string.parse::(){ + asset_id=parsed_asset_id; + break; + }else{ + print!("Asset Id: "); + std::io::Write::flush(&mut std::io::stdout())?; + } + } + + std::process::Command::new("../rbxcompiler-linux-amd64") + .arg("--compile=false") + .arg("--group=6980477") + .arg(format!("--asset={}",asset_id)) + .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) + .spawn()?; + } + Ok(()) } enum Interactive{ From 1b2324deeb48803d049421255b96d375306b4a6d Mon Sep 17 00:00:00 2001 From: Jeft <67933106+Jeftaei@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:15:39 -0500 Subject: [PATCH 039/125] stop macro from returning --- src/prelude.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prelude.rs b/src/prelude.rs index 3f69da48..9721fda0 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -7,13 +7,13 @@ pub type StdResult = std::result::Result; // so heres labelprint as a macro #[macro_export] macro_rules! lprint { - ($expr:expr) => { + ($expr:expr) => {{ let ___this_file = std::file!(); let ___line = std::line!(); // let ___column = column!(); println!("[{}:{}] {}", ___this_file, ___line, $expr); - }; - ($expr:expr, $($arg:tt)*) => { + }}; + ($expr:expr, $($arg:tt)*) => {{ lprint!(format!($expr, $($arg)*)); - }; + }}; } From 5a4a39ab754828a225189e8bf2f2e9860fc6e7c3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 14:17:00 -0700 Subject: [PATCH 040/125] add upload action + wait for status code --- src/main.rs | 60 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index eb588f34..e7b88d08 100644 --- a/src/main.rs +++ b/src/main.rs @@ -343,6 +343,27 @@ fn replace() -> BoxResult<()>{ } Ok(()) } + +enum UploadAction { + Upload(u64), + Skip, +} +struct ParseUploadActionErr; +impl std::str::FromStr for UploadAction { + type Err=ParseUploadActionErr; + fn from_str(s: &str) -> Result{ + if s=="skip\n"{ + Ok(Self::Skip) + }else{ + if let Ok(asset_id)=s[..s.len()-1].parse::(){ + Ok(Self::Upload(asset_id)) + }else{ + Err(ParseUploadActionErr) + } + } + } +} + fn upload() -> BoxResult<()>{ //interactive prompt per upload: for entry in std::fs::read_dir("maps/passed")? { @@ -357,26 +378,39 @@ fn upload() -> BoxResult<()>{ //id: ["New" for blank because of my double enter key] print!("Model name: {}\nCreator: {}\nDisplayName: {}\nAsset Id: ",modelname,creator,displayname); std::io::Write::flush(&mut std::io::stdout())?; - let asset_id; + let upload_action; loop{ - let mut asset_id_string = String::new(); - std::io::stdin().read_line(&mut asset_id_string)?; - asset_id_string.pop();//drop newline - if let Ok(parsed_asset_id)=asset_id_string.parse::(){ - asset_id=parsed_asset_id; + let mut upload_action_string = String::new(); + std::io::stdin().read_line(&mut upload_action_string)?; + if let Ok(parsed_upload_action)=upload_action_string.parse::(){ + upload_action=parsed_upload_action; break; }else{ print!("Asset Id: "); std::io::Write::flush(&mut std::io::stdout())?; } } - - std::process::Command::new("../rbxcompiler-linux-amd64") - .arg("--compile=false") - .arg("--group=6980477") - .arg(format!("--asset={}",asset_id)) - .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) - .spawn()?; + match upload_action { + UploadAction::Upload(asset_id) => { + let status=std::process::Command::new("../rbxcompiler-linux-amd64") + .arg("--compile=false") + .arg("--group=6980477") + .arg(format!("--asset={}",asset_id)) + .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) + .status()?; + match status.code() { + Some(0)=>{ + //move file + let mut dest=std::path::PathBuf::from("maps/uploaded"); + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + Some(code)=>println!("upload failed! code={}",code), + None => println!("no status code!"), + } + } + UploadAction::Skip => continue, + } } Ok(()) } From 1cd77984d415b9db087759a9c9135f43630e043d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 14:32:25 -0700 Subject: [PATCH 041/125] wait for downloads before exiting --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index e7b88d08..4b1d116e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -181,12 +181,16 @@ fn download(map_list: Vec) -> BoxResult<()>{ header.as_str(), "-O", ]; - for map_id in map_list.iter() { + let processes_result:Result, _>=map_list.iter().map(|map_id|{ std::process::Command::new("wget") .args(shared_args) .arg(format!("maps/unprocessed/{}.rbxm",map_id)) .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",map_id)) - .spawn()?; + .spawn() + }).collect(); + //naively wait for all because idk how to make an async progress bar lmao + for mut child in processes_result?{ + child.wait()?; } Ok(()) } From 980da5a6a788bc8e6f0b8c06c32085a6400ae508 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 16:18:33 -0700 Subject: [PATCH 042/125] write approximate code for uploading new asset --- src/main.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4b1d116e..035d2d48 100644 --- a/src/main.rs +++ b/src/main.rs @@ -351,6 +351,7 @@ fn replace() -> BoxResult<()>{ enum UploadAction { Upload(u64), Skip, + New, } struct ParseUploadActionErr; impl std::str::FromStr for UploadAction { @@ -358,6 +359,8 @@ impl std::str::FromStr for UploadAction { fn from_str(s: &str) -> Result{ if s=="skip\n"{ Ok(Self::Skip) + }else if s=="new\n"{ + Ok(Self::New) }else{ if let Ok(asset_id)=s[..s.len()-1].parse::(){ Ok(Self::Upload(asset_id)) @@ -414,6 +417,26 @@ fn upload() -> BoxResult<()>{ } } UploadAction::Skip => continue, + UploadAction::New => { + let output=std::process::Command::new("../rbxcompiler-linux-amd64") + .arg("--compile=false") + .arg("--group=6980477") + .arg("--new-asset=true") + .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) + .output()?; + match output.status.code() { + Some(0)=>{ + //print output + println!("{}", std::str::from_utf8(output.stdout.as_slice())?); + //move file + let mut dest=std::path::PathBuf::from("maps/uploaded"); + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + Some(code)=>println!("upload failed! code={}",code), + None => println!("no status code!"), + } + } } } Ok(()) From 110ec94a08acbe0f891d6df515c03a2475b674b0 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 16:21:30 -0700 Subject: [PATCH 043/125] v1.0.0 map tool implements some subset of operations at every step the map verification process from start to finish --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f133c07..a03cc49b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -264,7 +264,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "0.1.0" +version = "1.0.0" dependencies = [ "clap", "rbx_binary", diff --git a/Cargo.toml b/Cargo.toml index 3427a0b5..ffefc674 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "0.1.0" +version = "1.0.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 54c26d6e1ed0ebe5c1d9eaca60a07aea80bd4755 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 16:23:50 -0700 Subject: [PATCH 044/125] ARE YOU STUPID --- src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 035d2d48..d94016e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -361,12 +361,10 @@ impl std::str::FromStr for UploadAction { Ok(Self::Skip) }else if s=="new\n"{ Ok(Self::New) + }else if let Ok(asset_id)=s[..s.len()-1].parse::(){ + Ok(Self::Upload(asset_id)) }else{ - if let Ok(asset_id)=s[..s.len()-1].parse::(){ - Ok(Self::Upload(asset_id)) - }else{ - Err(ParseUploadActionErr) - } + Err(ParseUploadActionErr) } } } From 8fd5618af2341d1c44596920a8c017b30e322a46 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 14 Sep 2023 17:05:22 -0700 Subject: [PATCH 045/125] tweak prompt --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d94016e1..810085ea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -381,7 +381,7 @@ fn upload() -> BoxResult<()>{ //Creator: [auto fill creator] //DisplayName: [auto fill DisplayName] //id: ["New" for blank because of my double enter key] - print!("Model name: {}\nCreator: {}\nDisplayName: {}\nAsset Id: ",modelname,creator,displayname); + print!("Model name: {}\nCreator: {}\nDisplayName: {}\nAction or Upload Asset Id: ",modelname,creator,displayname); std::io::Write::flush(&mut std::io::stdout())?; let upload_action; loop{ @@ -391,7 +391,7 @@ fn upload() -> BoxResult<()>{ upload_action=parsed_upload_action; break; }else{ - print!("Asset Id: "); + print!("Action or Upload Asset Id: "); std::io::Write::flush(&mut std::io::stdout())?; } } From 81e4a201bdcbc2744b70550fea94033681dcd547 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 15 Sep 2023 17:10:33 -0700 Subject: [PATCH 046/125] add delete to interactive upload --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 810085ea..acf0bad9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -352,6 +352,7 @@ enum UploadAction { Upload(u64), Skip, New, + Delete, } struct ParseUploadActionErr; impl std::str::FromStr for UploadAction { @@ -361,6 +362,8 @@ impl std::str::FromStr for UploadAction { Ok(Self::Skip) }else if s=="new\n"{ Ok(Self::New) + }else if s=="delete\n"{ + Ok(Self::Delete) }else if let Ok(asset_id)=s[..s.len()-1].parse::(){ Ok(Self::Upload(asset_id)) }else{ @@ -435,6 +438,7 @@ fn upload() -> BoxResult<()>{ None => println!("no status code!"), } } + UploadAction::Delete => std::fs::remove_file(file_thing.path())?, } } Ok(()) From 6efa811eb6488b23f8d59958952e5f301d06ce77 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 22 Sep 2023 14:21:22 -0700 Subject: [PATCH 047/125] generalize recursive_collect --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index acf0bad9..04c95299 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,13 +48,13 @@ fn class_is_a(class: &str, superclass: &str) -> bool { } return false } -fn recursive_collect_scripts(scripts: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance){ +fn recursive_collect_superclass(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, superclass: &str){ for &referent in instance.children() { if let Some(c) = dom.get_by_ref(referent) { - if class_is_a(c.class.as_str(), "LuaSourceContainer") { - scripts.push(c.referent());//copy ref + if class_is_a(c.class.as_str(), superclass) { + objects.push(c.referent());//copy ref } - recursive_collect_scripts(scripts,dom,c); + recursive_collect_superclass(objects,dom,c,superclass); } } } @@ -89,7 +89,7 @@ fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance) -> fn get_script_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ let mut scripts = std::vec::Vec::new(); - recursive_collect_scripts(&mut scripts, dom, dom.root()); + recursive_collect_superclass(&mut scripts, dom, dom.root(),"LuaSourceContainer"); scripts } From 9904b7a044a4074f46d009c471661266dd873c6c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 22 Sep 2023 14:22:44 -0700 Subject: [PATCH 048/125] switch extract to pathbuf --- src/main.rs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/main.rs b/src/main.rs index 04c95299..bcb04fcd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,14 +21,14 @@ enum Commands { Download(MapList), Upload, Scan, - Extract(Map), + Extract(PathBufList), Replace, Interactive, } #[derive(Args)] -struct Map { - id:u64, +struct PathBufList { + paths:Vec } #[derive(Args)] @@ -259,19 +259,15 @@ fn scan() -> BoxResult<()>{ std::fs::write("id",id.to_string())?; Ok(()) } -fn extract(file_id:u64) -> BoxResult<()>{ + +fn extract(paths: Vec) -> BoxResult<()>{ let mut id = 0; //Construct allowed scripts let mut script_set = std::collections::HashSet::::new(); - let file_id_string=file_id.to_string(); - - for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - if file_thing.file_name().to_str().unwrap().find(&file_id_string).is_none(){ - continue; - } - let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + for path in paths { + let file_name=path.file_name(); + let input = std::io::BufReader::new(std::fs::File::open(&path)?); let dom = rbx_binary::from_reader(input)?; @@ -285,11 +281,11 @@ fn extract(file_id:u64) -> BoxResult<()>{ continue; }else{ script_set.insert(s.clone()); - std::fs::write(format!("scripts/extracted/{:?}_{}_{}.lua",file_thing.file_name(),id,script.name),s)?; + std::fs::write(format!("scripts/extracted/{:?}_{}_{}.lua",file_name,id,script.name),s)?; id+=1; } }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); + panic!("FATAL: failed to get source for {:?}",file_name); } }else{ panic!("FATAL: failed to get_by_ref {:?}",script_ref); @@ -658,6 +654,6 @@ fn main() -> BoxResult<()> { Commands::Scan=>scan(), Commands::Replace=>replace(), Commands::Interactive=>interactive(), - Commands::Extract(map)=>extract(map.id), + Commands::Extract(pathlist)=>extract(pathlist.paths), } } From 19a455ee5e0b01af2b02ef566364bd6f8bdaa436 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 22 Sep 2023 14:23:29 -0700 Subject: [PATCH 049/125] print wget exit status --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index bcb04fcd..d9fc3c23 100644 --- a/src/main.rs +++ b/src/main.rs @@ -189,8 +189,9 @@ fn download(map_list: Vec) -> BoxResult<()>{ .spawn() }).collect(); //naively wait for all because idk how to make an async progress bar lmao - for mut child in processes_result?{ - child.wait()?; + for child in processes_result?{ + let output=child.wait_with_output()?; + println!("map exit_success:{}",output.status.success()); } Ok(()) } From 34b6a869f03d2390f57575cf5c365dafd9a87899 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 22 Sep 2023 14:24:28 -0700 Subject: [PATCH 050/125] add download textures command --- Cargo.lock | 45 +++++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index a03cc49b..037e9322 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +dependencies = [ + "memchr", +] + [[package]] name = "anstream" version = "0.5.0" @@ -270,8 +279,15 @@ dependencies = [ "rbx_binary", "rbx_dom_weak", "rbx_reflection_database", + "regex", ] +[[package]] +name = "memchr" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" + [[package]] name = "num-traits" version = "0.2.16" @@ -423,6 +439,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "regex" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "rmp" version = "0.8.12" diff --git a/Cargo.toml b/Cargo.toml index ffefc674..162d1efe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ clap = { version = "4.4.2", features = ["derive"] } rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" +regex = "1.9.5" [profile.release] lto = true diff --git a/src/main.rs b/src/main.rs index d9fc3c23..1a8a5bc5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,6 +19,7 @@ struct Cli { #[derive(Subcommand)] enum Commands { Download(MapList), + DownloadTextures(PathBufList), Upload, Scan, Extract(PathBufList), @@ -92,6 +93,14 @@ fn get_script_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ recursive_collect_superclass(&mut scripts, dom, dom.root(),"LuaSourceContainer"); scripts } +fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ + let mut objects = std::vec::Vec::new(); + recursive_collect_superclass(&mut objects, dom, dom.root(),"Decal"); + //get ids + //clear vec + //next class + objects +} fn get_id() -> BoxResult{ match std::fs::read_to_string("id"){ @@ -196,6 +205,92 @@ fn download(map_list: Vec) -> BoxResult<()>{ Ok(()) } +struct RobloxAssetId(u64); +struct RobloxAssetIdParseErr; +impl std::str::FromStr for RobloxAssetId { + type Err=RobloxAssetIdParseErr; + fn from_str(s: &str) -> Result{ + let regman=regex::Regex::new(r"(\d+)$").unwrap(); + if let Some(captures) = regman.captures(s) { + if captures.len()==2{//captures[0] is all captures concatenated, and then each individual capture + if let Ok(id) = captures[0].parse::() { + return Ok(Self(id)); + } + } + } + Err(RobloxAssetIdParseErr) + } +} +/* The ones I'm interested in: +Beam.Texture +Decal.Texture +FileMesh.MeshId +FileMesh.TextureId +MaterialVariant.ColorMap +MaterialVariant.MetalnessMap +MaterialVariant.NormalMap +MaterialVariant.RoughnessMap +MeshPart.MeshId +MeshPart.TextureID +ParticleEmitter.Texture +Sky.MoonTextureId +Sky.SkyboxBk +Sky.SkyboxDn +Sky.SkyboxFt +Sky.SkyboxLf +Sky.SkyboxRt +Sky.SkyboxUp +Sky.SunTextureId +SurfaceAppearance.ColorMap +SurfaceAppearance.MetalnessMap +SurfaceAppearance.NormalMap +SurfaceAppearance.RoughnessMap +SurfaceAppearance.TexturePack +*/ +fn download_textures(paths: Vec) -> BoxResult<()>{ + println!("download_textures paths:{:?}",paths); + let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); + let shared_args=&[ + "-q", + "--header", + header.as_str(), + "-O", + ]; + let mut texture_list=std::collections::HashSet::new(); + for path in paths { + let input = std::io::BufReader::new(std::fs::File::open(path)?); + + let dom = rbx_binary::from_reader(input)?; + + let object_refs = get_texture_refs(&dom); + + for &object_ref in object_refs.iter() { + if let Some(object)=dom.get_by_ref(object_ref){ + if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("Texture") { + println!("Texture content:{:?}",content); + if let Ok(asset_id)=content.clone().into_string().parse::(){ + texture_list.insert(asset_id.0); + } + } + } + } + } + println!("Texture list:{:?}",texture_list); + let processes_result:Result, _>=texture_list.iter().map(|asset_id|{ + std::process::Command::new("wget") + .args(shared_args) + .arg(format!("textures/{}",asset_id)) + .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) + .spawn() + }).collect(); + //naively wait for all because idk how to make an async progress bar lmao + for child in processes_result?{ + let output=child.wait_with_output()?; + println!("texture exit_success:{}",output.status.success()); + } + Ok(()) +} + enum Scan{ Passed, Blocked, @@ -651,6 +746,7 @@ fn main() -> BoxResult<()> { let cli = Cli::parse(); match cli.command { Commands::Download(map_list)=>download(map_list.maps), + Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), Commands::Upload=>upload(), Commands::Scan=>scan(), Commands::Replace=>replace(), From 479dd37f53b0850ecc994904fd1f8057f4f9f2c2 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 22 Sep 2023 14:27:06 -0700 Subject: [PATCH 051/125] v1.1.0 download-textures --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 037e9322..0713444d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.0.0" +version = "1.1.0" dependencies = [ "clap", "rbx_binary", diff --git a/Cargo.toml b/Cargo.toml index 162d1efe..511c6c3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.0.0" +version = "1.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 53539f290b12fd0895a920555131341acd9cd861 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 23 Sep 2023 13:07:52 -0700 Subject: [PATCH 052/125] print map file --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 1a8a5bc5..02fe4659 100644 --- a/src/main.rs +++ b/src/main.rs @@ -468,6 +468,7 @@ fn upload() -> BoxResult<()>{ //interactive prompt per upload: for entry in std::fs::read_dir("maps/passed")? { let file_thing=entry?; + println!("map file: {:?}",file_thing.file_name()); let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); let dom = rbx_binary::from_reader(input)?; From 3a3749eaebd6755090fc930b71322d0b64073d68 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 28 Sep 2023 22:05:00 -0700 Subject: [PATCH 053/125] add deps image, gzip (flate2), image_dds --- Cargo.lock | 856 ++++++++++++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 3 + 2 files changed, 850 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0713444d..f0ebdb1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" version = "1.1.1" @@ -11,6 +17,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + [[package]] name = "anstream" version = "0.5.0" @@ -71,6 +86,17 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -83,6 +109,46 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "bcndecode-sys" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc29cbe4fdd4e9fef0cc6cacab9239a5d0a3dc822733c8fb8e1dd21868d0ab2" +dependencies = [ + "bindgen", + "cc", +] + +[[package]] +name = "bindgen" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5" +dependencies = [ + "bitflags", + "cexpr", + "cfg-if 0.1.10", + "clang-sys", + "clap 2.34.0", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "which", +] + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + [[package]] name = "bitflags" version = "1.3.2" @@ -98,7 +164,7 @@ dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if", + "cfg-if 1.0.0", "constant_time_eq", "digest", ] @@ -112,6 +178,32 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + [[package]] name = "byteorder" version = "1.4.3" @@ -127,12 +219,53 @@ dependencies = [ "libc", ] +[[package]] +name = "cexpr" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim 0.8.0", + "textwrap", + "unicode-width", + "vec_map", +] + [[package]] name = "clap" version = "4.4.2" @@ -152,7 +285,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.10.0", ] [[package]] @@ -164,7 +297,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.31", ] [[package]] @@ -173,6 +306,12 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "colorchoice" version = "1.0.0" @@ -185,6 +324,54 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -195,6 +382,17 @@ dependencies = [ "typenum", ] +[[package]] +name = "ddsfile" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "594ecd967c2f40db5dde8da4c356975fc1fe030e951c7c3962f6dc2e80042e87" +dependencies = [ + "bitflags", + "byteorder", + "enum_primitive", +] + [[package]] name = "digest" version = "0.10.7" @@ -206,6 +404,94 @@ dependencies = [ "subtle", ] +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "enum_primitive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" +dependencies = [ + "num-traits 0.1.43", +] + +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "exr" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279d3efcc55e19917fff7ab3ddd6c14afb6a90881a0078465196fe2f99d08c56" +dependencies = [ + "bit_field", + "flume", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[package]] +name = "fdeflate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + [[package]] name = "generic-array" version = "0.14.7" @@ -222,9 +508,38 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", + "js-sys", "libc", "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "half" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "bytemuck", + "cfg-if 1.0.0", + "crunchy", ] [[package]] @@ -233,18 +548,146 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error", +] + +[[package]] +name = "image" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder", + "num-rational", + "num-traits 0.2.16", + "png", + "qoi", + "tiff", +] + +[[package]] +name = "image_dds" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6428a49d7bd80467bbfea4ffd85a3ce80174eb1c6d36ac060bc81f85907a48" +dependencies = [ + "bcndecode-sys", + "bytemuck", + "ddsfile", + "half", + "image", + "intel_tex_2", + "strum", + "thiserror", +] + +[[package]] +name = "intel_tex_2" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8183b892d72cefc079675302f0e69658fe8dec871f5551f556c65b394b63ccbf" +dependencies = [ + "ispc_rt", +] + +[[package]] +name = "ispc_rt" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e0220406fa868139b6368b69f66118d211ec927a88ba41909622e67f08a11de" +dependencies = [ + "libc", + "num_cpus", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +dependencies = [ + "rayon", +] + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + [[package]] name = "libc" version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +dependencies = [ + "cc", + "winapi", +] + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.20" @@ -275,7 +718,10 @@ dependencies = [ name = "map-tool" version = "1.1.0" dependencies = [ - "clap", + "clap 4.4.2", + "flate2", + "image", + "image_dds", "rbx_binary", "rbx_dom_weak", "rbx_reflection_database", @@ -288,6 +734,74 @@ version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] + +[[package]] +name = "nom" +version = "5.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" +dependencies = [ + "memchr", + "version_check", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits 0.2.16", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits 0.2.16", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.16", +] + [[package]] name = "num-traits" version = "0.2.16" @@ -297,12 +811,67 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.3", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + [[package]] name = "paste" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "png" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +dependencies = [ + "bitflags", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -334,9 +903,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74c55e9e629af5298a40e0fa106435b2da30484c4ec76b41d19bc4d00dd8b903" dependencies = [ "quote", - "syn", + "syn 2.0.31", ] +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.33" @@ -376,6 +960,26 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "rbx_binary" version = "0.7.1" @@ -475,7 +1079,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" dependencies = [ "byteorder", - "num-traits", + "num-traits 0.2.16", "paste", ] @@ -490,6 +1094,24 @@ dependencies = [ "serde", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "serde" version = "1.0.188" @@ -507,21 +1129,87 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.31", ] +[[package]] +name = "shlex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + [[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + [[package]] name = "subtle" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.31" @@ -533,6 +1221,24 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "termcolor" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + [[package]] name = "thiserror" version = "1.0.48" @@ -550,7 +1256,18 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.31", +] + +[[package]] +name = "tiff" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", ] [[package]] @@ -565,12 +1282,24 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + [[package]] name = "utf8parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + [[package]] name = "version_check" version = "0.9.4" @@ -583,6 +1312,106 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.31", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + +[[package]] +name = "which" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" +dependencies = [ + "libc", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-sys" version = "0.48.0" @@ -648,3 +1477,12 @@ name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] diff --git a/Cargo.toml b/Cargo.toml index 511c6c3f..16941f40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,9 @@ edition = "2021" [dependencies] clap = { version = "4.4.2", features = ["derive"] } +flate2 = "1.0.27" +image = "0.24.7" +image_dds = "0.1.1" rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" From 85536257382d995cea85b43cde769688ef7fea40 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 28 Sep 2023 22:05:25 -0700 Subject: [PATCH 054/125] change texture download path --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 02fe4659..df1cf2e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -279,7 +279,7 @@ fn download_textures(paths: Vec) -> BoxResult<()>{ let processes_result:Result, _>=texture_list.iter().map(|asset_id|{ std::process::Command::new("wget") .args(shared_args) - .arg(format!("textures/{}",asset_id)) + .arg(format!("textures/unprocessed/{}",asset_id)) .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) .spawn() }).collect(); From 4417bafc5cc5b7c4e0ebbcc2b5047b8796aedf12 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 28 Sep 2023 22:06:27 -0700 Subject: [PATCH 055/125] naive multithreaded convert downloaded textures to dds --- src/main.rs | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/src/main.rs b/src/main.rs index df1cf2e6..f4ee1d1f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +use std::io::{Read, Seek}; + use clap::{Args, Parser, Subcommand}; mod error; @@ -20,6 +22,7 @@ struct Cli { enum Commands { Download(MapList), DownloadTextures(PathBufList), + ConvertTextures, Upload, Scan, Extract(PathBufList), @@ -291,6 +294,81 @@ fn download_textures(paths: Vec) -> BoxResult<()>{ Ok(()) } +fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut fourcc=[0u8;4]; + input.read_exact(&mut fourcc)?; + input.rewind()?; + + let mut extracted_input=None; + let image=if&fourcc==b"\x89PNG"{ + image::load(input,image::ImageFormat::Png)?.to_rgba8() + }else if &fourcc[0..2]==b"\x1f\x8b"{ + //gzip + let mut extracted:Vec=Vec::new(); + flate2::read::GzDecoder::new(input).read_to_end(&mut extracted)?; + extracted_input=Some(extracted.clone()); + image::load(std::io::Cursor::new(extracted),image::ImageFormat::Png)?.to_rgba8() + }else{ + Err(error::Error::new("Unknown texture format"))? + }; + + let dds = image_dds::dds_from_image( + &image, + image_dds::ImageFormat::BC7Unorm, + image_dds::Quality::Slow, + image_dds::Mipmaps::GeneratedAutomatic, + )?; + + //write dds + let mut dest=std::path::PathBuf::from("textures/dds"); + dest.push(file_thing.file_name()); + dest.set_extension("dds"); + let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); + dds.write(&mut writer)?; + + if let Some(mut extracted)=extracted_input{ + //write extracted to processed + let mut dest=std::path::PathBuf::from("textures/processed"); + dest.push(file_thing.file_name()); + std::fs::write(dest, &mut extracted)?; + //delete ugly gzip file + std::fs::remove_file(file_thing.path())?; + }else{ + //move file to processed + let mut dest=std::path::PathBuf::from("textures/processed"); + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + Ok(()) +} +fn convert_textures() -> BoxResult<()>{ + let start = std::time::Instant::now(); + let mut threads=Vec::new(); + for entry in std::fs::read_dir("textures/unprocessed")? { + let file_thing=entry?; + threads.push(std::thread::spawn(move ||{ + let file_name=file_thing.file_name(); + let result=convert(file_thing); + if let Err(e)=result{ + println!("error processing file:{:?} error message:{:?}",file_name,e); + } + })); + } + let mut i=0; + let n_threads=threads.len(); + for thread in threads{ + i+=1; + if let Err(e)=thread.join(){ + println!("thread error: {:?}",e); + }else{ + println!("{}/{}",i,n_threads); + } + } + println!("{:?}", start.elapsed()); + Ok(()) +} + enum Scan{ Passed, Blocked, @@ -748,6 +826,7 @@ fn main() -> BoxResult<()> { match cli.command { Commands::Download(map_list)=>download(map_list.maps), Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), + Commands::ConvertTextures=>convert_textures(), Commands::Upload=>upload(), Commands::Scan=>scan(), Commands::Replace=>replace(), From 45e8e415d0ae0750fa0c4abe1466e6fff3442c1d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 28 Sep 2023 23:02:39 -0700 Subject: [PATCH 056/125] v1.2.0 convert-textures gzip no workie yet some pngs upset the decoder lib --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f0ebdb1f..259aecb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -716,7 +716,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.1.0" +version = "1.2.0" dependencies = [ "clap 4.4.2", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 16941f40..466bf288 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.1.0" +version = "1.2.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 01524146c7d45d0a8568c35aa17f8d96ebece35c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 28 Sep 2023 23:00:22 -0700 Subject: [PATCH 057/125] fixme --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index f4ee1d1f..aef4c3f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -313,6 +313,7 @@ fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ Err(error::Error::new("Unknown texture format"))? }; + //this fails if the image dimensions are not a multiple of 4 let dds = image_dds::dds_from_image( &image, image_dds::ImageFormat::BC7Unorm, From de7b0bd5cc38b169b38b2d15b774510bec093bce Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 29 Sep 2023 03:14:29 -0700 Subject: [PATCH 058/125] stop failing when maps are corrupted while downloading textures --- src/main.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index aef4c3f5..92940bcd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -261,21 +261,23 @@ fn download_textures(paths: Vec) -> BoxResult<()>{ ]; let mut texture_list=std::collections::HashSet::new(); for path in paths { - let input = std::io::BufReader::new(std::fs::File::open(path)?); + let input = std::io::BufReader::new(std::fs::File::open(path.clone())?); - let dom = rbx_binary::from_reader(input)?; - - let object_refs = get_texture_refs(&dom); - - for &object_ref in object_refs.iter() { - if let Some(object)=dom.get_by_ref(object_ref){ - if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("Texture") { - println!("Texture content:{:?}",content); - if let Ok(asset_id)=content.clone().into_string().parse::(){ - texture_list.insert(asset_id.0); + match rbx_binary::from_reader(input){ + Ok(dom)=>{ + let object_refs = get_texture_refs(&dom); + for &object_ref in object_refs.iter() { + if let Some(object)=dom.get_by_ref(object_ref){ + if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("Texture") { + println!("Texture content:{:?}",content); + if let Ok(asset_id)=content.clone().into_string().parse::(){ + texture_list.insert(asset_id.0); + } + } } } - } + }, + Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), } } println!("Texture list:{:?}",texture_list); From d670d4129e950d6a1dc61dadb3e65c5710c245be Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 29 Sep 2023 13:27:23 -0700 Subject: [PATCH 059/125] use srgb --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 92940bcd..fc9d48bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -318,7 +318,7 @@ fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ //this fails if the image dimensions are not a multiple of 4 let dds = image_dds::dds_from_image( &image, - image_dds::ImageFormat::BC7Unorm, + image_dds::ImageFormat::BC7Srgb, image_dds::Quality::Slow, image_dds::Mipmaps::GeneratedAutomatic, )?; From 20a568220af48c1ff9310d22fd2644dce36bff41 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 29 Sep 2023 18:07:44 -0700 Subject: [PATCH 060/125] use plain format if image is not the right shape --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index fc9d48bd..18dfbb99 100644 --- a/src/main.rs +++ b/src/main.rs @@ -315,10 +315,15 @@ fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ Err(error::Error::new("Unknown texture format"))? }; + let format=if image.width()%4!=0||image.height()%4!=0{ + image_dds::ImageFormat::R8G8B8A8Srgb + }else{ + image_dds::ImageFormat::BC7Srgb + }; //this fails if the image dimensions are not a multiple of 4 let dds = image_dds::dds_from_image( &image, - image_dds::ImageFormat::BC7Srgb, + format, image_dds::Quality::Slow, image_dds::Mipmaps::GeneratedAutomatic, )?; From 0d5b918ea17d19954a9c689122a707cd12f43837 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 30 Sep 2023 03:14:02 -0700 Subject: [PATCH 061/125] add rbx_xml dep --- Cargo.lock | 21 +++++++++++++++++++++ Cargo.toml | 1 + 2 files changed, 22 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 259aecb2..5a332de1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -725,6 +725,7 @@ dependencies = [ "rbx_binary", "rbx_dom_weak", "rbx_reflection_database", + "rbx_xml", "regex", ] @@ -1043,6 +1044,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "rbx_xml" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bc65b70827519fdc4ab47416d1085b912f087fadab9ed415471b6daba635574" +dependencies = [ + "base64", + "log", + "rbx_dom_weak", + "rbx_reflection", + "rbx_reflection_database", + "xml-rs", +] + [[package]] name = "regex" version = "1.9.5" @@ -1478,6 +1493,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + [[package]] name = "zune-inflate" version = "0.2.54" diff --git a/Cargo.toml b/Cargo.toml index 466bf288..4f33a931 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ image_dds = "0.1.1" rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" +rbx_xml = "0.13.1" regex = "1.9.5" [profile.release] From 07f6053839e48a514b10f1dd263641509ec01daf Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 30 Sep 2023 03:13:52 -0700 Subject: [PATCH 062/125] multiplex roblox format --- src/main.rs | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index 18dfbb99..5bc10f34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,6 +105,24 @@ fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec objects } +fn get_dom(input:&mut R)->Result{ + let mut first_8=[0u8;8]; + if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_8),std::io::Seek::rewind(input)){ + match &first_8[0..4]{ + b"{ + match &first_8[4..8]{ + b"lox!"=>rbx_binary::from_reader(input).map_err(|e|format!("{:?}",e)), + b"lox "=>rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(|e|format!("{:?}",e)), + other=>Err(format!("Unknown Roblox file type {:?}",other)), + } + } + _=>Err("unsupported file type".to_owned()), + } + }else{ + Err("peek failed".to_owned()) + } +} + fn get_id() -> BoxResult{ match std::fs::read_to_string("id"){ Ok(id_file)=>Ok(id_file.parse::()?), @@ -261,9 +279,9 @@ fn download_textures(paths: Vec) -> BoxResult<()>{ ]; let mut texture_list=std::collections::HashSet::new(); for path in paths { - let input = std::io::BufReader::new(std::fs::File::open(path.clone())?); + let mut input = std::io::BufReader::new(std::fs::File::open(path.clone())?); - match rbx_binary::from_reader(input){ + match get_dom(&mut input){ Ok(dom)=>{ let object_refs = get_texture_refs(&dom); for &object_ref in object_refs.iter() { @@ -391,9 +409,9 @@ fn scan() -> BoxResult<()>{ for entry in std::fs::read_dir("maps/unprocessed")? { let file_thing=entry?; - let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let dom = rbx_binary::from_reader(input)?; + let dom = get_dom(&mut input)?; let script_refs = get_script_refs(&dom); @@ -449,9 +467,9 @@ fn extract(paths: Vec) -> BoxResult<()>{ for path in paths { let file_name=path.file_name(); - let input = std::io::BufReader::new(std::fs::File::open(&path)?); + let mut input = std::io::BufReader::new(std::fs::File::open(&path)?); - let dom = rbx_binary::from_reader(input)?; + let dom = get_dom(&mut input)?; let script_refs = get_script_refs(&dom); @@ -484,8 +502,8 @@ fn replace() -> BoxResult<()>{ for entry in std::fs::read_dir("maps/blocked")? { let file_thing=entry?; - let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut dom = rbx_binary::from_reader(input)?; + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut dom = get_dom(&mut input)?; let script_refs = get_script_refs(&dom); @@ -555,9 +573,9 @@ fn upload() -> BoxResult<()>{ for entry in std::fs::read_dir("maps/passed")? { let file_thing=entry?; println!("map file: {:?}",file_thing.file_name()); - let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let dom = rbx_binary::from_reader(input)?; + let dom = get_dom(&mut input)?; let (modelname,creator,displayname) = get_mapinfo(&dom)?; //Creator: [auto fill creator] @@ -670,8 +688,8 @@ fn interactive() -> BoxResult<()>{ 'map_loop: for entry in std::fs::read_dir("maps/unprocessed")? { let file_thing=entry?; println!("processing map={:?}",file_thing.file_name()); - let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut dom = rbx_binary::from_reader(input)?; + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut dom = get_dom(&mut input)?; let script_refs = get_script_refs(&dom); From bd2e3aa2d371b36b48981a2467cf73db96087055 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 30 Sep 2023 03:15:57 -0700 Subject: [PATCH 063/125] v1.3.0 srgb textures + non mod 4 images export to uncompressed + rbxmx support --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a332de1..76f559c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -716,7 +716,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.2.0" +version = "1.3.0" dependencies = [ "clap 4.4.2", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 4f33a931..23b6367b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.2.0" +version = "1.3.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 9cb34f14c803270cc7879a926db6f6e4a17eaeb9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 30 Sep 2023 03:38:34 -0700 Subject: [PATCH 064/125] fixme --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5bc10f34..2c365f22 100644 --- a/src/main.rs +++ b/src/main.rs @@ -322,7 +322,7 @@ fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ let mut extracted_input=None; let image=if&fourcc==b"\x89PNG"{ - image::load(input,image::ImageFormat::Png)?.to_rgba8() + image::load(input,image::ImageFormat::Png)?.to_rgba8()//this is setting a=0? }else if &fourcc[0..2]==b"\x1f\x8b"{ //gzip let mut extracted:Vec=Vec::new(); From a2b793fcd3762dddb1d60f0f8b53cd3a8559f761 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sun, 1 Oct 2023 20:07:11 -0700 Subject: [PATCH 065/125] add anyhow dep --- Cargo.lock | 7 +++++++ Cargo.toml | 1 + 2 files changed, 8 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 76f559c4..26d42ef6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,6 +74,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + [[package]] name = "arrayref" version = "0.3.7" @@ -718,6 +724,7 @@ dependencies = [ name = "map-tool" version = "1.3.0" dependencies = [ + "anyhow", "clap 4.4.2", "flate2", "image", diff --git a/Cargo.toml b/Cargo.toml index 23b6367b..b91cea94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +anyhow = "1.0.75" clap = { version = "4.4.2", features = ["derive"] } flate2 = "1.0.27" image = "0.24.7" From d6dd1b8abde133d357524fa675e46291976f9309 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sun, 1 Oct 2023 20:07:34 -0700 Subject: [PATCH 066/125] drop Jeftai Error, convert errors to anyhow --- src/error.rs | 21 ----------------- src/main.rs | 64 ++++++++++++++++++++++---------------------------- src/prelude.rs | 18 -------------- 3 files changed, 28 insertions(+), 75 deletions(-) delete mode 100644 src/error.rs delete mode 100644 src/prelude.rs diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index eac64752..00000000 --- a/src/error.rs +++ /dev/null @@ -1,21 +0,0 @@ -#[derive(Debug)] -pub struct Error { - pub message: String, -} - -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "{}", self.message) - } -} - -impl std::error::Error for Error {} - -impl Error { - // has to be Box to fit with the result in prelude.rs - pub fn new(message: &str) -> Box { - Box::new(Self { - message: message.to_string(), - }) - } -} diff --git a/src/main.rs b/src/main.rs index 2c365f22..657dad4b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,14 +1,6 @@ use std::io::{Read, Seek}; - use clap::{Args, Parser, Subcommand}; - -mod error; -mod prelude; - -// this * means we are importing everything from the prelude module and in turn we overwrite the default `Result` with our own -// if you want the original back you can use StdResult or just std::result::Result -// using the new result also means the error type is implicitly Box (works for any errors that implement the std::error::Error trait) -use crate::prelude::*; +use anyhow::Result as AResult; #[derive(Parser)] #[command(author, version, about, long_about = None)] @@ -105,25 +97,25 @@ fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec objects } -fn get_dom(input:&mut R)->Result{ +fn get_dom(input:&mut R)->AResult{ let mut first_8=[0u8;8]; if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_8),std::io::Seek::rewind(input)){ match &first_8[0..4]{ b"{ match &first_8[4..8]{ - b"lox!"=>rbx_binary::from_reader(input).map_err(|e|format!("{:?}",e)), - b"lox "=>rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(|e|format!("{:?}",e)), - other=>Err(format!("Unknown Roblox file type {:?}",other)), + b"lox!"=>return rbx_binary::from_reader(input).map_err(anyhow::Error::msg), + b"lox "=>return rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), + other=>Err(anyhow::Error::msg(format!("Unknown Roblox file type {:?}",other))), } } - _=>Err("unsupported file type".to_owned()), + _=>Err(anyhow::Error::msg("unsupported file type")), } }else{ - Err("peek failed".to_owned()) + Err(anyhow::Error::msg("peek failed")) } } -fn get_id() -> BoxResult{ +fn get_id() -> AResult{ match std::fs::read_to_string("id"){ Ok(id_file)=>Ok(id_file.parse::()?), Err(e) => match e.kind() { @@ -133,7 +125,7 @@ fn get_id() -> BoxResult{ } } -fn get_set_from_file(file:&str) -> BoxResult>{ +fn get_set_from_file(file:&str) -> AResult>{ let mut set=std::collections::HashSet::::new(); for entry in std::fs::read_dir(file)? { set.insert(std::fs::read_to_string(entry?.path())?); @@ -141,15 +133,15 @@ fn get_set_from_file(file:&str) -> BoxResult>{ Ok(set) } -fn get_allowed_set() -> BoxResult>{ +fn get_allowed_set() -> AResult>{ get_set_from_file("scripts/allowed") } -fn get_blocked() -> BoxResult>{ +fn get_blocked() -> AResult>{ get_set_from_file("scripts/blocked") } -fn get_allowed_map() -> BoxResult>{ +fn get_allowed_map() -> AResult>{ let mut allowed_map = std::collections::HashMap::::new(); for entry in std::fs::read_dir("scripts/allowed")? { let entry=entry?; @@ -158,7 +150,7 @@ fn get_allowed_map() -> BoxResult>{ Ok(allowed_map) } -fn get_replace_map() -> BoxResult>{ +fn get_replace_map() -> AResult>{ let mut replace = std::collections::HashMap::::new(); for entry in std::fs::read_dir("scripts/replace")? { let entry=entry?; @@ -182,10 +174,10 @@ fn find_first_child_class<'a>(dom:&'a rbx_dom_weak::WeakDom,instance:&'a rbx_dom None } -fn get_mapinfo(dom:&rbx_dom_weak::WeakDom) -> BoxResult<(String,String,String)>{ +fn get_mapinfo(dom:&rbx_dom_weak::WeakDom) -> AResult<(String,String,String)>{ let workspace_children=dom.root().children(); if workspace_children.len()!=1{ - return Err(Error::new("there can only be one model")); + return Err(anyhow::Error::msg("there can only be one model")); } if let Some(model_instance) = dom.get_by_ref(workspace_children[0]) { if let (Some(creator),Some(displayname))=(find_first_child_class(dom, model_instance, "Creator", "StringValue"),find_first_child_class(dom, model_instance, "DisplayName", "StringValue")){ @@ -200,10 +192,10 @@ fn get_mapinfo(dom:&rbx_dom_weak::WeakDom) -> BoxResult<(String,String,String)>{ } } } - return Err(Error::new("no stuff in map")); + return Err(anyhow::Error::msg("no stuff in map")); } -fn download(map_list: Vec) -> BoxResult<()>{ +fn download(map_list: Vec) -> AResult<()>{ let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); let shared_args=&[ "-q", @@ -268,7 +260,7 @@ SurfaceAppearance.NormalMap SurfaceAppearance.RoughnessMap SurfaceAppearance.TexturePack */ -fn download_textures(paths: Vec) -> BoxResult<()>{ +fn download_textures(paths: Vec) -> AResult<()>{ println!("download_textures paths:{:?}",paths); let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); let shared_args=&[ @@ -314,7 +306,7 @@ fn download_textures(paths: Vec) -> BoxResult<()>{ Ok(()) } -fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ +fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); let mut fourcc=[0u8;4]; input.read_exact(&mut fourcc)?; @@ -330,7 +322,7 @@ fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ extracted_input=Some(extracted.clone()); image::load(std::io::Cursor::new(extracted),image::ImageFormat::Png)?.to_rgba8() }else{ - Err(error::Error::new("Unknown texture format"))? + return Err(anyhow::Error::msg("Unknown texture format")); }; let format=if image.width()%4!=0||image.height()%4!=0{ @@ -368,7 +360,7 @@ fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ } Ok(()) } -fn convert_textures() -> BoxResult<()>{ +fn convert_textures() -> AResult<()>{ let start = std::time::Instant::now(); let mut threads=Vec::new(); for entry in std::fs::read_dir("textures/unprocessed")? { @@ -401,7 +393,7 @@ enum Scan{ Flagged, } -fn scan() -> BoxResult<()>{ +fn scan() -> AResult<()>{ let mut id = get_id()?; //Construct allowed scripts let allowed_set = get_allowed_set()?; @@ -460,7 +452,7 @@ fn scan() -> BoxResult<()>{ Ok(()) } -fn extract(paths: Vec) -> BoxResult<()>{ +fn extract(paths: Vec) -> AResult<()>{ let mut id = 0; //Construct allowed scripts let mut script_set = std::collections::HashSet::::new(); @@ -495,7 +487,7 @@ fn extract(paths: Vec) -> BoxResult<()>{ println!("extracted {} {}",id,if id==1 {"script"}else{"scripts"}); Ok(()) } -fn replace() -> BoxResult<()>{ +fn replace() -> AResult<()>{ let allowed_map=get_allowed_map()?; let replace_map=get_replace_map()?; @@ -568,7 +560,7 @@ impl std::str::FromStr for UploadAction { } } -fn upload() -> BoxResult<()>{ +fn upload() -> AResult<()>{ //interactive prompt per upload: for entry in std::fs::read_dir("maps/passed")? { let file_thing=entry?; @@ -677,7 +669,7 @@ impl std::str::FromStr for ScriptActionParseResult { } } -fn interactive() -> BoxResult<()>{ +fn interactive() -> AResult<()>{ let mut id=get_id()?; //Construct allowed scripts let mut allowed_set=get_allowed_set()?; @@ -824,7 +816,7 @@ fn interactive() -> BoxResult<()>{ //write workspace:GetChildren()[1] let workspace_children=dom.root().children(); if workspace_children.len()!=1{ - return Err(Error::new("there can only be one model")); + return Err(anyhow::Error::msg("there can only be one model")); } rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; //move original to processed folder @@ -847,7 +839,7 @@ fn interactive() -> BoxResult<()>{ Ok(()) } -fn main() -> BoxResult<()> { +fn main() -> AResult<()> { let cli = Cli::parse(); match cli.command { Commands::Download(map_list)=>download(map_list.maps), diff --git a/src/prelude.rs b/src/prelude.rs deleted file mode 100644 index e4d7bac5..00000000 --- a/src/prelude.rs +++ /dev/null @@ -1,18 +0,0 @@ -pub use crate::error::Error; - -pub type BoxResult = std::result::Result>; - -// i just wanted to mess around with macros a bit -// so heres labelprint as a macro -#[macro_export] -macro_rules! lprint { - ($expr:expr) => {{ - let ___this_file = std::file!(); - let ___line = std::line!(); - // let ___column = column!(); - println!("[{}:{}] {}", ___this_file, ___line, $expr); - }}; - ($expr:expr, $($arg:tt)*) => {{ - lprint!(format!($expr, $($arg)*)); - }}; -} From e2a5edf8dfe4a69135cb3063d5a7de79e53dc8b9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 03:46:17 -0400 Subject: [PATCH 067/125] Fill in placeholder values Nobody told me I was chilling with placeholder values in my license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2071b23b..296c8bd9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) +Copyright (c) 2023 StrafesNET Map Tool Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: From e54400a43664dca8832ca2277e48c0948ecdd3d7 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 18:35:51 -0700 Subject: [PATCH 068/125] alphabetize for no reason --- src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 657dad4b..e04b7069 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,11 +15,11 @@ enum Commands { Download(MapList), DownloadTextures(PathBufList), ConvertTextures, - Upload, - Scan, Extract(PathBufList), - Replace, Interactive, + Replace, + Scan, + Upload, } #[derive(Args)] @@ -845,10 +845,10 @@ fn main() -> AResult<()> { Commands::Download(map_list)=>download(map_list.maps), Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), Commands::ConvertTextures=>convert_textures(), - Commands::Upload=>upload(), - Commands::Scan=>scan(), - Commands::Replace=>replace(), - Commands::Interactive=>interactive(), Commands::Extract(pathlist)=>extract(pathlist.paths), + Commands::Interactive=>interactive(), + Commands::Replace=>replace(), + Commands::Scan=>scan(), + Commands::Upload=>upload(), } } From 5dc69db885eabaacb02b181d4cd31866ec59f1a9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 18:38:26 -0700 Subject: [PATCH 069/125] extremely fancy code to transparently handle gzip --- src/main.rs | 66 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index e04b7069..88116e9d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -97,7 +97,24 @@ fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec objects } -fn get_dom(input:&mut R)->AResult{ +enum ReaderType<'a, R:Read+Seek>{ + GZip(flate2::read::GzDecoder<&'a mut R>), + Raw(&'a mut R), +} + +fn maybe_gzip_decode(input:&mut R)->AResult>{ + let mut first_2=[0u8;2]; + if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_2),std::io::Seek::rewind(input)){ + match &first_2{ + b"\x1f\x8b"=>Ok(ReaderType::GZip(flate2::read::GzDecoder::new(input))), + _=>Ok(ReaderType::Raw(input)), + } + }else{ + Err(anyhow::Error::msg("failed to peek")) + } +} + +fn load_dom(input:&mut R)->AResult{ let mut first_8=[0u8;8]; if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_8),std::io::Seek::rewind(input)){ match &first_8[0..4]{ @@ -115,6 +132,19 @@ fn get_dom(input:&mut R)->AResult{ } } +fn get_dom(input:&mut R)->AResult{ + match maybe_gzip_decode(input){ + Ok(ReaderType::GZip(mut readable)) => { + //gzip + let mut extracted:Vec=Vec::new(); + readable.read_to_end(&mut extracted)?; + Ok(load_dom(&mut std::io::Cursor::new(extracted))?) + }, + Ok(ReaderType::Raw(readable)) => Ok(load_dom(readable)?), + Err(e) => Err(e)?, + } +} + fn get_id() -> AResult{ match std::fs::read_to_string("id"){ Ok(id_file)=>Ok(id_file.parse::()?), @@ -306,24 +336,32 @@ fn download_textures(paths: Vec) -> AResult<()>{ Ok(()) } -fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); +fn load_image(input:&mut R)->AResult{ let mut fourcc=[0u8;4]; input.read_exact(&mut fourcc)?; input.rewind()?; + match &fourcc{ + b"\x89PNG"=>Ok(image::load(input,image::ImageFormat::Png)?), + _=>Err(anyhow::Error::msg("Unknown texture format")), + } +} + +fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); let mut extracted_input=None; - let image=if&fourcc==b"\x89PNG"{ - image::load(input,image::ImageFormat::Png)?.to_rgba8()//this is setting a=0? - }else if &fourcc[0..2]==b"\x1f\x8b"{ - //gzip - let mut extracted:Vec=Vec::new(); - flate2::read::GzDecoder::new(input).read_to_end(&mut extracted)?; - extracted_input=Some(extracted.clone()); - image::load(std::io::Cursor::new(extracted),image::ImageFormat::Png)?.to_rgba8() - }else{ - return Err(anyhow::Error::msg("Unknown texture format")); - }; + let image=match maybe_gzip_decode(&mut input){ + Ok(ReaderType::GZip(mut readable)) => { + //gzip + let mut extracted:Vec=Vec::new(); + //read the entire thing to the end so that I can clone the data and write a png to processed images + readable.read_to_end(&mut extracted)?; + extracted_input=Some(extracted.clone()); + load_image(&mut std::io::Cursor::new(extracted)) + }, + Ok(ReaderType::Raw(readable)) => load_image(readable), + Err(e) => Err(e)?, + }?.to_rgba8();//this is setting a=0? let format=if image.width()%4!=0||image.height()%4!=0{ image_dds::ImageFormat::R8G8B8A8Srgb From a57c228580b8e3630144cc16b342da0908f12626 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 18:38:30 -0700 Subject: [PATCH 070/125] styling --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 88116e9d..a700a19c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -124,7 +124,7 @@ fn load_dom(input:&mut R)->AResult{ b"lox "=>return rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), other=>Err(anyhow::Error::msg(format!("Unknown Roblox file type {:?}",other))), } - } + }, _=>Err(anyhow::Error::msg("unsupported file type")), } }else{ From fa69c53cfc9634b4f0cfd9a601905930867651a1 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 18:38:37 -0700 Subject: [PATCH 071/125] JPEG support --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index a700a19c..c994b9ec 100644 --- a/src/main.rs +++ b/src/main.rs @@ -342,6 +342,7 @@ fn load_image(input:&mut R)->AResultOk(image::load(input,image::ImageFormat::Png)?), + b"JPEG"=>Ok(image::load(input,image::ImageFormat::Jpeg)?), _=>Err(anyhow::Error::msg("Unknown texture format")), } } From ff85efa54f58b0e2c33fa516a8a428aaa7799e74 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 19:04:48 -0700 Subject: [PATCH 072/125] add unzip-all command --- src/main.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/main.rs b/src/main.rs index c994b9ec..b49f4741 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,6 +19,7 @@ enum Commands { Interactive, Replace, Scan, + UnzipAll, Upload, } @@ -878,6 +879,32 @@ fn interactive() -> AResult<()>{ Ok(()) } + +fn unzip_all()->AResult<()>{ + for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + println!("processing map={:?}",file_thing.file_name()); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + match maybe_gzip_decode(&mut input){ + Ok(ReaderType::GZip(mut readable)) => { + //gzip + let mut extracted:Vec=Vec::new(); + //read the entire thing to the end so that I can clone the data and write a png to processed images + readable.read_to_end(&mut extracted)?; + //write extracted + let mut dest=std::path::PathBuf::from("maps/unzipped"); + dest.push(file_thing.file_name()); + std::fs::write(dest, &mut extracted)?; + //delete ugly gzip file + std::fs::remove_file(file_thing.path())?; + }, + Ok(ReaderType::Raw(_)) => (), + Err(e) => Err(e)?, + } + } + Ok(()) +} + fn main() -> AResult<()> { let cli = Cli::parse(); match cli.command { @@ -888,6 +915,7 @@ fn main() -> AResult<()> { Commands::Interactive=>interactive(), Commands::Replace=>replace(), Commands::Scan=>scan(), + Commands::UnzipAll=>unzip_all(), Commands::Upload=>upload(), } } From afa9e7447d22869c736d57f7f56d2d7b127eea3b Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 19:55:10 -0700 Subject: [PATCH 073/125] print fourcc on unrecognized image format --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index b49f4741..b7b913df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -344,7 +344,7 @@ fn load_image(input:&mut R)->AResultOk(image::load(input,image::ImageFormat::Png)?), b"JPEG"=>Ok(image::load(input,image::ImageFormat::Jpeg)?), - _=>Err(anyhow::Error::msg("Unknown texture format")), + other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))), } } From 1727f9213c971348dfbb3eb24518d713c6e806f5 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 19:55:22 -0700 Subject: [PATCH 074/125] it's actually jfif --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index b7b913df..81ebeb80 100644 --- a/src/main.rs +++ b/src/main.rs @@ -343,7 +343,7 @@ fn load_image(input:&mut R)->AResultOk(image::load(input,image::ImageFormat::Png)?), - b"JPEG"=>Ok(image::load(input,image::ImageFormat::Jpeg)?), + b"\xFF\xD8\xFF\xE0"=>Ok(image::load(input,image::ImageFormat::Jpeg)?),//JFIF other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))), } } From 422d0a160dab99344e09f45c35a3c3098746f260 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 19:55:32 -0700 Subject: [PATCH 075/125] print special message for roblox xml --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 81ebeb80..fdc73917 100644 --- a/src/main.rs +++ b/src/main.rs @@ -344,6 +344,7 @@ fn load_image(input:&mut R)->AResultOk(image::load(input,image::ImageFormat::Png)?), b"\xFF\xD8\xFF\xE0"=>Ok(image::load(input,image::ImageFormat::Jpeg)?),//JFIF + b"Err(anyhow::Error::msg("Roblox xml garbage is not supported yet")), other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))), } } From 6df1f41599183286e1f4aef4dfe24a9754709a2a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 19 Oct 2023 02:59:01 -0700 Subject: [PATCH 076/125] not a bug --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index fdc73917..645e0264 100644 --- a/src/main.rs +++ b/src/main.rs @@ -364,7 +364,7 @@ fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ }, Ok(ReaderType::Raw(readable)) => load_image(readable), Err(e) => Err(e)?, - }?.to_rgba8();//this is setting a=0? + }?.to_rgba8();//this sets a=255, arcane is actually supposed to look like that let format=if image.width()%4!=0||image.height()%4!=0{ image_dds::ImageFormat::R8G8B8A8Srgb From a7518bef46a14624e487c95aecf9ab20f6e9aafb Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 27 Oct 2023 18:10:05 -0700 Subject: [PATCH 077/125] print full path --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 645e0264..10ea31ea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -407,7 +407,7 @@ fn convert_textures() -> AResult<()>{ for entry in std::fs::read_dir("textures/unprocessed")? { let file_thing=entry?; threads.push(std::thread::spawn(move ||{ - let file_name=file_thing.file_name(); + let file_name=format!("{:?}",file_thing); let result=convert(file_thing); if let Err(e)=result{ println!("error processing file:{:?} error message:{:?}",file_name,e); From 36419af870a93684af6c95c8609c85d7f68abd5a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 27 Oct 2023 18:10:11 -0700 Subject: [PATCH 078/125] update deps --- Cargo.lock | 225 ++++++++++++++++++++--------------------------------- 1 file changed, 86 insertions(+), 139 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 26d42ef6..d18f4948 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", @@ -42,15 +42,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -66,9 +66,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys", @@ -163,25 +163,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if 1.0.0", "constant_time_eq", - "digest", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", ] [[package]] @@ -207,14 +197,14 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" @@ -274,9 +264,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" dependencies = [ "clap_builder", "clap_derive", @@ -284,9 +274,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" dependencies = [ "anstream", "anstyle", @@ -296,21 +286,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "color_quant" @@ -378,16 +368,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - [[package]] name = "ddsfile" version = "0.5.1" @@ -399,17 +379,6 @@ dependencies = [ "enum_primitive", ] -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - [[package]] name = "either" version = "1.9.0" @@ -465,9 +434,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -488,25 +457,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "getrandom" @@ -591,7 +550,7 @@ dependencies = [ "gif", "jpeg-decoder", "num-rational", - "num-traits 0.2.16", + "num-traits 0.2.17", "png", "qoi", "tiff", @@ -670,9 +629,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -686,9 +645,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -725,7 +684,7 @@ name = "map-tool" version = "1.3.0" dependencies = [ "anyhow", - "clap 4.4.2", + "clap 4.4.7", "flate2", "image", "image_dds", @@ -738,9 +697,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -787,7 +746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", - "num-traits 0.2.16", + "num-traits 0.2.17", ] [[package]] @@ -798,7 +757,7 @@ checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.16", + "num-traits 0.2.17", ] [[package]] @@ -807,14 +766,14 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.17", ] [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -864,7 +823,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -888,30 +847,30 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f10e75d83c7aec79a6aa46f897075890e156b105eebe51cfa0abce51af025f" +checksum = "f89dff0959d98c9758c88826cc002e2c3d0b9dfac4139711d1f30de442f1139b" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c55e9e629af5298a40e0fa106435b2da30484c4ec76b41d19bc4d00dd8b903" +checksum = "eb156a45b6b9fe8027497422179fb65afc84d36707a7ca98297bf06bccb8d43f" dependencies = [ "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -990,9 +949,9 @@ dependencies = [ [[package]] name = "rbx_binary" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e50573021d04b680018955662eba7dc4aac3de92219231798f6c9b41e38ab01" +checksum = "ad50c13afe91296dad6508ea7e29f4b665fa56cb664ad01eaf8fdbd3da69d5e1" dependencies = [ "log", "lz4", @@ -1005,9 +964,9 @@ dependencies = [ [[package]] name = "rbx_dom_weak" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161729449bbb0cfa657ce7bcca6a160d0af06d8b8d9efdc9abe14735dccacdb9" +checksum = "843a2e0e1446623625943f7228d9d4b5cf3883017e3964733600682506864b34" dependencies = [ "rbx_types", "serde", @@ -1015,9 +974,9 @@ dependencies = [ [[package]] name = "rbx_reflection" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08bd48487192046fec8f805f3fa29f3d7d5beb9890b0859b1a92bd8aff580343" +checksum = "41e762dfca3217d2d37da631de2fa0d1616edaa61a0a2633263d5d3305baf8c3" dependencies = [ "rbx_types", "serde", @@ -1026,9 +985,9 @@ dependencies = [ [[package]] name = "rbx_reflection_database" -version = "0.2.7+roblox-588" +version = "0.2.9+roblox-596" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be6cf674182806f11ad4899dd1feafe977591f1ae035ae05a58d4b74e487276" +checksum = "6b18f088a2b4aa66324ec97b5b6ffacb53188aef19f3497d95d6a1d1dbb28e66" dependencies = [ "lazy_static", "rbx_reflection", @@ -1038,9 +997,9 @@ dependencies = [ [[package]] name = "rbx_types" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "070106e926b8ae54c7bc443e5db4d868d7f0af51c1d7cfd7efe1364c1753d8a3" +checksum = "32a991523e3ad5f43a4d121cb4a1e5bc23f7826bb4a1db5aa51e94f1073150ec" dependencies = [ "base64", "bitflags", @@ -1053,9 +1012,9 @@ dependencies = [ [[package]] name = "rbx_xml" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc65b70827519fdc4ab47416d1085b912f087fadab9ed415471b6daba635574" +checksum = "fc87343301303ff0510903fb7eb3dbd1c75bdb6ab780fea6091bdc3f58b5829f" dependencies = [ "base64", "log", @@ -1067,9 +1026,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", @@ -1079,9 +1038,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -1090,9 +1049,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rmp" @@ -1101,7 +1060,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" dependencies = [ "byteorder", - "num-traits 0.2.16", + "num-traits 0.2.17", "paste", ] @@ -1136,22 +1095,22 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -1215,12 +1174,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - [[package]] name = "syn" version = "1.0.109" @@ -1234,9 +1187,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.31" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -1263,22 +1216,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -1292,17 +1245,11 @@ dependencies = [ "weezl", ] -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" @@ -1355,7 +1302,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -1377,7 +1324,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] From 35b5aff9a746374e6b99d9f92d2a5a06c4d714bb Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 9 Nov 2023 15:51:11 -0800 Subject: [PATCH 079/125] stop being cringe --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b91cea94..a41142b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ rbx_reflection_database = "0.2.7" rbx_xml = "0.13.1" regex = "1.9.5" -[profile.release] -lto = true -strip = true -codegen-units = 1 +#[profile.release] +#lto = true +#strip = true +#codegen-units = 1 From 43115cbac62ad1055479e2730c36adb2e82cb26e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 9 Nov 2023 15:51:23 -0800 Subject: [PATCH 080/125] mesh downloader --- src/main.rs | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/main.rs b/src/main.rs index 10ea31ea..8b6d61f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,7 @@ enum Commands { Download(MapList), DownloadTextures(PathBufList), ConvertTextures, + DownloadMeshes(PathBufList), Extract(PathBufList), Interactive, Replace, @@ -97,6 +98,15 @@ fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec //next class objects } +fn get_mesh_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ + let mut objects = std::vec::Vec::new(); + recursive_collect_superclass(&mut objects, dom, dom.root(),"FileMesh"); + recursive_collect_superclass(&mut objects, dom, dom.root(),"MeshPart"); + //get ids + //clear vec + //next class + objects +} enum ReaderType<'a, R:Read+Seek>{ GZip(flate2::read::GzDecoder<&'a mut R>), @@ -336,6 +346,51 @@ fn download_textures(paths: Vec) -> AResult<()>{ } Ok(()) } +fn download_meshes(paths: Vec) -> AResult<()>{ + println!("download_meshes paths:{:?}",paths); + let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); + let shared_args=&[ + "-q", + "--header", + header.as_str(), + "-O", + ]; + let mut mesh_list=std::collections::HashSet::new(); + for path in paths { + let mut input = std::io::BufReader::new(std::fs::File::open(path.clone())?); + + match get_dom(&mut input){ + Ok(dom)=>{ + let object_refs = get_mesh_refs(&dom); + for &object_ref in object_refs.iter() { + if let Some(object)=dom.get_by_ref(object_ref){ + if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("MeshId") { + println!("Mesh content:{:?}",content); + if let Ok(asset_id)=content.clone().into_string().parse::(){ + mesh_list.insert(asset_id.0); + } + } + } + } + }, + Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), + } + } + println!("Mesh list:{:?}",mesh_list); + let processes_result:Result, _>=mesh_list.iter().map(|asset_id|{ + std::process::Command::new("wget") + .args(shared_args) + .arg(format!("meshes/unprocessed/{}",asset_id)) + .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) + .spawn() + }).collect(); + //naively wait for all because idk how to make an async progress bar lmao + for child in processes_result?{ + let output=child.wait_with_output()?; + println!("Mesh exit_success:{}",output.status.success()); + } + Ok(()) +} fn load_image(input:&mut R)->AResult{ let mut fourcc=[0u8;4]; @@ -912,6 +967,7 @@ fn main() -> AResult<()> { Commands::Download(map_list)=>download(map_list.maps), Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), Commands::ConvertTextures=>convert_textures(), + Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), Commands::Extract(pathlist)=>extract(pathlist.paths), Commands::Interactive=>interactive(), Commands::Replace=>replace(), From a386f90f51118a66c8d5bc41c997e2a662c20f9b Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 18 Nov 2023 15:47:54 -0800 Subject: [PATCH 081/125] switch to lazy_regex --- Cargo.lock | 25 ++++++++++++++++++++++++- Cargo.toml | 2 +- src/main.rs | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d18f4948..9697a577 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -609,6 +609,29 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "lazy-regex" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.38", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -688,11 +711,11 @@ dependencies = [ "flate2", "image", "image_dds", + "lazy-regex", "rbx_binary", "rbx_dom_weak", "rbx_reflection_database", "rbx_xml", - "regex", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index a41142b8..1c0d6997 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,11 +11,11 @@ clap = { version = "4.4.2", features = ["derive"] } flate2 = "1.0.27" image = "0.24.7" image_dds = "0.1.1" +lazy-regex = "3.1.0" rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" rbx_xml = "0.13.1" -regex = "1.9.5" #[profile.release] #lto = true diff --git a/src/main.rs b/src/main.rs index 8b6d61f0..33430081 100644 --- a/src/main.rs +++ b/src/main.rs @@ -264,7 +264,7 @@ struct RobloxAssetIdParseErr; impl std::str::FromStr for RobloxAssetId { type Err=RobloxAssetIdParseErr; fn from_str(s: &str) -> Result{ - let regman=regex::Regex::new(r"(\d+)$").unwrap(); + let regman=lazy_regex::regex!(r"(\d+)$"); if let Some(captures) = regman.captures(s) { if captures.len()==2{//captures[0] is all captures concatenated, and then each individual capture if let Ok(id) = captures[0].parse::() { From c6d293cc6bc3fe582eed2bb2a54d4add4f42a286 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 18 Nov 2023 15:48:30 -0800 Subject: [PATCH 082/125] write "Ref" attribute based on internal roblox part id --- src/main.rs | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/src/main.rs b/src/main.rs index 33430081..aa058f75 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,7 @@ enum Commands { ConvertTextures, DownloadMeshes(PathBufList), Extract(PathBufList), + WriteAttributes, Interactive, Replace, Scan, @@ -56,6 +57,16 @@ fn recursive_collect_superclass(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, regex: &lazy_regex::Lazy){ + for &referent in instance.children() { + if let Some(c) = dom.get_by_ref(referent) { + if regex.captures(c.name.as_str()).is_some(){ + objects.push(c.referent());//copy ref + } + recursive_collect_regex(objects,dom,c,regex); + } + } +} fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance) -> String{ let mut full_name=instance.name.clone(); let mut pref=instance.parent(); @@ -90,6 +101,11 @@ fn get_script_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ recursive_collect_superclass(&mut scripts, dom, dom.root(),"LuaSourceContainer"); scripts } +fn get_button_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ + let mut buttons = std::vec::Vec::new(); + recursive_collect_regex(&mut buttons, dom, dom.root(),lazy_regex::regex!(r"Button(\d+)$")); + buttons +} fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ let mut objects = std::vec::Vec::new(); recursive_collect_superclass(&mut objects, dom, dom.root(),"Decal"); @@ -961,6 +977,51 @@ fn unzip_all()->AResult<()>{ Ok(()) } +fn write_attributes() -> AResult<()>{ + for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + println!("processing map={:?}",file_thing.file_name()); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut dom = get_dom(&mut input)?; + + let button_refs = get_button_refs(&dom); + + for &button_ref in &button_refs { + if let Some(button)=dom.get_by_ref_mut(button_ref){ + match button.properties.get_mut("Attributes"){ + Some(rbx_dom_weak::types::Variant::Attributes(attributes))=>{ + println!("Appending Ref={} to existing attributes for {}",button_ref,button.name); + attributes.insert("Ref".to_string(),rbx_dom_weak::types::Variant::String(button_ref.to_string())); + }, + None=>{ + println!("Creating new attributes with Ref={} for {}",button_ref,button.name); + let mut attributes=rbx_dom_weak::types::Attributes::new(); + attributes.insert("Ref".to_string(),rbx_dom_weak::types::Variant::String(button_ref.to_string())); + button.properties.insert("Attributes".to_string(),rbx_dom_weak::types::Variant::Attributes(attributes)); + } + _=>unreachable!("Fetching attributes did not return attributes."), + } + } + } + let mut dest={ + let mut dest=std::path::PathBuf::from("maps/attributes"); + dest.push(file_thing.file_name()); + let output = std::io::BufWriter::new(std::fs::File::create(dest)?); + //write workspace:GetChildren()[1] + let workspace_children=dom.root().children(); + if workspace_children.len()!=1{ + return Err(anyhow::Error::msg("there can only be one model")); + } + rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; + //move original to processed folder + std::path::PathBuf::from("maps/unaltered") + }; + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + Ok(()) +} + fn main() -> AResult<()> { let cli = Cli::parse(); match cli.command { @@ -969,6 +1030,7 @@ fn main() -> AResult<()> { Commands::ConvertTextures=>convert_textures(), Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), Commands::Extract(pathlist)=>extract(pathlist.paths), + Commands::WriteAttributes=>write_attributes(), Commands::Interactive=>interactive(), Commands::Replace=>replace(), Commands::Scan=>scan(), From b9dccb1af561f939635f99e66cf90fbd1b5feacc Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 18 Nov 2023 16:13:24 -0800 Subject: [PATCH 083/125] update deps --- Cargo.lock | 134 ++++++++++++++++++++++++++--------------------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9697a577..28b58c4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,7 +131,7 @@ version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "cfg-if 0.1.10", "clang-sys", @@ -161,6 +161,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "blake3" version = "1.5.0" @@ -197,7 +203,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -255,7 +261,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags", + "bitflags 1.3.2", "strsim 0.8.0", "textwrap", "unicode-width", @@ -264,9 +270,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", "clap_derive", @@ -274,9 +280,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ "anstream", "anstyle", @@ -293,7 +299,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -370,13 +376,14 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "ddsfile" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "594ecd967c2f40db5dde8da4c356975fc1fe030e951c7c3962f6dc2e80042e87" +checksum = "479dfe1e6737aa9e96c6ac7b69689dc4c32da8383f2c12744739d76afa8b66c4" dependencies = [ - "bitflags", + "bitflags 2.4.1", "byteorder", - "enum_primitive", + "enum-primitive-derive", + "num-traits", ] [[package]] @@ -386,12 +393,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] -name = "enum_primitive" -version = "0.1.1" +name = "enum-primitive-derive" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" +checksum = "c375b9c5eadb68d0a6efee2999fef292f45854c3444c86f09d8ab086ba942b0e" dependencies = [ - "num-traits 0.1.43", + "num-traits", + "quote", + "syn 1.0.109", ] [[package]] @@ -425,9 +434,9 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" dependencies = [ "simd-adler32", ] @@ -469,9 +478,9 @@ checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -550,7 +559,7 @@ dependencies = [ "gif", "jpeg-decoder", "num-rational", - "num-traits 0.2.17", + "num-traits", "png", "qoi", "tiff", @@ -602,9 +611,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -629,7 +638,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -652,9 +661,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" @@ -707,7 +716,7 @@ name = "map-tool" version = "1.3.0" dependencies = [ "anyhow", - "clap 4.4.7", + "clap 4.4.8", "flate2", "image", "image_dds", @@ -769,7 +778,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", - "num-traits 0.2.17", + "num-traits", ] [[package]] @@ -780,16 +789,7 @@ checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.17", -] - -[[package]] -name = "num-traits" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -dependencies = [ - "num-traits 0.2.17", + "num-traits", ] [[package]] @@ -846,7 +846,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -855,7 +855,7 @@ version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", @@ -893,7 +893,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb156a45b6b9fe8027497422179fb65afc84d36707a7ca98297bf06bccb8d43f" dependencies = [ "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1025,7 +1025,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a991523e3ad5f43a4d121cb4a1e5bc23f7826bb4a1db5aa51e94f1073150ec" dependencies = [ "base64", - "bitflags", + "bitflags 1.3.2", "blake3", "lazy_static", "rand", @@ -1083,7 +1083,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" dependencies = [ "byteorder", - "num-traits 0.2.17", + "num-traits", "paste", ] @@ -1118,22 +1118,22 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1150,9 +1150,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "spin" @@ -1210,9 +1210,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -1221,9 +1221,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -1254,7 +1254,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1306,9 +1306,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -1316,24 +1316,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1341,22 +1341,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "weezl" From 1e888ebb01adae9423e03e08cc251a60c5fc2091 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 8 Jan 2024 20:21:56 -0800 Subject: [PATCH 084/125] tabs --- src/main.rs | 1684 +++++++++++++++++++++++++-------------------------- 1 file changed, 842 insertions(+), 842 deletions(-) diff --git a/src/main.rs b/src/main.rs index aa058f75..231679ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,290 +6,290 @@ use anyhow::Result as AResult; #[command(author, version, about, long_about = None)] #[command(propagate_version = true)] struct Cli { - #[command(subcommand)] - command: Commands, + #[command(subcommand)] + command: Commands, } #[derive(Subcommand)] enum Commands { - Download(MapList), - DownloadTextures(PathBufList), - ConvertTextures, - DownloadMeshes(PathBufList), - Extract(PathBufList), - WriteAttributes, - Interactive, - Replace, - Scan, - UnzipAll, - Upload, + Download(MapList), + DownloadTextures(PathBufList), + ConvertTextures, + DownloadMeshes(PathBufList), + Extract(PathBufList), + WriteAttributes, + Interactive, + Replace, + Scan, + UnzipAll, + Upload, } #[derive(Args)] struct PathBufList { - paths:Vec + paths:Vec } #[derive(Args)] struct MapList { - maps: Vec, + maps: Vec, } fn class_is_a(class: &str, superclass: &str) -> bool { - if class==superclass { - return true - } - let class_descriptor=rbx_reflection_database::get().classes.get(class); - if let Some(descriptor) = &class_descriptor { - if let Some(class_super) = &descriptor.superclass { - return class_is_a(&class_super, superclass) - } - } - return false + if class==superclass { + return true + } + let class_descriptor=rbx_reflection_database::get().classes.get(class); + if let Some(descriptor) = &class_descriptor { + if let Some(class_super) = &descriptor.superclass { + return class_is_a(&class_super, superclass) + } + } + return false } fn recursive_collect_superclass(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, superclass: &str){ - for &referent in instance.children() { - if let Some(c) = dom.get_by_ref(referent) { - if class_is_a(c.class.as_str(), superclass) { - objects.push(c.referent());//copy ref - } - recursive_collect_superclass(objects,dom,c,superclass); - } - } + for &referent in instance.children() { + if let Some(c) = dom.get_by_ref(referent) { + if class_is_a(c.class.as_str(), superclass) { + objects.push(c.referent());//copy ref + } + recursive_collect_superclass(objects,dom,c,superclass); + } + } } fn recursive_collect_regex(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, regex: &lazy_regex::Lazy){ - for &referent in instance.children() { - if let Some(c) = dom.get_by_ref(referent) { - if regex.captures(c.name.as_str()).is_some(){ - objects.push(c.referent());//copy ref - } - recursive_collect_regex(objects,dom,c,regex); - } - } + for &referent in instance.children() { + if let Some(c) = dom.get_by_ref(referent) { + if regex.captures(c.name.as_str()).is_some(){ + objects.push(c.referent());//copy ref + } + recursive_collect_regex(objects,dom,c,regex); + } + } } fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance) -> String{ - let mut full_name=instance.name.clone(); - let mut pref=instance.parent(); - while let Some(parent)=dom.get_by_ref(pref){ - full_name.insert(0, '.'); - full_name.insert_str(0, &parent.name); - pref=parent.parent(); - } - full_name + let mut full_name=instance.name.clone(); + let mut pref=instance.parent(); + while let Some(parent)=dom.get_by_ref(pref){ + full_name.insert(0, '.'); + full_name.insert_str(0, &parent.name); + pref=parent.parent(); + } + full_name } //download - //download list of maps to maps/unprocessed + //download list of maps to maps/unprocessed //scan (scripts) - //iter maps/unprocessed - //passing moves to maps/verified - //failing moves to maps/blocked + //iter maps/unprocessed + //passing moves to maps/verified + //failing moves to maps/blocked //replace (edits & deletions) - //iter maps/blocked - //replace scripts and put in maps/unprocessed + //iter maps/blocked + //replace scripts and put in maps/unprocessed //upload - //iter maps/verified - //interactively print DisplayName/Creator and ask for target upload ids + //iter maps/verified + //interactively print DisplayName/Creator and ask for target upload ids //interactive - //iter maps/unprocessed - //for each unique script, load it into the file current.lua and have it open in sublime text - //I can edit the file and it will edit it in place - //I pass/fail(with comment)/allow each script + //iter maps/unprocessed + //for each unique script, load it into the file current.lua and have it open in sublime text + //I can edit the file and it will edit it in place + //I pass/fail(with comment)/allow each script fn get_script_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ - let mut scripts = std::vec::Vec::new(); - recursive_collect_superclass(&mut scripts, dom, dom.root(),"LuaSourceContainer"); - scripts + let mut scripts = std::vec::Vec::new(); + recursive_collect_superclass(&mut scripts, dom, dom.root(),"LuaSourceContainer"); + scripts } fn get_button_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ - let mut buttons = std::vec::Vec::new(); - recursive_collect_regex(&mut buttons, dom, dom.root(),lazy_regex::regex!(r"Button(\d+)$")); - buttons + let mut buttons = std::vec::Vec::new(); + recursive_collect_regex(&mut buttons, dom, dom.root(),lazy_regex::regex!(r"Button(\d+)$")); + buttons } fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ - let mut objects = std::vec::Vec::new(); - recursive_collect_superclass(&mut objects, dom, dom.root(),"Decal"); - //get ids - //clear vec - //next class - objects + let mut objects = std::vec::Vec::new(); + recursive_collect_superclass(&mut objects, dom, dom.root(),"Decal"); + //get ids + //clear vec + //next class + objects } fn get_mesh_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ - let mut objects = std::vec::Vec::new(); - recursive_collect_superclass(&mut objects, dom, dom.root(),"FileMesh"); - recursive_collect_superclass(&mut objects, dom, dom.root(),"MeshPart"); - //get ids - //clear vec - //next class - objects + let mut objects = std::vec::Vec::new(); + recursive_collect_superclass(&mut objects, dom, dom.root(),"FileMesh"); + recursive_collect_superclass(&mut objects, dom, dom.root(),"MeshPart"); + //get ids + //clear vec + //next class + objects } enum ReaderType<'a, R:Read+Seek>{ - GZip(flate2::read::GzDecoder<&'a mut R>), - Raw(&'a mut R), + GZip(flate2::read::GzDecoder<&'a mut R>), + Raw(&'a mut R), } fn maybe_gzip_decode(input:&mut R)->AResult>{ - let mut first_2=[0u8;2]; - if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_2),std::io::Seek::rewind(input)){ - match &first_2{ - b"\x1f\x8b"=>Ok(ReaderType::GZip(flate2::read::GzDecoder::new(input))), - _=>Ok(ReaderType::Raw(input)), - } - }else{ - Err(anyhow::Error::msg("failed to peek")) - } + let mut first_2=[0u8;2]; + if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_2),std::io::Seek::rewind(input)){ + match &first_2{ + b"\x1f\x8b"=>Ok(ReaderType::GZip(flate2::read::GzDecoder::new(input))), + _=>Ok(ReaderType::Raw(input)), + } + }else{ + Err(anyhow::Error::msg("failed to peek")) + } } fn load_dom(input:&mut R)->AResult{ - let mut first_8=[0u8;8]; - if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_8),std::io::Seek::rewind(input)){ - match &first_8[0..4]{ - b"{ - match &first_8[4..8]{ - b"lox!"=>return rbx_binary::from_reader(input).map_err(anyhow::Error::msg), - b"lox "=>return rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), - other=>Err(anyhow::Error::msg(format!("Unknown Roblox file type {:?}",other))), - } - }, - _=>Err(anyhow::Error::msg("unsupported file type")), - } - }else{ - Err(anyhow::Error::msg("peek failed")) - } + let mut first_8=[0u8;8]; + if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_8),std::io::Seek::rewind(input)){ + match &first_8[0..4]{ + b"{ + match &first_8[4..8]{ + b"lox!"=>return rbx_binary::from_reader(input).map_err(anyhow::Error::msg), + b"lox "=>return rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), + other=>Err(anyhow::Error::msg(format!("Unknown Roblox file type {:?}",other))), + } + }, + _=>Err(anyhow::Error::msg("unsupported file type")), + } + }else{ + Err(anyhow::Error::msg("peek failed")) + } } fn get_dom(input:&mut R)->AResult{ - match maybe_gzip_decode(input){ - Ok(ReaderType::GZip(mut readable)) => { - //gzip - let mut extracted:Vec=Vec::new(); - readable.read_to_end(&mut extracted)?; - Ok(load_dom(&mut std::io::Cursor::new(extracted))?) - }, - Ok(ReaderType::Raw(readable)) => Ok(load_dom(readable)?), - Err(e) => Err(e)?, - } + match maybe_gzip_decode(input){ + Ok(ReaderType::GZip(mut readable)) => { + //gzip + let mut extracted:Vec=Vec::new(); + readable.read_to_end(&mut extracted)?; + Ok(load_dom(&mut std::io::Cursor::new(extracted))?) + }, + Ok(ReaderType::Raw(readable)) => Ok(load_dom(readable)?), + Err(e) => Err(e)?, + } } fn get_id() -> AResult{ - match std::fs::read_to_string("id"){ - Ok(id_file)=>Ok(id_file.parse::()?), - Err(e) => match e.kind() { - std::io::ErrorKind::NotFound => Ok(0),//implicitly take on id=0 - _ => Err(e)?, - } - } + match std::fs::read_to_string("id"){ + Ok(id_file)=>Ok(id_file.parse::()?), + Err(e) => match e.kind() { + std::io::ErrorKind::NotFound => Ok(0),//implicitly take on id=0 + _ => Err(e)?, + } + } } fn get_set_from_file(file:&str) -> AResult>{ - let mut set=std::collections::HashSet::::new(); - for entry in std::fs::read_dir(file)? { - set.insert(std::fs::read_to_string(entry?.path())?); - } - Ok(set) + let mut set=std::collections::HashSet::::new(); + for entry in std::fs::read_dir(file)? { + set.insert(std::fs::read_to_string(entry?.path())?); + } + Ok(set) } fn get_allowed_set() -> AResult>{ - get_set_from_file("scripts/allowed") + get_set_from_file("scripts/allowed") } fn get_blocked() -> AResult>{ - get_set_from_file("scripts/blocked") + get_set_from_file("scripts/blocked") } fn get_allowed_map() -> AResult>{ - let mut allowed_map = std::collections::HashMap::::new(); - for entry in std::fs::read_dir("scripts/allowed")? { - let entry=entry?; - allowed_map.insert(entry.path().file_stem().unwrap().to_str().unwrap().parse::()?,std::fs::read_to_string(entry.path())?); - } - Ok(allowed_map) + let mut allowed_map = std::collections::HashMap::::new(); + for entry in std::fs::read_dir("scripts/allowed")? { + let entry=entry?; + allowed_map.insert(entry.path().file_stem().unwrap().to_str().unwrap().parse::()?,std::fs::read_to_string(entry.path())?); + } + Ok(allowed_map) } fn get_replace_map() -> AResult>{ - let mut replace = std::collections::HashMap::::new(); - for entry in std::fs::read_dir("scripts/replace")? { - let entry=entry?; - replace.insert(std::fs::read_to_string(entry.path())?,entry.path().file_stem().unwrap().to_str().unwrap().parse::()?); - } - Ok(replace) + let mut replace = std::collections::HashMap::::new(); + for entry in std::fs::read_dir("scripts/replace")? { + let entry=entry?; + replace.insert(std::fs::read_to_string(entry.path())?,entry.path().file_stem().unwrap().to_str().unwrap().parse::()?); + } + Ok(replace) } fn check_source_illegal_keywords(source:&String)->bool{ - source.find("getfenv").is_some()||source.find("require").is_some() + source.find("getfenv").is_some()||source.find("require").is_some() } fn find_first_child_class<'a>(dom:&'a rbx_dom_weak::WeakDom,instance:&'a rbx_dom_weak::Instance,name:&'a str,class:&'a str) -> Option<&'a rbx_dom_weak::Instance> { - for &referent in instance.children() { - if let Some(c) = dom.get_by_ref(referent) { - if c.name==name&&class_is_a(c.class.as_str(),class) { - return Some(c); - } - } - } - None + for &referent in instance.children() { + if let Some(c) = dom.get_by_ref(referent) { + if c.name==name&&class_is_a(c.class.as_str(),class) { + return Some(c); + } + } + } + None } fn get_mapinfo(dom:&rbx_dom_weak::WeakDom) -> AResult<(String,String,String)>{ - let workspace_children=dom.root().children(); - if workspace_children.len()!=1{ - return Err(anyhow::Error::msg("there can only be one model")); - } - if let Some(model_instance) = dom.get_by_ref(workspace_children[0]) { - if let (Some(creator),Some(displayname))=(find_first_child_class(dom, model_instance, "Creator", "StringValue"),find_first_child_class(dom, model_instance, "DisplayName", "StringValue")){ - if let ( - Some(rbx_dom_weak::types::Variant::String(creator_string)), - Some(rbx_dom_weak::types::Variant::String(displayname_string)) - )=( - creator.properties.get("Value"), - displayname.properties.get("Value") - ){ - return Ok((model_instance.name.clone(),creator_string.clone(),displayname_string.clone())); - } - } - } - return Err(anyhow::Error::msg("no stuff in map")); + let workspace_children=dom.root().children(); + if workspace_children.len()!=1{ + return Err(anyhow::Error::msg("there can only be one model")); + } + if let Some(model_instance) = dom.get_by_ref(workspace_children[0]) { + if let (Some(creator),Some(displayname))=(find_first_child_class(dom, model_instance, "Creator", "StringValue"),find_first_child_class(dom, model_instance, "DisplayName", "StringValue")){ + if let ( + Some(rbx_dom_weak::types::Variant::String(creator_string)), + Some(rbx_dom_weak::types::Variant::String(displayname_string)) + )=( + creator.properties.get("Value"), + displayname.properties.get("Value") + ){ + return Ok((model_instance.name.clone(),creator_string.clone(),displayname_string.clone())); + } + } + } + return Err(anyhow::Error::msg("no stuff in map")); } fn download(map_list: Vec) -> AResult<()>{ - let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); - let shared_args=&[ - "-q", - "--header", - header.as_str(), - "-O", - ]; - let processes_result:Result, _>=map_list.iter().map(|map_id|{ - std::process::Command::new("wget") - .args(shared_args) - .arg(format!("maps/unprocessed/{}.rbxm",map_id)) - .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",map_id)) - .spawn() - }).collect(); - //naively wait for all because idk how to make an async progress bar lmao - for child in processes_result?{ - let output=child.wait_with_output()?; - println!("map exit_success:{}",output.status.success()); - } - Ok(()) + let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); + let shared_args=&[ + "-q", + "--header", + header.as_str(), + "-O", + ]; + let processes_result:Result, _>=map_list.iter().map(|map_id|{ + std::process::Command::new("wget") + .args(shared_args) + .arg(format!("maps/unprocessed/{}.rbxm",map_id)) + .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",map_id)) + .spawn() + }).collect(); + //naively wait for all because idk how to make an async progress bar lmao + for child in processes_result?{ + let output=child.wait_with_output()?; + println!("map exit_success:{}",output.status.success()); + } + Ok(()) } struct RobloxAssetId(u64); struct RobloxAssetIdParseErr; impl std::str::FromStr for RobloxAssetId { - type Err=RobloxAssetIdParseErr; - fn from_str(s: &str) -> Result{ - let regman=lazy_regex::regex!(r"(\d+)$"); - if let Some(captures) = regman.captures(s) { - if captures.len()==2{//captures[0] is all captures concatenated, and then each individual capture - if let Ok(id) = captures[0].parse::() { - return Ok(Self(id)); - } - } - } - Err(RobloxAssetIdParseErr) - } + type Err=RobloxAssetIdParseErr; + fn from_str(s: &str) -> Result{ + let regman=lazy_regex::regex!(r"(\d+)$"); + if let Some(captures) = regman.captures(s) { + if captures.len()==2{//captures[0] is all captures concatenated, and then each individual capture + if let Ok(id) = captures[0].parse::() { + return Ok(Self(id)); + } + } + } + Err(RobloxAssetIdParseErr) + } } /* The ones I'm interested in: Beam.Texture @@ -318,723 +318,723 @@ SurfaceAppearance.RoughnessMap SurfaceAppearance.TexturePack */ fn download_textures(paths: Vec) -> AResult<()>{ - println!("download_textures paths:{:?}",paths); - let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); - let shared_args=&[ - "-q", - "--header", - header.as_str(), - "-O", - ]; - let mut texture_list=std::collections::HashSet::new(); - for path in paths { - let mut input = std::io::BufReader::new(std::fs::File::open(path.clone())?); + println!("download_textures paths:{:?}",paths); + let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); + let shared_args=&[ + "-q", + "--header", + header.as_str(), + "-O", + ]; + let mut texture_list=std::collections::HashSet::new(); + for path in paths { + let mut input = std::io::BufReader::new(std::fs::File::open(path.clone())?); - match get_dom(&mut input){ - Ok(dom)=>{ - let object_refs = get_texture_refs(&dom); - for &object_ref in object_refs.iter() { - if let Some(object)=dom.get_by_ref(object_ref){ - if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("Texture") { - println!("Texture content:{:?}",content); - if let Ok(asset_id)=content.clone().into_string().parse::(){ - texture_list.insert(asset_id.0); - } - } - } - } - }, - Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), - } - } - println!("Texture list:{:?}",texture_list); - let processes_result:Result, _>=texture_list.iter().map(|asset_id|{ - std::process::Command::new("wget") - .args(shared_args) - .arg(format!("textures/unprocessed/{}",asset_id)) - .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) - .spawn() - }).collect(); - //naively wait for all because idk how to make an async progress bar lmao - for child in processes_result?{ - let output=child.wait_with_output()?; - println!("texture exit_success:{}",output.status.success()); - } - Ok(()) + match get_dom(&mut input){ + Ok(dom)=>{ + let object_refs = get_texture_refs(&dom); + for &object_ref in object_refs.iter() { + if let Some(object)=dom.get_by_ref(object_ref){ + if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("Texture") { + println!("Texture content:{:?}",content); + if let Ok(asset_id)=content.clone().into_string().parse::(){ + texture_list.insert(asset_id.0); + } + } + } + } + }, + Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), + } + } + println!("Texture list:{:?}",texture_list); + let processes_result:Result, _>=texture_list.iter().map(|asset_id|{ + std::process::Command::new("wget") + .args(shared_args) + .arg(format!("textures/unprocessed/{}",asset_id)) + .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) + .spawn() + }).collect(); + //naively wait for all because idk how to make an async progress bar lmao + for child in processes_result?{ + let output=child.wait_with_output()?; + println!("texture exit_success:{}",output.status.success()); + } + Ok(()) } fn download_meshes(paths: Vec) -> AResult<()>{ - println!("download_meshes paths:{:?}",paths); - let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); - let shared_args=&[ - "-q", - "--header", - header.as_str(), - "-O", - ]; - let mut mesh_list=std::collections::HashSet::new(); - for path in paths { - let mut input = std::io::BufReader::new(std::fs::File::open(path.clone())?); + println!("download_meshes paths:{:?}",paths); + let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); + let shared_args=&[ + "-q", + "--header", + header.as_str(), + "-O", + ]; + let mut mesh_list=std::collections::HashSet::new(); + for path in paths { + let mut input = std::io::BufReader::new(std::fs::File::open(path.clone())?); - match get_dom(&mut input){ - Ok(dom)=>{ - let object_refs = get_mesh_refs(&dom); - for &object_ref in object_refs.iter() { - if let Some(object)=dom.get_by_ref(object_ref){ - if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("MeshId") { - println!("Mesh content:{:?}",content); - if let Ok(asset_id)=content.clone().into_string().parse::(){ - mesh_list.insert(asset_id.0); - } - } - } - } - }, - Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), - } - } - println!("Mesh list:{:?}",mesh_list); - let processes_result:Result, _>=mesh_list.iter().map(|asset_id|{ - std::process::Command::new("wget") - .args(shared_args) - .arg(format!("meshes/unprocessed/{}",asset_id)) - .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) - .spawn() - }).collect(); - //naively wait for all because idk how to make an async progress bar lmao - for child in processes_result?{ - let output=child.wait_with_output()?; - println!("Mesh exit_success:{}",output.status.success()); - } - Ok(()) + match get_dom(&mut input){ + Ok(dom)=>{ + let object_refs = get_mesh_refs(&dom); + for &object_ref in object_refs.iter() { + if let Some(object)=dom.get_by_ref(object_ref){ + if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("MeshId") { + println!("Mesh content:{:?}",content); + if let Ok(asset_id)=content.clone().into_string().parse::(){ + mesh_list.insert(asset_id.0); + } + } + } + } + }, + Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), + } + } + println!("Mesh list:{:?}",mesh_list); + let processes_result:Result, _>=mesh_list.iter().map(|asset_id|{ + std::process::Command::new("wget") + .args(shared_args) + .arg(format!("meshes/unprocessed/{}",asset_id)) + .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) + .spawn() + }).collect(); + //naively wait for all because idk how to make an async progress bar lmao + for child in processes_result?{ + let output=child.wait_with_output()?; + println!("Mesh exit_success:{}",output.status.success()); + } + Ok(()) } fn load_image(input:&mut R)->AResult{ - let mut fourcc=[0u8;4]; - input.read_exact(&mut fourcc)?; - input.rewind()?; - match &fourcc{ - b"\x89PNG"=>Ok(image::load(input,image::ImageFormat::Png)?), - b"\xFF\xD8\xFF\xE0"=>Ok(image::load(input,image::ImageFormat::Jpeg)?),//JFIF - b"Err(anyhow::Error::msg("Roblox xml garbage is not supported yet")), - other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))), - } + let mut fourcc=[0u8;4]; + input.read_exact(&mut fourcc)?; + input.rewind()?; + match &fourcc{ + b"\x89PNG"=>Ok(image::load(input,image::ImageFormat::Png)?), + b"\xFF\xD8\xFF\xE0"=>Ok(image::load(input,image::ImageFormat::Jpeg)?),//JFIF + b"Err(anyhow::Error::msg("Roblox xml garbage is not supported yet")), + other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))), + } } fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut extracted_input=None; - let image=match maybe_gzip_decode(&mut input){ - Ok(ReaderType::GZip(mut readable)) => { - //gzip - let mut extracted:Vec=Vec::new(); - //read the entire thing to the end so that I can clone the data and write a png to processed images - readable.read_to_end(&mut extracted)?; - extracted_input=Some(extracted.clone()); - load_image(&mut std::io::Cursor::new(extracted)) - }, - Ok(ReaderType::Raw(readable)) => load_image(readable), - Err(e) => Err(e)?, - }?.to_rgba8();//this sets a=255, arcane is actually supposed to look like that + let mut extracted_input=None; + let image=match maybe_gzip_decode(&mut input){ + Ok(ReaderType::GZip(mut readable)) => { + //gzip + let mut extracted:Vec=Vec::new(); + //read the entire thing to the end so that I can clone the data and write a png to processed images + readable.read_to_end(&mut extracted)?; + extracted_input=Some(extracted.clone()); + load_image(&mut std::io::Cursor::new(extracted)) + }, + Ok(ReaderType::Raw(readable)) => load_image(readable), + Err(e) => Err(e)?, + }?.to_rgba8();//this sets a=255, arcane is actually supposed to look like that - let format=if image.width()%4!=0||image.height()%4!=0{ - image_dds::ImageFormat::R8G8B8A8Srgb - }else{ - image_dds::ImageFormat::BC7Srgb - }; - //this fails if the image dimensions are not a multiple of 4 - let dds = image_dds::dds_from_image( - &image, - format, - image_dds::Quality::Slow, - image_dds::Mipmaps::GeneratedAutomatic, - )?; + let format=if image.width()%4!=0||image.height()%4!=0{ + image_dds::ImageFormat::R8G8B8A8Srgb + }else{ + image_dds::ImageFormat::BC7Srgb + }; + //this fails if the image dimensions are not a multiple of 4 + let dds = image_dds::dds_from_image( + &image, + format, + image_dds::Quality::Slow, + image_dds::Mipmaps::GeneratedAutomatic, + )?; - //write dds - let mut dest=std::path::PathBuf::from("textures/dds"); - dest.push(file_thing.file_name()); - dest.set_extension("dds"); - let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); - dds.write(&mut writer)?; + //write dds + let mut dest=std::path::PathBuf::from("textures/dds"); + dest.push(file_thing.file_name()); + dest.set_extension("dds"); + let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); + dds.write(&mut writer)?; - if let Some(mut extracted)=extracted_input{ - //write extracted to processed - let mut dest=std::path::PathBuf::from("textures/processed"); - dest.push(file_thing.file_name()); - std::fs::write(dest, &mut extracted)?; - //delete ugly gzip file - std::fs::remove_file(file_thing.path())?; - }else{ - //move file to processed - let mut dest=std::path::PathBuf::from("textures/processed"); - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - Ok(()) + if let Some(mut extracted)=extracted_input{ + //write extracted to processed + let mut dest=std::path::PathBuf::from("textures/processed"); + dest.push(file_thing.file_name()); + std::fs::write(dest, &mut extracted)?; + //delete ugly gzip file + std::fs::remove_file(file_thing.path())?; + }else{ + //move file to processed + let mut dest=std::path::PathBuf::from("textures/processed"); + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + Ok(()) } fn convert_textures() -> AResult<()>{ - let start = std::time::Instant::now(); - let mut threads=Vec::new(); - for entry in std::fs::read_dir("textures/unprocessed")? { - let file_thing=entry?; - threads.push(std::thread::spawn(move ||{ - let file_name=format!("{:?}",file_thing); - let result=convert(file_thing); - if let Err(e)=result{ - println!("error processing file:{:?} error message:{:?}",file_name,e); - } - })); - } - let mut i=0; - let n_threads=threads.len(); - for thread in threads{ - i+=1; - if let Err(e)=thread.join(){ - println!("thread error: {:?}",e); - }else{ - println!("{}/{}",i,n_threads); - } - } - println!("{:?}", start.elapsed()); - Ok(()) + let start = std::time::Instant::now(); + let mut threads=Vec::new(); + for entry in std::fs::read_dir("textures/unprocessed")? { + let file_thing=entry?; + threads.push(std::thread::spawn(move ||{ + let file_name=format!("{:?}",file_thing); + let result=convert(file_thing); + if let Err(e)=result{ + println!("error processing file:{:?} error message:{:?}",file_name,e); + } + })); + } + let mut i=0; + let n_threads=threads.len(); + for thread in threads{ + i+=1; + if let Err(e)=thread.join(){ + println!("thread error: {:?}",e); + }else{ + println!("{}/{}",i,n_threads); + } + } + println!("{:?}", start.elapsed()); + Ok(()) } enum Scan{ - Passed, - Blocked, - Flagged, + Passed, + Blocked, + Flagged, } fn scan() -> AResult<()>{ - let mut id = get_id()?; - //Construct allowed scripts - let allowed_set = get_allowed_set()?; - let mut blocked = get_blocked()?; + let mut id = get_id()?; + //Construct allowed scripts + let allowed_set = get_allowed_set()?; + let mut blocked = get_blocked()?; - for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let dom = get_dom(&mut input)?; + let dom = get_dom(&mut input)?; - let script_refs = get_script_refs(&dom); + let script_refs = get_script_refs(&dom); - //check scribb - let mut fail_count=0; - let mut fail_type=Scan::Passed; - for &script_ref in script_refs.iter() { - if let Some(script)=dom.get_by_ref(script_ref){ - if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { - //flag keywords and instantly fail - if check_source_illegal_keywords(s){ - println!("{:?} - flagged.",file_thing.file_name()); - fail_type=Scan::Flagged; - break; - } - if allowed_set.contains(s) { - continue; - }else{ - fail_type=Scan::Blocked;//no need to check for Flagged, it breaks the loop. - fail_count+=1; - if !blocked.contains(s) { - blocked.insert(s.clone());//all fixed! just clone! - std::fs::write(format!("scripts/blocked/{}.lua",id),s)?; - id+=1; - } - } - }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); - } - }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); - } - } - let mut dest=match fail_type { - Scan::Passed => std::path::PathBuf::from("maps/processed"), - Scan::Blocked => { - println!("{:?} - {} {} not allowed.",file_thing.file_name(),fail_count,if fail_count==1 {"script"}else{"scripts"}); - std::path::PathBuf::from("maps/blocked") - } - Scan::Flagged => std::path::PathBuf::from("maps/flagged") - }; - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - std::fs::write("id",id.to_string())?; - Ok(()) + //check scribb + let mut fail_count=0; + let mut fail_type=Scan::Passed; + for &script_ref in script_refs.iter() { + if let Some(script)=dom.get_by_ref(script_ref){ + if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { + //flag keywords and instantly fail + if check_source_illegal_keywords(s){ + println!("{:?} - flagged.",file_thing.file_name()); + fail_type=Scan::Flagged; + break; + } + if allowed_set.contains(s) { + continue; + }else{ + fail_type=Scan::Blocked;//no need to check for Flagged, it breaks the loop. + fail_count+=1; + if !blocked.contains(s) { + blocked.insert(s.clone());//all fixed! just clone! + std::fs::write(format!("scripts/blocked/{}.lua",id),s)?; + id+=1; + } + } + }else{ + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); + } + }else{ + panic!("FATAL: failed to get_by_ref {:?}",script_ref); + } + } + let mut dest=match fail_type { + Scan::Passed => std::path::PathBuf::from("maps/processed"), + Scan::Blocked => { + println!("{:?} - {} {} not allowed.",file_thing.file_name(),fail_count,if fail_count==1 {"script"}else{"scripts"}); + std::path::PathBuf::from("maps/blocked") + } + Scan::Flagged => std::path::PathBuf::from("maps/flagged") + }; + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + std::fs::write("id",id.to_string())?; + Ok(()) } fn extract(paths: Vec) -> AResult<()>{ - let mut id = 0; - //Construct allowed scripts - let mut script_set = std::collections::HashSet::::new(); + let mut id = 0; + //Construct allowed scripts + let mut script_set = std::collections::HashSet::::new(); - for path in paths { - let file_name=path.file_name(); - let mut input = std::io::BufReader::new(std::fs::File::open(&path)?); + for path in paths { + let file_name=path.file_name(); + let mut input = std::io::BufReader::new(std::fs::File::open(&path)?); - let dom = get_dom(&mut input)?; + let dom = get_dom(&mut input)?; - let script_refs = get_script_refs(&dom); + let script_refs = get_script_refs(&dom); - //extract scribb - for &script_ref in script_refs.iter() { - if let Some(script)=dom.get_by_ref(script_ref){ - if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { - if script_set.contains(s) { - continue; - }else{ - script_set.insert(s.clone()); - std::fs::write(format!("scripts/extracted/{:?}_{}_{}.lua",file_name,id,script.name),s)?; - id+=1; - } - }else{ - panic!("FATAL: failed to get source for {:?}",file_name); - } - }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); - } - } - } - println!("extracted {} {}",id,if id==1 {"script"}else{"scripts"}); - Ok(()) + //extract scribb + for &script_ref in script_refs.iter() { + if let Some(script)=dom.get_by_ref(script_ref){ + if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { + if script_set.contains(s) { + continue; + }else{ + script_set.insert(s.clone()); + std::fs::write(format!("scripts/extracted/{:?}_{}_{}.lua",file_name,id,script.name),s)?; + id+=1; + } + }else{ + panic!("FATAL: failed to get source for {:?}",file_name); + } + }else{ + panic!("FATAL: failed to get_by_ref {:?}",script_ref); + } + } + } + println!("extracted {} {}",id,if id==1 {"script"}else{"scripts"}); + Ok(()) } fn replace() -> AResult<()>{ - let allowed_map=get_allowed_map()?; - let replace_map=get_replace_map()?; + let allowed_map=get_allowed_map()?; + let replace_map=get_replace_map()?; - for entry in std::fs::read_dir("maps/blocked")? { - let file_thing=entry?; + for entry in std::fs::read_dir("maps/blocked")? { + let file_thing=entry?; - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut dom = get_dom(&mut input)?; + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut dom = get_dom(&mut input)?; - let script_refs = get_script_refs(&dom); + let script_refs = get_script_refs(&dom); - //check scribb - let mut any_failed=false; - for &script_ref in script_refs.iter() { - if let Some(script)=dom.get_by_ref(script_ref){ - if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { - if let (Some(replace_id),Some(replace_script))=(replace_map.get(source),dom.get_by_ref_mut(script.referent())) { - println!("replace {}",replace_id); - //replace the source - if let Some(replace_source)=allowed_map.get(replace_id){ - replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); - }else{ - println!("failed to get replacement source {}",replace_id); - any_failed=true; - } - }else{ - println!("failed to failed to get replace_id and replace_script"); - any_failed=true; - } - }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); - } - }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); - } - } - if any_failed { - println!("One or more scripts failed to replace."); - }else{ - let mut dest=std::path::PathBuf::from("maps/unprocessed"); - dest.set_file_name(file_thing.file_name()); - let output = std::io::BufWriter::new(std::fs::File::open(dest)?); - rbx_binary::to_writer(output, &dom, &[dom.root_ref()])?; - } - } - Ok(()) + //check scribb + let mut any_failed=false; + for &script_ref in script_refs.iter() { + if let Some(script)=dom.get_by_ref(script_ref){ + if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { + if let (Some(replace_id),Some(replace_script))=(replace_map.get(source),dom.get_by_ref_mut(script.referent())) { + println!("replace {}",replace_id); + //replace the source + if let Some(replace_source)=allowed_map.get(replace_id){ + replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); + }else{ + println!("failed to get replacement source {}",replace_id); + any_failed=true; + } + }else{ + println!("failed to failed to get replace_id and replace_script"); + any_failed=true; + } + }else{ + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); + } + }else{ + panic!("FATAL: failed to get_by_ref {:?}",script_ref); + } + } + if any_failed { + println!("One or more scripts failed to replace."); + }else{ + let mut dest=std::path::PathBuf::from("maps/unprocessed"); + dest.set_file_name(file_thing.file_name()); + let output = std::io::BufWriter::new(std::fs::File::open(dest)?); + rbx_binary::to_writer(output, &dom, &[dom.root_ref()])?; + } + } + Ok(()) } enum UploadAction { - Upload(u64), - Skip, - New, - Delete, + Upload(u64), + Skip, + New, + Delete, } struct ParseUploadActionErr; impl std::str::FromStr for UploadAction { - type Err=ParseUploadActionErr; - fn from_str(s: &str) -> Result{ - if s=="skip\n"{ - Ok(Self::Skip) - }else if s=="new\n"{ - Ok(Self::New) - }else if s=="delete\n"{ - Ok(Self::Delete) - }else if let Ok(asset_id)=s[..s.len()-1].parse::(){ - Ok(Self::Upload(asset_id)) - }else{ - Err(ParseUploadActionErr) - } - } + type Err=ParseUploadActionErr; + fn from_str(s: &str) -> Result{ + if s=="skip\n"{ + Ok(Self::Skip) + }else if s=="new\n"{ + Ok(Self::New) + }else if s=="delete\n"{ + Ok(Self::Delete) + }else if let Ok(asset_id)=s[..s.len()-1].parse::(){ + Ok(Self::Upload(asset_id)) + }else{ + Err(ParseUploadActionErr) + } + } } fn upload() -> AResult<()>{ - //interactive prompt per upload: - for entry in std::fs::read_dir("maps/passed")? { - let file_thing=entry?; - println!("map file: {:?}",file_thing.file_name()); - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + //interactive prompt per upload: + for entry in std::fs::read_dir("maps/passed")? { + let file_thing=entry?; + println!("map file: {:?}",file_thing.file_name()); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let dom = get_dom(&mut input)?; - let (modelname,creator,displayname) = get_mapinfo(&dom)?; + let dom = get_dom(&mut input)?; + let (modelname,creator,displayname) = get_mapinfo(&dom)?; - //Creator: [auto fill creator] - //DisplayName: [auto fill DisplayName] - //id: ["New" for blank because of my double enter key] - print!("Model name: {}\nCreator: {}\nDisplayName: {}\nAction or Upload Asset Id: ",modelname,creator,displayname); - std::io::Write::flush(&mut std::io::stdout())?; - let upload_action; - loop{ - let mut upload_action_string = String::new(); - std::io::stdin().read_line(&mut upload_action_string)?; - if let Ok(parsed_upload_action)=upload_action_string.parse::(){ - upload_action=parsed_upload_action; - break; - }else{ - print!("Action or Upload Asset Id: "); - std::io::Write::flush(&mut std::io::stdout())?; - } - } - match upload_action { - UploadAction::Upload(asset_id) => { - let status=std::process::Command::new("../rbxcompiler-linux-amd64") - .arg("--compile=false") - .arg("--group=6980477") - .arg(format!("--asset={}",asset_id)) - .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) - .status()?; - match status.code() { - Some(0)=>{ - //move file - let mut dest=std::path::PathBuf::from("maps/uploaded"); - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - Some(code)=>println!("upload failed! code={}",code), - None => println!("no status code!"), - } - } - UploadAction::Skip => continue, - UploadAction::New => { - let output=std::process::Command::new("../rbxcompiler-linux-amd64") - .arg("--compile=false") - .arg("--group=6980477") - .arg("--new-asset=true") - .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) - .output()?; - match output.status.code() { - Some(0)=>{ - //print output - println!("{}", std::str::from_utf8(output.stdout.as_slice())?); - //move file - let mut dest=std::path::PathBuf::from("maps/uploaded"); - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - Some(code)=>println!("upload failed! code={}",code), - None => println!("no status code!"), - } - } - UploadAction::Delete => std::fs::remove_file(file_thing.path())?, - } - } - Ok(()) + //Creator: [auto fill creator] + //DisplayName: [auto fill DisplayName] + //id: ["New" for blank because of my double enter key] + print!("Model name: {}\nCreator: {}\nDisplayName: {}\nAction or Upload Asset Id: ",modelname,creator,displayname); + std::io::Write::flush(&mut std::io::stdout())?; + let upload_action; + loop{ + let mut upload_action_string = String::new(); + std::io::stdin().read_line(&mut upload_action_string)?; + if let Ok(parsed_upload_action)=upload_action_string.parse::(){ + upload_action=parsed_upload_action; + break; + }else{ + print!("Action or Upload Asset Id: "); + std::io::Write::flush(&mut std::io::stdout())?; + } + } + match upload_action { + UploadAction::Upload(asset_id) => { + let status=std::process::Command::new("../rbxcompiler-linux-amd64") + .arg("--compile=false") + .arg("--group=6980477") + .arg(format!("--asset={}",asset_id)) + .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) + .status()?; + match status.code() { + Some(0)=>{ + //move file + let mut dest=std::path::PathBuf::from("maps/uploaded"); + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + Some(code)=>println!("upload failed! code={}",code), + None => println!("no status code!"), + } + } + UploadAction::Skip => continue, + UploadAction::New => { + let output=std::process::Command::new("../rbxcompiler-linux-amd64") + .arg("--compile=false") + .arg("--group=6980477") + .arg("--new-asset=true") + .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) + .output()?; + match output.status.code() { + Some(0)=>{ + //print output + println!("{}", std::str::from_utf8(output.stdout.as_slice())?); + //move file + let mut dest=std::path::PathBuf::from("maps/uploaded"); + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + Some(code)=>println!("upload failed! code={}",code), + None => println!("no status code!"), + } + } + UploadAction::Delete => std::fs::remove_file(file_thing.path())?, + } + } + Ok(()) } enum Interactive{ - Passed, - Blocked, - Flagged, + Passed, + Blocked, + Flagged, } enum ScriptAction { - Pass, - Replace(u32), - Flag, - Block, - Delete, + Pass, + Replace(u32), + Flag, + Block, + Delete, } enum ScriptActionParseResult { - Pass, - Block, - Exit, - Delete, + Pass, + Block, + Exit, + Delete, } struct ParseScriptActionErr; impl std::str::FromStr for ScriptActionParseResult { - type Err=ParseScriptActionErr; - fn from_str(s: &str) -> Result{ - if s=="pass\n"||s=="1\n"{ - Ok(Self::Pass) - }else if s=="block\n"{ - Ok(Self::Block) - }else if s=="exit\n"{ - Ok(Self::Exit) - }else if s=="delete\n"{ - Ok(Self::Delete) - }else{ - Err(ParseScriptActionErr) - } - } + type Err=ParseScriptActionErr; + fn from_str(s: &str) -> Result{ + if s=="pass\n"||s=="1\n"{ + Ok(Self::Pass) + }else if s=="block\n"{ + Ok(Self::Block) + }else if s=="exit\n"{ + Ok(Self::Exit) + }else if s=="delete\n"{ + Ok(Self::Delete) + }else{ + Err(ParseScriptActionErr) + } + } } fn interactive() -> AResult<()>{ - let mut id=get_id()?; - //Construct allowed scripts - let mut allowed_set=get_allowed_set()?; - let mut allowed_map=get_allowed_map()?; - let mut replace_map=get_replace_map()?; - let mut blocked = get_blocked()?; + let mut id=get_id()?; + //Construct allowed scripts + let mut allowed_set=get_allowed_set()?; + let mut allowed_map=get_allowed_map()?; + let mut replace_map=get_replace_map()?; + let mut blocked = get_blocked()?; - 'map_loop: for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - println!("processing map={:?}",file_thing.file_name()); - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut dom = get_dom(&mut input)?; + 'map_loop: for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + println!("processing map={:?}",file_thing.file_name()); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut dom = get_dom(&mut input)?; - let script_refs = get_script_refs(&dom); + let script_refs = get_script_refs(&dom); - //check scribb - let mut script_count=0; - let mut replace_count=0; - let mut block_count=0; - let mut fail_type=Interactive::Passed; - for &script_ref in script_refs.iter() { - if let Some(script)=dom.get_by_ref(script_ref){ - if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { - script_count+=1; - let source_action=if check_source_illegal_keywords(source) { - ScriptAction::Flag//script triggers flagging -> Flag - } else if blocked.contains(source) { - ScriptAction::Block//script is blocked -> Block - } else if allowed_set.contains(source) { - ScriptAction::Pass//script is allowed -> Pass - }else if let Some(replace_id)=replace_map.get(source) { - ScriptAction::Replace(*replace_id) - }else{ - //interactive logic goes here - print!("unresolved source location={}\naction: ",get_full_name(&dom, script)); - std::io::Write::flush(&mut std::io::stdout())?; - //load source into current.lua - std::fs::write("current.lua",source)?; - //prompt action in terminal - //wait for input - let script_action; - loop{ - let mut action_string = String::new(); - std::io::stdin().read_line(&mut action_string)?; - if let Ok(parsed_script_action)=action_string.parse::(){ - script_action=parsed_script_action; - break; - }else{ - print!("action: "); - std::io::Write::flush(&mut std::io::stdout())?; - } - } - //update allowed/replace/blocked - match script_action{ - ScriptActionParseResult::Pass => { - //if current.lua was updated, create an allowed and replace file and set script_action to replace(new_id) - let modified_source=std::fs::read_to_string("current.lua")?; - if &modified_source==source{ - //it's always new. - //insert allowed_set - allowed_set.insert(modified_source.clone()); - //insert allowed_map - allowed_map.insert(id,modified_source.clone()); - //write allowed/id.lua - std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; - id+=1; - ScriptAction::Pass - }else{ - //insert allowed_set - allowed_set.insert(modified_source.clone()); - //insert allowed_map - allowed_map.insert(id,modified_source.clone()); - //insert replace_map - replace_map.insert(source.clone(),id);//this cannot be reached if it already exists - //write allowed/id.lua - std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; - //write replace/id.lua - std::fs::write(format!("scripts/replace/{}.lua",id),source)?; - let ret=ScriptAction::Replace(id); - id+=1; - ret - } - }, - ScriptActionParseResult::Block => { - blocked.insert(source.clone()); - std::fs::write(format!("scripts/blocked/{}.lua",id),source)?; - id+=1; - ScriptAction::Block - }, - ScriptActionParseResult::Exit => break 'map_loop, - ScriptActionParseResult::Delete => ScriptAction::Delete, - } - }; - - let location=get_full_name(&dom, script); - match source_action{ - ScriptAction::Pass => println!("passed source location={}",location), - ScriptAction::Replace(replace_id)=>{ - //replace the source - if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),dom.get_by_ref_mut(script.referent())){ - replace_count+=1; - println!("replaced source id={} location={}",replace_id,location); - replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); - }else{ - panic!("failed to get replacement source id={} location={}",replace_id,location); - } - }, - ScriptAction::Delete => { - println!("deleted source location={}",location); - replace_count+=1;//trigger a new file generation - dom.destroy(script.referent()); - }, - ScriptAction::Flag => { - println!("flagged source location={}",location); - fail_type=Interactive::Flagged; - }, - ScriptAction::Block => { - block_count+=1; - println!("blocked source location={}",location); - match fail_type{ - Interactive::Passed => fail_type=Interactive::Blocked, - _=>(), - } - }, - } - }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); - } - }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); - } - } - let mut dest=match fail_type{ - Interactive::Passed => { - println!("map={:?} passed with {} {}",file_thing.file_name(),script_count,if script_count==1 {"script"}else{"scripts"}); - if replace_count==0{ - std::path::PathBuf::from("maps/passed") - }else{ - //create new file - println!("{} {} replaced - generating new file...",replace_count,if replace_count==1 {"script was"}else{"scripts were"}); - let mut dest=std::path::PathBuf::from("maps/passed"); - dest.push(file_thing.file_name()); - let output = std::io::BufWriter::new(std::fs::File::create(dest)?); - //write workspace:GetChildren()[1] - let workspace_children=dom.root().children(); - if workspace_children.len()!=1{ - return Err(anyhow::Error::msg("there can only be one model")); - } - rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; - //move original to processed folder - std::path::PathBuf::from("maps/unaltered") - } - },//write map into maps/processed - Interactive::Blocked => { - println!("map={:?} blocked with {}/{} {} blocked",file_thing.file_name(),block_count,script_count,if script_count==1 {"script"}else{"scripts"}); - std::path::PathBuf::from("maps/blocked") - },//write map into maps/blocked - Interactive::Flagged => { - println!("map={:?} flagged",file_thing.file_name()); - std::path::PathBuf::from("maps/flagged") - },//write map into maps/flagged - }; - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - std::fs::write("id",id.to_string())?; - Ok(()) + //check scribb + let mut script_count=0; + let mut replace_count=0; + let mut block_count=0; + let mut fail_type=Interactive::Passed; + for &script_ref in script_refs.iter() { + if let Some(script)=dom.get_by_ref(script_ref){ + if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { + script_count+=1; + let source_action=if check_source_illegal_keywords(source) { + ScriptAction::Flag//script triggers flagging -> Flag + } else if blocked.contains(source) { + ScriptAction::Block//script is blocked -> Block + } else if allowed_set.contains(source) { + ScriptAction::Pass//script is allowed -> Pass + }else if let Some(replace_id)=replace_map.get(source) { + ScriptAction::Replace(*replace_id) + }else{ + //interactive logic goes here + print!("unresolved source location={}\naction: ",get_full_name(&dom, script)); + std::io::Write::flush(&mut std::io::stdout())?; + //load source into current.lua + std::fs::write("current.lua",source)?; + //prompt action in terminal + //wait for input + let script_action; + loop{ + let mut action_string = String::new(); + std::io::stdin().read_line(&mut action_string)?; + if let Ok(parsed_script_action)=action_string.parse::(){ + script_action=parsed_script_action; + break; + }else{ + print!("action: "); + std::io::Write::flush(&mut std::io::stdout())?; + } + } + //update allowed/replace/blocked + match script_action{ + ScriptActionParseResult::Pass => { + //if current.lua was updated, create an allowed and replace file and set script_action to replace(new_id) + let modified_source=std::fs::read_to_string("current.lua")?; + if &modified_source==source{ + //it's always new. + //insert allowed_set + allowed_set.insert(modified_source.clone()); + //insert allowed_map + allowed_map.insert(id,modified_source.clone()); + //write allowed/id.lua + std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; + id+=1; + ScriptAction::Pass + }else{ + //insert allowed_set + allowed_set.insert(modified_source.clone()); + //insert allowed_map + allowed_map.insert(id,modified_source.clone()); + //insert replace_map + replace_map.insert(source.clone(),id);//this cannot be reached if it already exists + //write allowed/id.lua + std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; + //write replace/id.lua + std::fs::write(format!("scripts/replace/{}.lua",id),source)?; + let ret=ScriptAction::Replace(id); + id+=1; + ret + } + }, + ScriptActionParseResult::Block => { + blocked.insert(source.clone()); + std::fs::write(format!("scripts/blocked/{}.lua",id),source)?; + id+=1; + ScriptAction::Block + }, + ScriptActionParseResult::Exit => break 'map_loop, + ScriptActionParseResult::Delete => ScriptAction::Delete, + } + }; + + let location=get_full_name(&dom, script); + match source_action{ + ScriptAction::Pass => println!("passed source location={}",location), + ScriptAction::Replace(replace_id)=>{ + //replace the source + if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),dom.get_by_ref_mut(script.referent())){ + replace_count+=1; + println!("replaced source id={} location={}",replace_id,location); + replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); + }else{ + panic!("failed to get replacement source id={} location={}",replace_id,location); + } + }, + ScriptAction::Delete => { + println!("deleted source location={}",location); + replace_count+=1;//trigger a new file generation + dom.destroy(script.referent()); + }, + ScriptAction::Flag => { + println!("flagged source location={}",location); + fail_type=Interactive::Flagged; + }, + ScriptAction::Block => { + block_count+=1; + println!("blocked source location={}",location); + match fail_type{ + Interactive::Passed => fail_type=Interactive::Blocked, + _=>(), + } + }, + } + }else{ + panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); + } + }else{ + panic!("FATAL: failed to get_by_ref {:?}",script_ref); + } + } + let mut dest=match fail_type{ + Interactive::Passed => { + println!("map={:?} passed with {} {}",file_thing.file_name(),script_count,if script_count==1 {"script"}else{"scripts"}); + if replace_count==0{ + std::path::PathBuf::from("maps/passed") + }else{ + //create new file + println!("{} {} replaced - generating new file...",replace_count,if replace_count==1 {"script was"}else{"scripts were"}); + let mut dest=std::path::PathBuf::from("maps/passed"); + dest.push(file_thing.file_name()); + let output = std::io::BufWriter::new(std::fs::File::create(dest)?); + //write workspace:GetChildren()[1] + let workspace_children=dom.root().children(); + if workspace_children.len()!=1{ + return Err(anyhow::Error::msg("there can only be one model")); + } + rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; + //move original to processed folder + std::path::PathBuf::from("maps/unaltered") + } + },//write map into maps/processed + Interactive::Blocked => { + println!("map={:?} blocked with {}/{} {} blocked",file_thing.file_name(),block_count,script_count,if script_count==1 {"script"}else{"scripts"}); + std::path::PathBuf::from("maps/blocked") + },//write map into maps/blocked + Interactive::Flagged => { + println!("map={:?} flagged",file_thing.file_name()); + std::path::PathBuf::from("maps/flagged") + },//write map into maps/flagged + }; + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + std::fs::write("id",id.to_string())?; + Ok(()) } fn unzip_all()->AResult<()>{ - for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - println!("processing map={:?}",file_thing.file_name()); - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - match maybe_gzip_decode(&mut input){ - Ok(ReaderType::GZip(mut readable)) => { - //gzip - let mut extracted:Vec=Vec::new(); - //read the entire thing to the end so that I can clone the data and write a png to processed images - readable.read_to_end(&mut extracted)?; - //write extracted - let mut dest=std::path::PathBuf::from("maps/unzipped"); - dest.push(file_thing.file_name()); - std::fs::write(dest, &mut extracted)?; - //delete ugly gzip file - std::fs::remove_file(file_thing.path())?; - }, - Ok(ReaderType::Raw(_)) => (), - Err(e) => Err(e)?, - } - } - Ok(()) + for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + println!("processing map={:?}",file_thing.file_name()); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + match maybe_gzip_decode(&mut input){ + Ok(ReaderType::GZip(mut readable)) => { + //gzip + let mut extracted:Vec=Vec::new(); + //read the entire thing to the end so that I can clone the data and write a png to processed images + readable.read_to_end(&mut extracted)?; + //write extracted + let mut dest=std::path::PathBuf::from("maps/unzipped"); + dest.push(file_thing.file_name()); + std::fs::write(dest, &mut extracted)?; + //delete ugly gzip file + std::fs::remove_file(file_thing.path())?; + }, + Ok(ReaderType::Raw(_)) => (), + Err(e) => Err(e)?, + } + } + Ok(()) } fn write_attributes() -> AResult<()>{ - for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - println!("processing map={:?}",file_thing.file_name()); - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut dom = get_dom(&mut input)?; + for entry in std::fs::read_dir("maps/unprocessed")? { + let file_thing=entry?; + println!("processing map={:?}",file_thing.file_name()); + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut dom = get_dom(&mut input)?; - let button_refs = get_button_refs(&dom); + let button_refs = get_button_refs(&dom); - for &button_ref in &button_refs { - if let Some(button)=dom.get_by_ref_mut(button_ref){ - match button.properties.get_mut("Attributes"){ - Some(rbx_dom_weak::types::Variant::Attributes(attributes))=>{ - println!("Appending Ref={} to existing attributes for {}",button_ref,button.name); - attributes.insert("Ref".to_string(),rbx_dom_weak::types::Variant::String(button_ref.to_string())); - }, - None=>{ - println!("Creating new attributes with Ref={} for {}",button_ref,button.name); - let mut attributes=rbx_dom_weak::types::Attributes::new(); - attributes.insert("Ref".to_string(),rbx_dom_weak::types::Variant::String(button_ref.to_string())); - button.properties.insert("Attributes".to_string(),rbx_dom_weak::types::Variant::Attributes(attributes)); - } - _=>unreachable!("Fetching attributes did not return attributes."), - } - } - } - let mut dest={ - let mut dest=std::path::PathBuf::from("maps/attributes"); - dest.push(file_thing.file_name()); - let output = std::io::BufWriter::new(std::fs::File::create(dest)?); - //write workspace:GetChildren()[1] - let workspace_children=dom.root().children(); - if workspace_children.len()!=1{ - return Err(anyhow::Error::msg("there can only be one model")); - } - rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; - //move original to processed folder - std::path::PathBuf::from("maps/unaltered") - }; - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - Ok(()) + for &button_ref in &button_refs { + if let Some(button)=dom.get_by_ref_mut(button_ref){ + match button.properties.get_mut("Attributes"){ + Some(rbx_dom_weak::types::Variant::Attributes(attributes))=>{ + println!("Appending Ref={} to existing attributes for {}",button_ref,button.name); + attributes.insert("Ref".to_string(),rbx_dom_weak::types::Variant::String(button_ref.to_string())); + }, + None=>{ + println!("Creating new attributes with Ref={} for {}",button_ref,button.name); + let mut attributes=rbx_dom_weak::types::Attributes::new(); + attributes.insert("Ref".to_string(),rbx_dom_weak::types::Variant::String(button_ref.to_string())); + button.properties.insert("Attributes".to_string(),rbx_dom_weak::types::Variant::Attributes(attributes)); + } + _=>unreachable!("Fetching attributes did not return attributes."), + } + } + } + let mut dest={ + let mut dest=std::path::PathBuf::from("maps/attributes"); + dest.push(file_thing.file_name()); + let output = std::io::BufWriter::new(std::fs::File::create(dest)?); + //write workspace:GetChildren()[1] + let workspace_children=dom.root().children(); + if workspace_children.len()!=1{ + return Err(anyhow::Error::msg("there can only be one model")); + } + rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; + //move original to processed folder + std::path::PathBuf::from("maps/unaltered") + }; + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + } + Ok(()) } fn main() -> AResult<()> { - let cli = Cli::parse(); - match cli.command { - Commands::Download(map_list)=>download(map_list.maps), - Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), - Commands::ConvertTextures=>convert_textures(), - Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), - Commands::Extract(pathlist)=>extract(pathlist.paths), - Commands::WriteAttributes=>write_attributes(), - Commands::Interactive=>interactive(), - Commands::Replace=>replace(), - Commands::Scan=>scan(), - Commands::UnzipAll=>unzip_all(), - Commands::Upload=>upload(), - } + let cli = Cli::parse(); + match cli.command { + Commands::Download(map_list)=>download(map_list.maps), + Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), + Commands::ConvertTextures=>convert_textures(), + Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), + Commands::Extract(pathlist)=>extract(pathlist.paths), + Commands::WriteAttributes=>write_attributes(), + Commands::Interactive=>interactive(), + Commands::Replace=>replace(), + Commands::Scan=>scan(), + Commands::UnzipAll=>unzip_all(), + Commands::Upload=>upload(), + } } From b756dc979c161fc192d91c80557f1429202267da Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 8 Jan 2024 22:15:32 -0800 Subject: [PATCH 085/125] move main to top --- src/main.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main.rs b/src/main.rs index 231679ed..ca96ef8b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,6 +35,23 @@ struct MapList { maps: Vec, } +fn main() -> AResult<()> { + let cli = Cli::parse(); + match cli.command { + Commands::Download(map_list)=>download(map_list.maps), + Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), + Commands::ConvertTextures=>convert_textures(), + Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), + Commands::Extract(pathlist)=>extract(pathlist.paths), + Commands::WriteAttributes=>write_attributes(), + Commands::Interactive=>interactive(), + Commands::Replace=>replace(), + Commands::Scan=>scan(), + Commands::UnzipAll=>unzip_all(), + Commands::Upload=>upload(), + } +} + fn class_is_a(class: &str, superclass: &str) -> bool { if class==superclass { return true @@ -1021,20 +1038,3 @@ fn write_attributes() -> AResult<()>{ } Ok(()) } - -fn main() -> AResult<()> { - let cli = Cli::parse(); - match cli.command { - Commands::Download(map_list)=>download(map_list.maps), - Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), - Commands::ConvertTextures=>convert_textures(), - Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), - Commands::Extract(pathlist)=>extract(pathlist.paths), - Commands::WriteAttributes=>write_attributes(), - Commands::Interactive=>interactive(), - Commands::Replace=>replace(), - Commands::Scan=>scan(), - Commands::UnzipAll=>unzip_all(), - Commands::Upload=>upload(), - } -} From 835d4bbecd3494ada1cffc02b1013e1f5aad6b7c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 8 Jan 2024 20:21:24 -0800 Subject: [PATCH 086/125] add valve map deps --- Cargo.lock | 1007 +++++++++++++++++++++++++++++++++++----------------- Cargo.toml | 5 + 2 files changed, 684 insertions(+), 328 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28b58c4a..b7a45f8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,19 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -17,20 +30,11 @@ dependencies = [ "memchr", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -48,27 +52,27 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys", @@ -76,9 +80,24 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "approx" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" +dependencies = [ + "num-traits", +] + +[[package]] +name = "array-init" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" [[package]] name = "arrayref" @@ -92,17 +111,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -117,36 +125,41 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bcndecode-sys" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc29cbe4fdd4e9fef0cc6cacab9239a5d0a3dc822733c8fb8e1dd21868d0ab2" +checksum = "9164fe2e9d60bfddff0925911a4d47644f6330f37f8a186f74a177466844a168" dependencies = [ - "bindgen", "cc", ] [[package]] -name = "bindgen" -version = "0.53.3" +name = "beef" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "binrw" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173901312e9850391d4d7c1318c4e099fdc037d61870fca427429830efdb4e5f" dependencies = [ - "bitflags 1.3.2", - "cexpr", - "cfg-if 0.1.10", - "clang-sys", - "clap 2.34.0", - "env_logger", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", + "array-init", + "binrw_derive", + "bytemuck", +] + +[[package]] +name = "binrw_derive" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb515fdd6f8d3a357c8e19b8ec59ef53880807864329b1cb1cba5c53bf76557e" +dependencies = [ + "either", + "owo-colors", "proc-macro2", "quote", - "regex", - "rustc-hash", - "shlex", - "which", + "syn 1.0.109", ] [[package]] @@ -176,7 +189,7 @@ dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq", ] @@ -186,6 +199,15 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", +] + [[package]] name = "bytemuck" version = "1.14.0" @@ -203,9 +225,15 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] +[[package]] +name = "byteorder" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" + [[package]] name = "byteorder" version = "1.5.0" @@ -221,21 +249,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cexpr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -243,36 +256,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "clang-sys" -version = "0.29.3" +name = "cgmath" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" +checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317" dependencies = [ - "glob", - "libc", - "libloading", + "approx", + "num-traits", ] [[package]] name = "clap" -version = "2.34.0" +version = "4.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "clap" -version = "4.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "33e92c5c1a78c62968ec57dbc2440366a2d6e5a23faf829970ff1585dc6b18e2" dependencies = [ "clap_builder", "clap_derive", @@ -280,14 +277,14 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "f4323769dc8a61e2c39ad7dc26f6f2800524691a44d74fe3d1071a5c24db6370" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.10.0", + "strsim", ] [[package]] @@ -299,7 +296,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -326,47 +323,54 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if 1.0.0", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if 1.0.0", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -381,7 +385,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479dfe1e6737aa9e96c6ac7b69689dc4c32da8383f2c12744739d76afa8b66c4" dependencies = [ "bitflags 2.4.1", - "byteorder", + "byteorder 1.5.0", "enum-primitive-derive", "num-traits", ] @@ -404,16 +408,23 @@ dependencies = [ ] [[package]] -name = "env_logger" -version = "0.7.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "err-derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34a887c8df3ed90498c1c437ce21f211c8e27672921a8ffa293cb8d6d4caa9e" dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", + "proc-macro-error", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", + "synstructure", ] [[package]] @@ -434,13 +445,19 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +checksum = "209098dd6dfc4445aa6111f0e98653ac323eaa4dfd212c9ca3931bf9955c31bd" dependencies = [ "simd-adler32", ] +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + [[package]] name = "flate2" version = "1.0.28" @@ -465,24 +482,30 @@ dependencies = [ ] [[package]] -name = "futures-core" -version = "0.3.29" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -499,12 +522,6 @@ dependencies = [ "weezl", ] -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "half" version = "2.3.1" @@ -512,40 +529,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" dependencies = [ "bytemuck", - "cfg-if 1.0.0", + "cfg-if", "crunchy", ] +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] - [[package]] name = "image" version = "0.24.7" @@ -553,7 +558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" dependencies = [ "bytemuck", - "byteorder", + "byteorder 1.5.0", "color_quant", "exr", "gif", @@ -581,6 +586,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown", +] + [[package]] name = "intel_tex_2" version = "0.2.2" @@ -592,14 +607,23 @@ dependencies = [ [[package]] name = "ispc_rt" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0220406fa868139b6368b69f66118d211ec927a88ba41909622e67f08a11de" +checksum = "c8d30e08ddfd6fe26c3ee2e856dff022420cd0514ed16f5ccf2dc3e1d5cae578" dependencies = [ "libc", "num_cpus", ] +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -611,9 +635,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -638,7 +662,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -647,12 +671,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "lebe" version = "0.5.2" @@ -661,19 +679,15 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] -name = "libloading" -version = "0.5.2" +name = "libm" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "lock_api" @@ -691,6 +705,38 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "logos" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax 0.6.29", + "syn 2.0.48", +] + +[[package]] +name = "logos-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +dependencies = [ + "logos-codegen", +] + [[package]] name = "lz4" version = "1.24.0" @@ -711,12 +757,31 @@ dependencies = [ "libc", ] +[[package]] +name = "lzma" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "782ba3f542e8bc1349386c15e9dc3119ae6da96479f96b3863cc7a88bbdfd4e4" +dependencies = [ + "byteorder 0.5.3", +] + +[[package]] +name = "lzma-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" +dependencies = [ + "byteorder 1.5.0", + "crc", +] + [[package]] name = "map-tool" version = "1.3.0" dependencies = [ "anyhow", - "clap 4.4.8", + "clap", "flate2", "image", "image_dds", @@ -725,21 +790,40 @@ dependencies = [ "rbx_dom_weak", "rbx_reflection_database", "rbx_xml", + "vbsp", + "vmdl", + "vmt-parser", + "vpk", + "vtf", ] [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] -name = "memoffset" -version = "0.9.0" +name = "miette" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ - "autocfg", + "miette-derive", + "once_cell", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] @@ -761,16 +845,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "nom" -version = "5.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" -dependencies = [ - "memchr", - "version_check", -] - [[package]] name = "num-integer" version = "0.1.45" @@ -807,15 +881,68 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi", "libc", ] [[package]] -name = "once_cell" -version = "1.18.0" +name = "num_enum" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parse-display" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6509d08722b53e8dafe97f2027b22ccbe3a5db83cb352931e9716b0aa44bc5c" +dependencies = [ + "once_cell", + "parse-display-derive", + "regex", +] + +[[package]] +name = "parse-display-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68517892c8daf78da08c0db777fcc17e07f2f63ef70041718f8a7630ad84f341" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "regex", + "regex-syntax 0.7.5", + "structmeta", + "syn 2.0.48", +] [[package]] name = "paste" @@ -823,12 +950,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "pin-project" version = "1.1.3" @@ -846,9 +967,15 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + [[package]] name = "png" version = "0.17.10" @@ -869,31 +996,64 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "proc-macro2" -version = "1.0.69" +name = "proc-macro-crate" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f89dff0959d98c9758c88826cc002e2c3d0b9dfac4139711d1f30de442f1139b" +checksum = "d135ede8821cf6376eb7a64148901e1690b788c11ae94dc297ae917dbc91dc0e" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb156a45b6b9fe8027497422179fb65afc84d36707a7ca98297bf06bccb8d43f" +checksum = "4b322d7d65c1ab449be3c890fcbd0db6e1092d0dd05d79dba2dd28032cebeb05" dependencies = [ "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -905,17 +1065,11 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1056,7 +1210,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax", + "regex-syntax 0.8.2", ] [[package]] @@ -1067,9 +1221,21 @@ checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.2", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.2" @@ -1082,7 +1248,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" dependencies = [ - "byteorder", + "byteorder 1.5.0", "num-traits", "paste", ] @@ -1093,17 +1259,11 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" dependencies = [ - "byteorder", + "byteorder 1.5.0", "rmp", "serde", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustversion" version = "1.0.14" @@ -1118,29 +1278,34 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.192" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] -name = "shlex" -version = "0.1.1" +name = "serde_repr" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] [[package]] name = "simd-adler32" @@ -1164,10 +1329,10 @@ dependencies = [ ] [[package]] -name = "strsim" -version = "0.8.0" +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" @@ -1175,6 +1340,29 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "structmeta" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ad9e09554f0456d67a69c1584c9798ba733a5b50349a6c0d0948710523922d" +dependencies = [ + "proc-macro2", + "quote", + "structmeta-derive", + "syn 2.0.48", +] + +[[package]] +name = "structmeta-derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "strum" version = "0.24.1" @@ -1210,9 +1398,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1220,41 +1408,55 @@ dependencies = [ ] [[package]] -name = "termcolor" -version = "1.4.0" +name = "syn_util" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "6754c4559b79657554e9d8a0d56e65e490c76d382b9c23108364ec4125dea23c" dependencies = [ - "winapi-util", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "synstructure" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "unicode-width", + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "texpresso" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8277e703c934b9693d0773d5749faacc6366b3d81d012da556a4cfd4ab87f336" +dependencies = [ + "libm", ] [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1268,6 +1470,54 @@ dependencies = [ "weezl", ] +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + [[package]] name = "unicode-ident" version = "1.0.12" @@ -1280,6 +1530,12 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "utf8parse" version = "0.2.1" @@ -1287,10 +1543,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] -name = "vec_map" -version = "0.8.2" +name = "vbsp" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +checksum = "d9267540dab0c93bb5201c40ba3b2d027e2717bf355a8f9bf25377b06a5b32f6" +dependencies = [ + "ahash", + "arrayvec", + "binrw", + "bitflags 2.4.1", + "bv", + "cgmath", + "itertools", + "lzma-rs", + "num_enum", + "static_assertions", + "thiserror", + "vbsp-derive", + "zip-lzma", +] + +[[package]] +name = "vbsp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade687fadf34b1b7502387fc9eb7b4032ddc9b93022d31356e9984c957abaad" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "syn_util", +] + +[[package]] +name = "vdf-reader" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff9669f8e9cf7a82acac623509d7dbd119b4bc90da2469f1e7501097e04c5a3" +dependencies = [ + "logos", + "miette", + "parse-display", + "serde", + "thiserror", +] [[package]] name = "version_check" @@ -1298,6 +1594,60 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vmdl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "892922743c4c107372331efd8f67c57282590f8c18c26b4465c4b0e1e6678664" +dependencies = [ + "arrayvec", + "bitflags 2.4.1", + "bytemuck", + "cgmath", + "itertools", + "static_assertions", + "thiserror", + "tracing", +] + +[[package]] +name = "vmt-parser" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620c541038e4ea9ffcd32439f784ee60742c43da798d01ab62e4c005e7a22923" +dependencies = [ + "miette", + "serde", + "serde_repr", + "thiserror", + "vdf-reader", +] + +[[package]] +name = "vpk" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60ec10e731515f58d5494d472f027d9c6fc8500fcb790ff55751031bcad87b6b" +dependencies = [ + "ahash", + "binrw", + "thiserror", +] + +[[package]] +name = "vtf" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "404a2cecbe2920421b1bd2653308f6afc389577fa8cf7fb874121dc0eccd4773" +dependencies = [ + "byteorder 1.5.0", + "err-derive", + "image", + "num_enum", + "parse-display", + "texpresso", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1306,34 +1656,34 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1341,22 +1691,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "weezl" @@ -1364,60 +1714,20 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" -[[package]] -name = "which" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1430,45 +1740,54 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7520bbdec7211caa7c4e682eb1fbe07abe20cee6756b6e00f537c82c11816aa" +dependencies = [ + "memchr", +] [[package]] name = "xml-rs" @@ -1476,6 +1795,38 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "zip-lzma" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b480cb31fccfb2786565c0e0712865fd6f1ea0ea850c50316f643c3948196e63" +dependencies = [ + "byteorder 1.5.0", + "crc32fast", + "crossbeam-utils", + "lzma", +] + [[package]] name = "zune-inflate" version = "0.2.54" diff --git a/Cargo.toml b/Cargo.toml index 1c0d6997..d2ccbec1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,11 @@ rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" rbx_xml = "0.13.1" +vbsp = "0.5.0" +vmdl = "0.1.1" +vmt-parser = "0.1.1" +vpk = "0.2.0" +vtf = "0.2.1" #[profile.release] #lto = true From b88c6b899a682ed653d2994164d2696c4812a4a2 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 8 Jan 2024 22:15:46 -0800 Subject: [PATCH 087/125] commands for valve maps --- src/main.rs | 232 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) diff --git a/src/main.rs b/src/main.rs index ca96ef8b..45315876 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,8 @@ use anyhow::Result as AResult; #[command(author, version, about, long_about = None)] #[command(propagate_version = true)] struct Cli { + #[arg(long)] + path:Option, #[command(subcommand)] command: Commands, } @@ -14,7 +16,10 @@ struct Cli { enum Commands { Download(MapList), DownloadTextures(PathBufList), + ExtractTextures(PathBufList), ConvertTextures, + VPKContents, + BSPContents, DownloadMeshes(PathBufList), Extract(PathBufList), WriteAttributes, @@ -40,6 +45,9 @@ fn main() -> AResult<()> { match cli.command { Commands::Download(map_list)=>download(map_list.maps), Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), + Commands::ExtractTextures(pathlist)=>extract_textures(vec![cli.path.unwrap()],pathlist.paths), + Commands::VPKContents=>vpk_contents(cli.path.unwrap()), + Commands::BSPContents=>bsp_contents(cli.path.unwrap()), Commands::ConvertTextures=>convert_textures(), Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), Commands::Extract(pathlist)=>extract(pathlist.paths), @@ -1038,3 +1046,227 @@ fn write_attributes() -> AResult<()>{ } Ok(()) } + +enum VMTContent{ + VMT(String), + VTF(String), + Patch(vmt_parser::material::PatchMaterial), + Unsupported,//don't want to deal with whatever vmt variant + Unresolved,//could not locate a texture because of vmt content +} +impl VMTContent{ + fn vtf(opt:Option)->Self{ + match opt{ + Some(s)=>Self::VTF(s), + None=>Self::Unresolved, + } + } +} + +fn get_some_texture(material:vmt_parser::material::Material)->AResult{ + //just grab some texture from somewhere for now + Ok(match material{ + vmt_parser::material::Material::LightMappedGeneric(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::VertexLitGeneric(mat)=>VMTContent::vtf(mat.base_texture.or(mat.decal_texture)),//this just dies if there is none + vmt_parser::material::Material::VertexLitGenericDx6(mat)=>VMTContent::vtf(mat.base_texture.or(mat.decal_texture)), + vmt_parser::material::Material::UnlitGeneric(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::UnlitTwoTexture(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::Water(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::WorldVertexTransition(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::EyeRefract(mat)=>VMTContent::vtf(Some(mat.cornea_texture)), + vmt_parser::material::Material::SubRect(mat)=>VMTContent::VMT(mat.material),//recursive + vmt_parser::material::Material::Sprite(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::SpriteCard(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::Cable(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::Refract(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::Modulate(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::DecalModulate(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::Sky(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::Replacements(_mat)=>VMTContent::Unsupported, + vmt_parser::material::Material::Patch(mat)=>VMTContent::Patch(mat), + _=>return Err(anyhow::Error::msg("vmt failed to parse")), + }) +} + +fn get_vmtAResult>>>(find_stuff:&F,search_name:String)->AResult{ + if let Some(stuff)=find_stuff(search_name)?{ + //decode vmt and then write + let stuff=String::from_utf8(stuff)?; + let material=vmt_parser::from_str(stuff.as_str())?; + println!("vmt material={:?}",material); + return Ok(material); + } + Err(anyhow::Error::msg("vmt not found")) +} + +fn recursive_vmt_loaderAResult>>>(find_stuff:&F,material:vmt_parser::material::Material)->AResult>>{ + match get_some_texture(material)?{ + VMTContent::VMT(s)=>recursive_vmt_loader(find_stuff,get_vmt(find_stuff,s)?), + VMTContent::VTF(s)=>{ + let mut texture_file_name=std::path::PathBuf::from("materials"); + texture_file_name.push(s); + texture_file_name.set_extension("vtf"); + find_stuff(texture_file_name.into_os_string().into_string().unwrap()) + }, + VMTContent::Patch(mat)=>recursive_vmt_loader(find_stuff, + mat.resolve(|search_name|{ + match find_stuff(search_name.to_string())?{ + Some(bytes)=>Ok(String::from_utf8(bytes)?), + None=>Err(anyhow::Error::msg("could not find vmt")), + } + })? + ), + VMTContent::Unsupported=>{println!("Unsupported vmt");Ok(None)},//print and move on + VMTContent::Unresolved=>{println!("Unresolved vmt");Ok(None)}, + } +} + +fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ + let vpk_list:Vec=vpk_paths.into_iter().map(|vpk_path|vpk::VPK::read(&vpk_path).expect("vpk file does not exist")).collect(); + for path in paths{ + let mut deduplicate=std::collections::HashSet::new(); + let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; + for texture in bsp.textures(){ + deduplicate.insert(std::path::PathBuf::from(texture.name())); + } + //dedupe prop models + let mut model_dedupe=std::collections::HashSet::new(); + for prop in bsp.static_props(){ + model_dedupe.insert(prop.model()); + } + + //grab texture names from props + for model_name in model_dedupe{ + //.mdl, .vvd, .dx90.vtx + let mut path=std::path::PathBuf::from(model_name); + let file_name=std::path::PathBuf::from(path.file_stem().unwrap()); + path.pop(); + path.push(file_name); + let mut vvd_path=path.clone(); + let mut vtx_path=path.clone(); + vvd_path.set_extension("vvd"); + vtx_path.set_extension("dx90.vtx"); + match (bsp.pack.get(model_name),bsp.pack.get(vvd_path.as_os_str().to_str().unwrap()),bsp.pack.get(vtx_path.as_os_str().to_str().unwrap())){ + (Ok(Some(mdl_file)),Ok(Some(vvd_file)),Ok(Some(vtx_file)))=>{ + match (vmdl::mdl::Mdl::read(mdl_file.as_ref()),vmdl::vvd::Vvd::read(vvd_file.as_ref()),vmdl::vtx::Vtx::read(vtx_file.as_ref())){ + (Ok(mdl),Ok(vvd),Ok(vtx))=>{ + let model=vmdl::Model::from_parts(mdl,vtx,vvd); + for texture in model.textures(){ + for search_path in &texture.search_paths{ + let mut path=std::path::PathBuf::from(search_path.as_str()); + path.push(texture.name.as_str()); + deduplicate.insert(path); + } + } + }, + _=>println!("model_name={} error",model_name), + } + }, + _=>println!("no model name={}",model_name), + } + } + + let pack=&bsp.pack; + let vpk_list=&vpk_list; + std::thread::scope(move|s|{ + let mut thread_handles=Vec::new(); + for texture_name in deduplicate{ + let mut found_texture=false; + //LMAO imagine having to write type names + let write_image=|mut stuff,write_file_name|{ + let image=vtf::from_bytes(&mut stuff)?.highres_image.decode(0)?.to_rgba8(); + + let format=if image.width()%4!=0||image.height()%4!=0{ + image_dds::ImageFormat::R8G8B8A8Srgb + }else{ + image_dds::ImageFormat::BC7Srgb + }; + //this fails if the image dimensions are not a multiple of 4 + let dds = image_dds::dds_from_image( + &image, + format, + image_dds::Quality::Slow, + image_dds::Mipmaps::GeneratedAutomatic, + )?; + + //write dds + let mut dest=std::path::PathBuf::from("textures/dds"); + dest.push(write_file_name); + dest.set_extension("dds"); + std::fs::create_dir_all(dest.parent().unwrap())?; + let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); + dds.write(&mut writer)?; + Ok::<(),anyhow::Error>(()) + }; + let find_stuff=|search_file_name:String|{ + println!("search_file_name={}",search_file_name); + match pack.get(search_file_name.as_str())?{ + Some(file)=>return Ok(Some(file)), + _=>(), + } + //search pak list + for vpk_index in vpk_list{ + if let Some(vpk_entry)=vpk_index.tree.get(search_file_name.as_str()){ + return Ok(Some(match vpk_entry.get()?{ + std::borrow::Cow::Borrowed(bytes)=>bytes.to_vec(), + std::borrow::Cow::Owned(bytes)=>bytes, + })); + } + } + Ok::>,anyhow::Error>(None) + }; + let loader=|texture_name:String|{ + let mut texture_file_name=std::path::PathBuf::from("materials"); + //lower case + let texture_file_name_lowercase=texture_name.to_lowercase(); + texture_file_name.push(texture_file_name_lowercase.clone()); + //remove stem and search for both vtf and vmt files + let stem=std::path::PathBuf::from(texture_file_name.file_stem().unwrap()); + texture_file_name.pop(); + texture_file_name.push(stem); + //somehow search for both files + let mut texture_file_name_vmt=texture_file_name.clone(); + texture_file_name.set_extension("vtf"); + texture_file_name_vmt.set_extension("vmt"); + if let Some(stuff)=find_stuff(texture_file_name.to_string_lossy().to_string())?{ + return Ok(Some(stuff)) + } + recursive_vmt_loader(&find_stuff,get_vmt(&find_stuff,texture_file_name_vmt.to_string_lossy().to_string())?) + }; + if let Some(stuff)=loader(texture_name.to_string_lossy().to_string())?{ + found_texture=true; + let texture_name=texture_name.clone(); + thread_handles.push(s.spawn(move||write_image(stuff,texture_name))); + } + if !found_texture{ + println!("no data"); + } + } + for thread in thread_handles{ + match thread.join(){ + Ok(Err(e))=>println!("write error: {:?}",e), + Err(e)=>println!("thread error: {:?}",e), + Ok(_)=>(), + } + } + Ok::<(),anyhow::Error>(()) + })? + } + Ok(()) +} + +fn vpk_contents(vpk_path:std::path::PathBuf)->AResult<()>{ + let vpk_index=vpk::VPK::read(&vpk_path)?; + for (label,entry) in vpk_index.tree.into_iter(){ + println!("vpk label={} entry={:?}",label,entry); + } + Ok(()) +} + +fn bsp_contents(path:std::path::PathBuf)->AResult<()>{ + let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; + for file_name in bsp.pack.into_zip().into_inner().unwrap().file_names(){ + println!("file_name={:?}",file_name); + } + Ok(()) +} \ No newline at end of file From a17901d473fc8ece26cde261e9927ad840016151 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 12 Jan 2024 11:34:09 -0800 Subject: [PATCH 088/125] v1.4.0 valve maps --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7a45f8e..81dba7fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -778,7 +778,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.3.0" +version = "1.4.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index d2ccbec1..0d172448 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.3.0" +version = "1.4.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 7fbcb206ffea4ccda7cf2b17cc3feaa65a614332 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 30 Jan 2024 16:39:57 -0800 Subject: [PATCH 089/125] probably was wrong but idc about testing it --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 45315876..fd56d4eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -665,9 +665,14 @@ fn replace() -> AResult<()>{ println!("One or more scripts failed to replace."); }else{ let mut dest=std::path::PathBuf::from("maps/unprocessed"); - dest.set_file_name(file_thing.file_name()); + dest.push(file_thing.file_name()); let output = std::io::BufWriter::new(std::fs::File::open(dest)?); - rbx_binary::to_writer(output, &dom, &[dom.root_ref()])?; + //write workspace:GetChildren()[1] + let workspace_children=dom.root().children(); + if workspace_children.len()!=1{ + return Err(anyhow::Error::msg("there can only be one model")); + } + rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; } } Ok(()) From 4199d41d3f2ffa48dbd25b06f763e9aa31f590c1 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 30 Jan 2024 18:38:47 -0800 Subject: [PATCH 090/125] timeless License --- LICENSE | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/LICENSE b/LICENSE index 296c8bd9..468cd79a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,23 @@ -MIT License +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: -Copyright (c) 2023 StrafesNET Map Tool Developers +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file From dc9fd2c4427d1bad536bdce9707463b14dc39ec0 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 8 Mar 2024 09:55:17 -0800 Subject: [PATCH 091/125] import PathBuf --- src/main.rs | 68 ++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/main.rs b/src/main.rs index fd56d4eb..1df1b70b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use std::io::{Read, Seek}; +use std::{io::{Read, Seek}, path::PathBuf}; use clap::{Args, Parser, Subcommand}; use anyhow::Result as AResult; @@ -7,7 +7,7 @@ use anyhow::Result as AResult; #[command(propagate_version = true)] struct Cli { #[arg(long)] - path:Option, + path:Option, #[command(subcommand)] command: Commands, } @@ -32,7 +32,7 @@ enum Commands { #[derive(Args)] struct PathBufList { - paths:Vec + paths:Vec } #[derive(Args)] @@ -342,7 +342,7 @@ SurfaceAppearance.NormalMap SurfaceAppearance.RoughnessMap SurfaceAppearance.TexturePack */ -fn download_textures(paths: Vec) -> AResult<()>{ +fn download_textures(paths: Vec) -> AResult<()>{ println!("download_textures paths:{:?}",paths); let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); let shared_args=&[ @@ -387,7 +387,7 @@ fn download_textures(paths: Vec) -> AResult<()>{ } Ok(()) } -fn download_meshes(paths: Vec) -> AResult<()>{ +fn download_meshes(paths: Vec) -> AResult<()>{ println!("download_meshes paths:{:?}",paths); let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); let shared_args=&[ @@ -476,7 +476,7 @@ fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ )?; //write dds - let mut dest=std::path::PathBuf::from("textures/dds"); + let mut dest=PathBuf::from("textures/dds"); dest.push(file_thing.file_name()); dest.set_extension("dds"); let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); @@ -484,14 +484,14 @@ fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ if let Some(mut extracted)=extracted_input{ //write extracted to processed - let mut dest=std::path::PathBuf::from("textures/processed"); + let mut dest=PathBuf::from("textures/processed"); dest.push(file_thing.file_name()); std::fs::write(dest, &mut extracted)?; //delete ugly gzip file std::fs::remove_file(file_thing.path())?; }else{ //move file to processed - let mut dest=std::path::PathBuf::from("textures/processed"); + let mut dest=PathBuf::from("textures/processed"); dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?; } @@ -575,12 +575,12 @@ fn scan() -> AResult<()>{ } } let mut dest=match fail_type { - Scan::Passed => std::path::PathBuf::from("maps/processed"), + Scan::Passed => PathBuf::from("maps/processed"), Scan::Blocked => { println!("{:?} - {} {} not allowed.",file_thing.file_name(),fail_count,if fail_count==1 {"script"}else{"scripts"}); - std::path::PathBuf::from("maps/blocked") + PathBuf::from("maps/blocked") } - Scan::Flagged => std::path::PathBuf::from("maps/flagged") + Scan::Flagged => PathBuf::from("maps/flagged") }; dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?; @@ -589,7 +589,7 @@ fn scan() -> AResult<()>{ Ok(()) } -fn extract(paths: Vec) -> AResult<()>{ +fn extract(paths: Vec) -> AResult<()>{ let mut id = 0; //Construct allowed scripts let mut script_set = std::collections::HashSet::::new(); @@ -664,7 +664,7 @@ fn replace() -> AResult<()>{ if any_failed { println!("One or more scripts failed to replace."); }else{ - let mut dest=std::path::PathBuf::from("maps/unprocessed"); + let mut dest=PathBuf::from("maps/unprocessed"); dest.push(file_thing.file_name()); let output = std::io::BufWriter::new(std::fs::File::open(dest)?); //write workspace:GetChildren()[1] @@ -740,7 +740,7 @@ fn upload() -> AResult<()>{ match status.code() { Some(0)=>{ //move file - let mut dest=std::path::PathBuf::from("maps/uploaded"); + let mut dest=PathBuf::from("maps/uploaded"); dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?; } @@ -761,7 +761,7 @@ fn upload() -> AResult<()>{ //print output println!("{}", std::str::from_utf8(output.stdout.as_slice())?); //move file - let mut dest=std::path::PathBuf::from("maps/uploaded"); + let mut dest=PathBuf::from("maps/uploaded"); dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?; } @@ -948,11 +948,11 @@ fn interactive() -> AResult<()>{ Interactive::Passed => { println!("map={:?} passed with {} {}",file_thing.file_name(),script_count,if script_count==1 {"script"}else{"scripts"}); if replace_count==0{ - std::path::PathBuf::from("maps/passed") + PathBuf::from("maps/passed") }else{ //create new file println!("{} {} replaced - generating new file...",replace_count,if replace_count==1 {"script was"}else{"scripts were"}); - let mut dest=std::path::PathBuf::from("maps/passed"); + let mut dest=PathBuf::from("maps/passed"); dest.push(file_thing.file_name()); let output = std::io::BufWriter::new(std::fs::File::create(dest)?); //write workspace:GetChildren()[1] @@ -962,16 +962,16 @@ fn interactive() -> AResult<()>{ } rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; //move original to processed folder - std::path::PathBuf::from("maps/unaltered") + PathBuf::from("maps/unaltered") } },//write map into maps/processed Interactive::Blocked => { println!("map={:?} blocked with {}/{} {} blocked",file_thing.file_name(),block_count,script_count,if script_count==1 {"script"}else{"scripts"}); - std::path::PathBuf::from("maps/blocked") + PathBuf::from("maps/blocked") },//write map into maps/blocked Interactive::Flagged => { println!("map={:?} flagged",file_thing.file_name()); - std::path::PathBuf::from("maps/flagged") + PathBuf::from("maps/flagged") },//write map into maps/flagged }; dest.push(file_thing.file_name()); @@ -994,7 +994,7 @@ fn unzip_all()->AResult<()>{ //read the entire thing to the end so that I can clone the data and write a png to processed images readable.read_to_end(&mut extracted)?; //write extracted - let mut dest=std::path::PathBuf::from("maps/unzipped"); + let mut dest=PathBuf::from("maps/unzipped"); dest.push(file_thing.file_name()); std::fs::write(dest, &mut extracted)?; //delete ugly gzip file @@ -1034,7 +1034,7 @@ fn write_attributes() -> AResult<()>{ } } let mut dest={ - let mut dest=std::path::PathBuf::from("maps/attributes"); + let mut dest=PathBuf::from("maps/attributes"); dest.push(file_thing.file_name()); let output = std::io::BufWriter::new(std::fs::File::create(dest)?); //write workspace:GetChildren()[1] @@ -1044,7 +1044,7 @@ fn write_attributes() -> AResult<()>{ } rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; //move original to processed folder - std::path::PathBuf::from("maps/unaltered") + PathBuf::from("maps/unaltered") }; dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?; @@ -1108,7 +1108,7 @@ fn recursive_vmt_loaderAResult>>>(find_stuff:&F,ma match get_some_texture(material)?{ VMTContent::VMT(s)=>recursive_vmt_loader(find_stuff,get_vmt(find_stuff,s)?), VMTContent::VTF(s)=>{ - let mut texture_file_name=std::path::PathBuf::from("materials"); + let mut texture_file_name=PathBuf::from("materials"); texture_file_name.push(s); texture_file_name.set_extension("vtf"); find_stuff(texture_file_name.into_os_string().into_string().unwrap()) @@ -1126,13 +1126,13 @@ fn recursive_vmt_loaderAResult>>>(find_stuff:&F,ma } } -fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ +fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ let vpk_list:Vec=vpk_paths.into_iter().map(|vpk_path|vpk::VPK::read(&vpk_path).expect("vpk file does not exist")).collect(); for path in paths{ let mut deduplicate=std::collections::HashSet::new(); let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; for texture in bsp.textures(){ - deduplicate.insert(std::path::PathBuf::from(texture.name())); + deduplicate.insert(PathBuf::from(texture.name())); } //dedupe prop models let mut model_dedupe=std::collections::HashSet::new(); @@ -1143,8 +1143,8 @@ fn extract_textures(paths:Vec,vpk_paths:Vec,vpk_paths:Vec,vpk_paths:Vec,vpk_paths:Vec>,anyhow::Error>(None) }; let loader=|texture_name:String|{ - let mut texture_file_name=std::path::PathBuf::from("materials"); + let mut texture_file_name=PathBuf::from("materials"); //lower case let texture_file_name_lowercase=texture_name.to_lowercase(); texture_file_name.push(texture_file_name_lowercase.clone()); //remove stem and search for both vtf and vmt files - let stem=std::path::PathBuf::from(texture_file_name.file_stem().unwrap()); + let stem=PathBuf::from(texture_file_name.file_stem().unwrap()); texture_file_name.pop(); texture_file_name.push(stem); //somehow search for both files @@ -1260,7 +1260,7 @@ fn extract_textures(paths:Vec,vpk_paths:VecAResult<()>{ +fn vpk_contents(vpk_path:PathBuf)->AResult<()>{ let vpk_index=vpk::VPK::read(&vpk_path)?; for (label,entry) in vpk_index.tree.into_iter(){ println!("vpk label={} entry={:?}",label,entry); @@ -1268,7 +1268,7 @@ fn vpk_contents(vpk_path:std::path::PathBuf)->AResult<()>{ Ok(()) } -fn bsp_contents(path:std::path::PathBuf)->AResult<()>{ +fn bsp_contents(path:PathBuf)->AResult<()>{ let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; for file_name in bsp.pack.into_zip().into_inner().unwrap().file_names(){ println!("file_name={:?}",file_name); From c2d0a4487cb5b804a7f87e51f10a720cac0dfdee Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 8 Mar 2024 10:01:54 -0800 Subject: [PATCH 092/125] misc edits --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1df1b70b..4fba0b4e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -70,7 +70,7 @@ fn class_is_a(class: &str, superclass: &str) -> bool { return class_is_a(&class_super, superclass) } } - return false + false } fn recursive_collect_superclass(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, superclass: &str){ for &referent in instance.children() { @@ -172,8 +172,8 @@ fn load_dom(input:&mut R)->AResult{ match &first_8[0..4]{ b"{ match &first_8[4..8]{ - b"lox!"=>return rbx_binary::from_reader(input).map_err(anyhow::Error::msg), - b"lox "=>return rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), + b"lox!"=>rbx_binary::from_reader(input).map_err(anyhow::Error::msg), + b"lox "=>rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), other=>Err(anyhow::Error::msg(format!("Unknown Roblox file type {:?}",other))), } }, From c1ddcdb0c520c00c7dfd6bad6bb4f9660a7864c8 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 8 Mar 2024 10:01:57 -0800 Subject: [PATCH 093/125] remove mapfixer + asset-tool functions --- src/main.rs | 638 ---------------------------------------------------- 1 file changed, 638 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4fba0b4e..426e7bfd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,20 +14,13 @@ struct Cli { #[derive(Subcommand)] enum Commands { - Download(MapList), DownloadTextures(PathBufList), ExtractTextures(PathBufList), ConvertTextures, VPKContents, BSPContents, DownloadMeshes(PathBufList), - Extract(PathBufList), WriteAttributes, - Interactive, - Replace, - Scan, - UnzipAll, - Upload, } #[derive(Args)] @@ -35,28 +28,16 @@ struct PathBufList { paths:Vec } -#[derive(Args)] -struct MapList { - maps: Vec, -} - fn main() -> AResult<()> { let cli = Cli::parse(); match cli.command { - Commands::Download(map_list)=>download(map_list.maps), Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), Commands::ExtractTextures(pathlist)=>extract_textures(vec![cli.path.unwrap()],pathlist.paths), Commands::VPKContents=>vpk_contents(cli.path.unwrap()), Commands::BSPContents=>bsp_contents(cli.path.unwrap()), Commands::ConvertTextures=>convert_textures(), Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), - Commands::Extract(pathlist)=>extract(pathlist.paths), Commands::WriteAttributes=>write_attributes(), - Commands::Interactive=>interactive(), - Commands::Replace=>replace(), - Commands::Scan=>scan(), - Commands::UnzipAll=>unzip_all(), - Commands::Upload=>upload(), } } @@ -92,40 +73,7 @@ fn recursive_collect_regex(objects: &mut std::vec::Vec } } } -fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance) -> String{ - let mut full_name=instance.name.clone(); - let mut pref=instance.parent(); - while let Some(parent)=dom.get_by_ref(pref){ - full_name.insert(0, '.'); - full_name.insert_str(0, &parent.name); - pref=parent.parent(); - } - full_name -} -//download - //download list of maps to maps/unprocessed -//scan (scripts) - //iter maps/unprocessed - //passing moves to maps/verified - //failing moves to maps/blocked -//replace (edits & deletions) - //iter maps/blocked - //replace scripts and put in maps/unprocessed -//upload - //iter maps/verified - //interactively print DisplayName/Creator and ask for target upload ids -//interactive - //iter maps/unprocessed - //for each unique script, load it into the file current.lua and have it open in sublime text - //I can edit the file and it will edit it in place - //I pass/fail(with comment)/allow each script - -fn get_script_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ - let mut scripts = std::vec::Vec::new(); - recursive_collect_superclass(&mut scripts, dom, dom.root(),"LuaSourceContainer"); - scripts -} fn get_button_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ let mut buttons = std::vec::Vec::new(); recursive_collect_regex(&mut buttons, dom, dom.root(),lazy_regex::regex!(r"Button(\d+)$")); @@ -197,109 +145,6 @@ fn get_dom(input:&mut R)->AResult{ } } -fn get_id() -> AResult{ - match std::fs::read_to_string("id"){ - Ok(id_file)=>Ok(id_file.parse::()?), - Err(e) => match e.kind() { - std::io::ErrorKind::NotFound => Ok(0),//implicitly take on id=0 - _ => Err(e)?, - } - } -} - -fn get_set_from_file(file:&str) -> AResult>{ - let mut set=std::collections::HashSet::::new(); - for entry in std::fs::read_dir(file)? { - set.insert(std::fs::read_to_string(entry?.path())?); - } - Ok(set) -} - -fn get_allowed_set() -> AResult>{ - get_set_from_file("scripts/allowed") -} - -fn get_blocked() -> AResult>{ - get_set_from_file("scripts/blocked") -} - -fn get_allowed_map() -> AResult>{ - let mut allowed_map = std::collections::HashMap::::new(); - for entry in std::fs::read_dir("scripts/allowed")? { - let entry=entry?; - allowed_map.insert(entry.path().file_stem().unwrap().to_str().unwrap().parse::()?,std::fs::read_to_string(entry.path())?); - } - Ok(allowed_map) -} - -fn get_replace_map() -> AResult>{ - let mut replace = std::collections::HashMap::::new(); - for entry in std::fs::read_dir("scripts/replace")? { - let entry=entry?; - replace.insert(std::fs::read_to_string(entry.path())?,entry.path().file_stem().unwrap().to_str().unwrap().parse::()?); - } - Ok(replace) -} - -fn check_source_illegal_keywords(source:&String)->bool{ - source.find("getfenv").is_some()||source.find("require").is_some() -} - -fn find_first_child_class<'a>(dom:&'a rbx_dom_weak::WeakDom,instance:&'a rbx_dom_weak::Instance,name:&'a str,class:&'a str) -> Option<&'a rbx_dom_weak::Instance> { - for &referent in instance.children() { - if let Some(c) = dom.get_by_ref(referent) { - if c.name==name&&class_is_a(c.class.as_str(),class) { - return Some(c); - } - } - } - None -} - -fn get_mapinfo(dom:&rbx_dom_weak::WeakDom) -> AResult<(String,String,String)>{ - let workspace_children=dom.root().children(); - if workspace_children.len()!=1{ - return Err(anyhow::Error::msg("there can only be one model")); - } - if let Some(model_instance) = dom.get_by_ref(workspace_children[0]) { - if let (Some(creator),Some(displayname))=(find_first_child_class(dom, model_instance, "Creator", "StringValue"),find_first_child_class(dom, model_instance, "DisplayName", "StringValue")){ - if let ( - Some(rbx_dom_weak::types::Variant::String(creator_string)), - Some(rbx_dom_weak::types::Variant::String(displayname_string)) - )=( - creator.properties.get("Value"), - displayname.properties.get("Value") - ){ - return Ok((model_instance.name.clone(),creator_string.clone(),displayname_string.clone())); - } - } - } - return Err(anyhow::Error::msg("no stuff in map")); -} - -fn download(map_list: Vec) -> AResult<()>{ - let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); - let shared_args=&[ - "-q", - "--header", - header.as_str(), - "-O", - ]; - let processes_result:Result, _>=map_list.iter().map(|map_id|{ - std::process::Command::new("wget") - .args(shared_args) - .arg(format!("maps/unprocessed/{}.rbxm",map_id)) - .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",map_id)) - .spawn() - }).collect(); - //naively wait for all because idk how to make an async progress bar lmao - for child in processes_result?{ - let output=child.wait_with_output()?; - println!("map exit_success:{}",output.status.success()); - } - Ok(()) -} - struct RobloxAssetId(u64); struct RobloxAssetIdParseErr; impl std::str::FromStr for RobloxAssetId { @@ -524,489 +369,6 @@ fn convert_textures() -> AResult<()>{ Ok(()) } -enum Scan{ - Passed, - Blocked, - Flagged, -} - -fn scan() -> AResult<()>{ - let mut id = get_id()?; - //Construct allowed scripts - let allowed_set = get_allowed_set()?; - let mut blocked = get_blocked()?; - - for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - - let dom = get_dom(&mut input)?; - - let script_refs = get_script_refs(&dom); - - //check scribb - let mut fail_count=0; - let mut fail_type=Scan::Passed; - for &script_ref in script_refs.iter() { - if let Some(script)=dom.get_by_ref(script_ref){ - if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { - //flag keywords and instantly fail - if check_source_illegal_keywords(s){ - println!("{:?} - flagged.",file_thing.file_name()); - fail_type=Scan::Flagged; - break; - } - if allowed_set.contains(s) { - continue; - }else{ - fail_type=Scan::Blocked;//no need to check for Flagged, it breaks the loop. - fail_count+=1; - if !blocked.contains(s) { - blocked.insert(s.clone());//all fixed! just clone! - std::fs::write(format!("scripts/blocked/{}.lua",id),s)?; - id+=1; - } - } - }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); - } - }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); - } - } - let mut dest=match fail_type { - Scan::Passed => PathBuf::from("maps/processed"), - Scan::Blocked => { - println!("{:?} - {} {} not allowed.",file_thing.file_name(),fail_count,if fail_count==1 {"script"}else{"scripts"}); - PathBuf::from("maps/blocked") - } - Scan::Flagged => PathBuf::from("maps/flagged") - }; - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - std::fs::write("id",id.to_string())?; - Ok(()) -} - -fn extract(paths: Vec) -> AResult<()>{ - let mut id = 0; - //Construct allowed scripts - let mut script_set = std::collections::HashSet::::new(); - - for path in paths { - let file_name=path.file_name(); - let mut input = std::io::BufReader::new(std::fs::File::open(&path)?); - - let dom = get_dom(&mut input)?; - - let script_refs = get_script_refs(&dom); - - //extract scribb - for &script_ref in script_refs.iter() { - if let Some(script)=dom.get_by_ref(script_ref){ - if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { - if script_set.contains(s) { - continue; - }else{ - script_set.insert(s.clone()); - std::fs::write(format!("scripts/extracted/{:?}_{}_{}.lua",file_name,id,script.name),s)?; - id+=1; - } - }else{ - panic!("FATAL: failed to get source for {:?}",file_name); - } - }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); - } - } - } - println!("extracted {} {}",id,if id==1 {"script"}else{"scripts"}); - Ok(()) -} -fn replace() -> AResult<()>{ - let allowed_map=get_allowed_map()?; - let replace_map=get_replace_map()?; - - for entry in std::fs::read_dir("maps/blocked")? { - let file_thing=entry?; - - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut dom = get_dom(&mut input)?; - - let script_refs = get_script_refs(&dom); - - //check scribb - let mut any_failed=false; - for &script_ref in script_refs.iter() { - if let Some(script)=dom.get_by_ref(script_ref){ - if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { - if let (Some(replace_id),Some(replace_script))=(replace_map.get(source),dom.get_by_ref_mut(script.referent())) { - println!("replace {}",replace_id); - //replace the source - if let Some(replace_source)=allowed_map.get(replace_id){ - replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); - }else{ - println!("failed to get replacement source {}",replace_id); - any_failed=true; - } - }else{ - println!("failed to failed to get replace_id and replace_script"); - any_failed=true; - } - }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); - } - }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); - } - } - if any_failed { - println!("One or more scripts failed to replace."); - }else{ - let mut dest=PathBuf::from("maps/unprocessed"); - dest.push(file_thing.file_name()); - let output = std::io::BufWriter::new(std::fs::File::open(dest)?); - //write workspace:GetChildren()[1] - let workspace_children=dom.root().children(); - if workspace_children.len()!=1{ - return Err(anyhow::Error::msg("there can only be one model")); - } - rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; - } - } - Ok(()) -} - -enum UploadAction { - Upload(u64), - Skip, - New, - Delete, -} -struct ParseUploadActionErr; -impl std::str::FromStr for UploadAction { - type Err=ParseUploadActionErr; - fn from_str(s: &str) -> Result{ - if s=="skip\n"{ - Ok(Self::Skip) - }else if s=="new\n"{ - Ok(Self::New) - }else if s=="delete\n"{ - Ok(Self::Delete) - }else if let Ok(asset_id)=s[..s.len()-1].parse::(){ - Ok(Self::Upload(asset_id)) - }else{ - Err(ParseUploadActionErr) - } - } -} - -fn upload() -> AResult<()>{ - //interactive prompt per upload: - for entry in std::fs::read_dir("maps/passed")? { - let file_thing=entry?; - println!("map file: {:?}",file_thing.file_name()); - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - - let dom = get_dom(&mut input)?; - let (modelname,creator,displayname) = get_mapinfo(&dom)?; - - //Creator: [auto fill creator] - //DisplayName: [auto fill DisplayName] - //id: ["New" for blank because of my double enter key] - print!("Model name: {}\nCreator: {}\nDisplayName: {}\nAction or Upload Asset Id: ",modelname,creator,displayname); - std::io::Write::flush(&mut std::io::stdout())?; - let upload_action; - loop{ - let mut upload_action_string = String::new(); - std::io::stdin().read_line(&mut upload_action_string)?; - if let Ok(parsed_upload_action)=upload_action_string.parse::(){ - upload_action=parsed_upload_action; - break; - }else{ - print!("Action or Upload Asset Id: "); - std::io::Write::flush(&mut std::io::stdout())?; - } - } - match upload_action { - UploadAction::Upload(asset_id) => { - let status=std::process::Command::new("../rbxcompiler-linux-amd64") - .arg("--compile=false") - .arg("--group=6980477") - .arg(format!("--asset={}",asset_id)) - .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) - .status()?; - match status.code() { - Some(0)=>{ - //move file - let mut dest=PathBuf::from("maps/uploaded"); - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - Some(code)=>println!("upload failed! code={}",code), - None => println!("no status code!"), - } - } - UploadAction::Skip => continue, - UploadAction::New => { - let output=std::process::Command::new("../rbxcompiler-linux-amd64") - .arg("--compile=false") - .arg("--group=6980477") - .arg("--new-asset=true") - .arg(format!("--input={}",file_thing.path().into_os_string().into_string().unwrap())) - .output()?; - match output.status.code() { - Some(0)=>{ - //print output - println!("{}", std::str::from_utf8(output.stdout.as_slice())?); - //move file - let mut dest=PathBuf::from("maps/uploaded"); - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - Some(code)=>println!("upload failed! code={}",code), - None => println!("no status code!"), - } - } - UploadAction::Delete => std::fs::remove_file(file_thing.path())?, - } - } - Ok(()) -} - -enum Interactive{ - Passed, - Blocked, - Flagged, -} -enum ScriptAction { - Pass, - Replace(u32), - Flag, - Block, - Delete, -} -enum ScriptActionParseResult { - Pass, - Block, - Exit, - Delete, -} -struct ParseScriptActionErr; -impl std::str::FromStr for ScriptActionParseResult { - type Err=ParseScriptActionErr; - fn from_str(s: &str) -> Result{ - if s=="pass\n"||s=="1\n"{ - Ok(Self::Pass) - }else if s=="block\n"{ - Ok(Self::Block) - }else if s=="exit\n"{ - Ok(Self::Exit) - }else if s=="delete\n"{ - Ok(Self::Delete) - }else{ - Err(ParseScriptActionErr) - } - } -} - -fn interactive() -> AResult<()>{ - let mut id=get_id()?; - //Construct allowed scripts - let mut allowed_set=get_allowed_set()?; - let mut allowed_map=get_allowed_map()?; - let mut replace_map=get_replace_map()?; - let mut blocked = get_blocked()?; - - 'map_loop: for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - println!("processing map={:?}",file_thing.file_name()); - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut dom = get_dom(&mut input)?; - - let script_refs = get_script_refs(&dom); - - //check scribb - let mut script_count=0; - let mut replace_count=0; - let mut block_count=0; - let mut fail_type=Interactive::Passed; - for &script_ref in script_refs.iter() { - if let Some(script)=dom.get_by_ref(script_ref){ - if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { - script_count+=1; - let source_action=if check_source_illegal_keywords(source) { - ScriptAction::Flag//script triggers flagging -> Flag - } else if blocked.contains(source) { - ScriptAction::Block//script is blocked -> Block - } else if allowed_set.contains(source) { - ScriptAction::Pass//script is allowed -> Pass - }else if let Some(replace_id)=replace_map.get(source) { - ScriptAction::Replace(*replace_id) - }else{ - //interactive logic goes here - print!("unresolved source location={}\naction: ",get_full_name(&dom, script)); - std::io::Write::flush(&mut std::io::stdout())?; - //load source into current.lua - std::fs::write("current.lua",source)?; - //prompt action in terminal - //wait for input - let script_action; - loop{ - let mut action_string = String::new(); - std::io::stdin().read_line(&mut action_string)?; - if let Ok(parsed_script_action)=action_string.parse::(){ - script_action=parsed_script_action; - break; - }else{ - print!("action: "); - std::io::Write::flush(&mut std::io::stdout())?; - } - } - //update allowed/replace/blocked - match script_action{ - ScriptActionParseResult::Pass => { - //if current.lua was updated, create an allowed and replace file and set script_action to replace(new_id) - let modified_source=std::fs::read_to_string("current.lua")?; - if &modified_source==source{ - //it's always new. - //insert allowed_set - allowed_set.insert(modified_source.clone()); - //insert allowed_map - allowed_map.insert(id,modified_source.clone()); - //write allowed/id.lua - std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; - id+=1; - ScriptAction::Pass - }else{ - //insert allowed_set - allowed_set.insert(modified_source.clone()); - //insert allowed_map - allowed_map.insert(id,modified_source.clone()); - //insert replace_map - replace_map.insert(source.clone(),id);//this cannot be reached if it already exists - //write allowed/id.lua - std::fs::write(format!("scripts/allowed/{}.lua",id),modified_source)?; - //write replace/id.lua - std::fs::write(format!("scripts/replace/{}.lua",id),source)?; - let ret=ScriptAction::Replace(id); - id+=1; - ret - } - }, - ScriptActionParseResult::Block => { - blocked.insert(source.clone()); - std::fs::write(format!("scripts/blocked/{}.lua",id),source)?; - id+=1; - ScriptAction::Block - }, - ScriptActionParseResult::Exit => break 'map_loop, - ScriptActionParseResult::Delete => ScriptAction::Delete, - } - }; - - let location=get_full_name(&dom, script); - match source_action{ - ScriptAction::Pass => println!("passed source location={}",location), - ScriptAction::Replace(replace_id)=>{ - //replace the source - if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),dom.get_by_ref_mut(script.referent())){ - replace_count+=1; - println!("replaced source id={} location={}",replace_id,location); - replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); - }else{ - panic!("failed to get replacement source id={} location={}",replace_id,location); - } - }, - ScriptAction::Delete => { - println!("deleted source location={}",location); - replace_count+=1;//trigger a new file generation - dom.destroy(script.referent()); - }, - ScriptAction::Flag => { - println!("flagged source location={}",location); - fail_type=Interactive::Flagged; - }, - ScriptAction::Block => { - block_count+=1; - println!("blocked source location={}",location); - match fail_type{ - Interactive::Passed => fail_type=Interactive::Blocked, - _=>(), - } - }, - } - }else{ - panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); - } - }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); - } - } - let mut dest=match fail_type{ - Interactive::Passed => { - println!("map={:?} passed with {} {}",file_thing.file_name(),script_count,if script_count==1 {"script"}else{"scripts"}); - if replace_count==0{ - PathBuf::from("maps/passed") - }else{ - //create new file - println!("{} {} replaced - generating new file...",replace_count,if replace_count==1 {"script was"}else{"scripts were"}); - let mut dest=PathBuf::from("maps/passed"); - dest.push(file_thing.file_name()); - let output = std::io::BufWriter::new(std::fs::File::create(dest)?); - //write workspace:GetChildren()[1] - let workspace_children=dom.root().children(); - if workspace_children.len()!=1{ - return Err(anyhow::Error::msg("there can only be one model")); - } - rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; - //move original to processed folder - PathBuf::from("maps/unaltered") - } - },//write map into maps/processed - Interactive::Blocked => { - println!("map={:?} blocked with {}/{} {} blocked",file_thing.file_name(),block_count,script_count,if script_count==1 {"script"}else{"scripts"}); - PathBuf::from("maps/blocked") - },//write map into maps/blocked - Interactive::Flagged => { - println!("map={:?} flagged",file_thing.file_name()); - PathBuf::from("maps/flagged") - },//write map into maps/flagged - }; - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - std::fs::write("id",id.to_string())?; - Ok(()) -} - - -fn unzip_all()->AResult<()>{ - for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - println!("processing map={:?}",file_thing.file_name()); - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - match maybe_gzip_decode(&mut input){ - Ok(ReaderType::GZip(mut readable)) => { - //gzip - let mut extracted:Vec=Vec::new(); - //read the entire thing to the end so that I can clone the data and write a png to processed images - readable.read_to_end(&mut extracted)?; - //write extracted - let mut dest=PathBuf::from("maps/unzipped"); - dest.push(file_thing.file_name()); - std::fs::write(dest, &mut extracted)?; - //delete ugly gzip file - std::fs::remove_file(file_thing.path())?; - }, - Ok(ReaderType::Raw(_)) => (), - Err(e) => Err(e)?, - } - } - Ok(()) -} - fn write_attributes() -> AResult<()>{ for entry in std::fs::read_dir("maps/unprocessed")? { let file_thing=entry?; From 982b4aecac8dbe62a72bfce7d1628de9da88c8ed Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 8 Mar 2024 10:23:36 -0800 Subject: [PATCH 094/125] rewrite clap usage --- src/main.rs | 57 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/src/main.rs b/src/main.rs index 426e7bfd..75043007 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,38 +6,59 @@ use anyhow::Result as AResult; #[command(author, version, about, long_about = None)] #[command(propagate_version = true)] struct Cli { - #[arg(long)] - path:Option, #[command(subcommand)] command: Commands, } #[derive(Subcommand)] enum Commands { - DownloadTextures(PathBufList), - ExtractTextures(PathBufList), - ConvertTextures, - VPKContents, - BSPContents, - DownloadMeshes(PathBufList), - WriteAttributes, + DownloadTextures(DownloadTexturesSubcommand), + ExtractTextures(ExtractTexturesSubcommand), + ConvertTextures(ConvertTexturesSubcommand), + VPKContents(VPKContentsSubcommand), + BSPContents(BSPContentsSubcommand), + DownloadMeshes(DownloadMeshesSubcommand), + WriteAttributes(WriteAttributesSubcommand), } #[derive(Args)] -struct PathBufList { - paths:Vec +struct DownloadTexturesSubcommand { + roblox_files:Vec +} +#[derive(Args)] +struct ExtractTexturesSubcommand { + bsp_file:PathBuf, + vpk_dir_files:Vec +} +#[derive(Args)] +struct ConvertTexturesSubcommand { +} +#[derive(Args)] +struct VPKContentsSubcommand { + input_file:PathBuf, +} +#[derive(Args)] +struct BSPContentsSubcommand { + input_file:PathBuf, +} +#[derive(Args)] +struct DownloadMeshesSubcommand { + roblox_files:Vec +} +#[derive(Args)] +struct WriteAttributesSubcommand { } fn main() -> AResult<()> { let cli = Cli::parse(); match cli.command { - Commands::DownloadTextures(pathlist)=>download_textures(pathlist.paths), - Commands::ExtractTextures(pathlist)=>extract_textures(vec![cli.path.unwrap()],pathlist.paths), - Commands::VPKContents=>vpk_contents(cli.path.unwrap()), - Commands::BSPContents=>bsp_contents(cli.path.unwrap()), - Commands::ConvertTextures=>convert_textures(), - Commands::DownloadMeshes(pathlist)=>download_meshes(pathlist.paths), - Commands::WriteAttributes=>write_attributes(), + Commands::DownloadTextures(subcommand)=>download_textures(subcommand.roblox_files), + Commands::ExtractTextures(subcommand)=>extract_textures(vec![subcommand.bsp_file],subcommand.vpk_dir_files), + Commands::VPKContents(subcommand)=>vpk_contents(subcommand.input_file), + Commands::BSPContents(subcommand)=>bsp_contents(subcommand.input_file), + Commands::ConvertTextures(_subcommand)=>convert_textures(), + Commands::DownloadMeshes(subcommand)=>download_meshes(subcommand.roblox_files), + Commands::WriteAttributes(_subcommand)=>write_attributes(), } } From 0172675b04519e3637a73b93ca337f4d1e2036ae Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 8 Mar 2024 10:24:19 -0800 Subject: [PATCH 095/125] v1.5.0 rewrite clap usage + remove mapfixer stuff --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81dba7fb..0e28c539 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -778,7 +778,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.4.0" +version = "1.5.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 0d172448..fb0dd6e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.4.0" +version = "1.5.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 95b6272b1817577fa9c373729ecbab2b9a21e84c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Mar 2024 17:22:04 -0700 Subject: [PATCH 096/125] more texture sources + use asset tool to download meshes & textures --- src/main.rs | 189 ++++++++++++++++++++++------------------------------ 1 file changed, 78 insertions(+), 111 deletions(-) diff --git a/src/main.rs b/src/main.rs index 75043007..192f5995 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ -use std::{io::{Read, Seek}, path::PathBuf}; -use clap::{Args, Parser, Subcommand}; +use std::{collections::HashSet,io::{Read,Seek},path::PathBuf}; +use clap::{Args,Parser,Subcommand}; use anyhow::Result as AResult; +use rbx_dom_weak::Instance; #[derive(Parser)] #[command(author, version, about, long_about = None)] @@ -62,28 +63,6 @@ fn main() -> AResult<()> { } } -fn class_is_a(class: &str, superclass: &str) -> bool { - if class==superclass { - return true - } - let class_descriptor=rbx_reflection_database::get().classes.get(class); - if let Some(descriptor) = &class_descriptor { - if let Some(class_super) = &descriptor.superclass { - return class_is_a(&class_super, superclass) - } - } - false -} -fn recursive_collect_superclass(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, superclass: &str){ - for &referent in instance.children() { - if let Some(c) = dom.get_by_ref(referent) { - if class_is_a(c.class.as_str(), superclass) { - objects.push(c.referent());//copy ref - } - recursive_collect_superclass(objects,dom,c,superclass); - } - } -} fn recursive_collect_regex(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, regex: &lazy_regex::Lazy){ for &referent in instance.children() { if let Some(c) = dom.get_by_ref(referent) { @@ -100,23 +79,6 @@ fn get_button_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ recursive_collect_regex(&mut buttons, dom, dom.root(),lazy_regex::regex!(r"Button(\d+)$")); buttons } -fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ - let mut objects = std::vec::Vec::new(); - recursive_collect_superclass(&mut objects, dom, dom.root(),"Decal"); - //get ids - //clear vec - //next class - objects -} -fn get_mesh_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ - let mut objects = std::vec::Vec::new(); - recursive_collect_superclass(&mut objects, dom, dom.root(),"FileMesh"); - recursive_collect_superclass(&mut objects, dom, dom.root(),"MeshPart"); - //get ids - //clear vec - //next class - objects -} enum ReaderType<'a, R:Read+Seek>{ GZip(flate2::read::GzDecoder<&'a mut R>), @@ -208,94 +170,99 @@ SurfaceAppearance.NormalMap SurfaceAppearance.RoughnessMap SurfaceAppearance.TexturePack */ -fn download_textures(paths: Vec) -> AResult<()>{ - println!("download_textures paths:{:?}",paths); - let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); - let shared_args=&[ - "-q", - "--header", - header.as_str(), - "-O", - ]; - let mut texture_list=std::collections::HashSet::new(); - for path in paths { - let mut input = std::io::BufReader::new(std::fs::File::open(path.clone())?); - +fn accumulate_content_id(content_list:&mut HashSet,object:&Instance,property:&str){ + if let Some(rbx_dom_weak::types::Variant::Content(content))=object.properties.get(property){ + if let Ok(asset_id)=AsRef::::as_ref(content).parse::(){ + content_list.insert(asset_id.0); + }else{ + println!("Content failed to parse into AssetID: {:?}",content); + } + }else{ + println!("property={} does not exist for class={}",object.class.as_str(),property); + } +} +fn download_textures(paths:Vec)->AResult<()>{ + println!("Reading files, this could take a hot minute..."); + let mut texture_list=HashSet::new(); + for path in paths{ + let file=match std::fs::File::open(path.as_path()){ + Ok(file)=>file, + Err(e)=>{ + println!("file error {e}"); + continue; + } + }; + let mut input=std::io::BufReader::new(file); match get_dom(&mut input){ Ok(dom)=>{ - let object_refs = get_texture_refs(&dom); - for &object_ref in object_refs.iter() { - if let Some(object)=dom.get_by_ref(object_ref){ - if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("Texture") { - println!("Texture content:{:?}",content); - if let Ok(asset_id)=content.clone().into_string().parse::(){ - texture_list.insert(asset_id.0); - } - } + for object in dom.into_raw().1.into_values(){ + match object.class.as_str(){ + "Beam"=>accumulate_content_id(&mut texture_list,&object,"Texture"), + "Decal"=>accumulate_content_id(&mut texture_list,&object,"Texture"), + "Texture"=>accumulate_content_id(&mut texture_list,&object,"Texture"), + "FileMesh"=>accumulate_content_id(&mut texture_list,&object,"TextureId"), + "MeshPart"=>accumulate_content_id(&mut texture_list,&object,"TextureID"), + "ParticleEmitter"=>accumulate_content_id(&mut texture_list,&object,"Texture"), + "Sky"=>{ + accumulate_content_id(&mut texture_list,&object,"MoonTextureId"); + accumulate_content_id(&mut texture_list,&object,"SkyboxBk"); + accumulate_content_id(&mut texture_list,&object,"SkyboxDn"); + accumulate_content_id(&mut texture_list,&object,"SkyboxFt"); + accumulate_content_id(&mut texture_list,&object,"SkyboxLf"); + accumulate_content_id(&mut texture_list,&object,"SkyboxRt"); + accumulate_content_id(&mut texture_list,&object,"SkyboxUp"); + accumulate_content_id(&mut texture_list,&object,"SunTextureId"); + }, + _=>(), } } }, Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), } } - println!("Texture list:{:?}",texture_list); - let processes_result:Result, _>=texture_list.iter().map(|asset_id|{ - std::process::Command::new("wget") - .args(shared_args) - .arg(format!("textures/unprocessed/{}",asset_id)) - .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) - .spawn() - }).collect(); - //naively wait for all because idk how to make an async progress bar lmao - for child in processes_result?{ - let output=child.wait_with_output()?; - println!("texture exit_success:{}",output.status.success()); - } + let texture_list_string=texture_list.into_iter().map(|id|id.to_string()).collect::>(); + println!("Texture list:{:?}",texture_list_string.join(" ")); + let output=std::process::Command::new("asset-tool") + .args(["download","environment","RBXCOOKIE","textures/unprocessed/"]) + .args(texture_list_string) + .spawn()? + .wait_with_output()?; + println!("Asset tool exit_success:{}",output.status.success()); Ok(()) } -fn download_meshes(paths: Vec) -> AResult<()>{ - println!("download_meshes paths:{:?}",paths); - let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); - let shared_args=&[ - "-q", - "--header", - header.as_str(), - "-O", - ]; - let mut mesh_list=std::collections::HashSet::new(); - for path in paths { - let mut input = std::io::BufReader::new(std::fs::File::open(path.clone())?); - +fn download_meshes(paths:Vec)->AResult<()>{ + println!("Reading files, this could take a hot minute..."); + let mut mesh_list=HashSet::new(); + for path in paths{ + let file=match std::fs::File::open(path.as_path()){ + Ok(file)=>file, + Err(e)=>{ + println!("file error {e}"); + continue; + } + }; + let mut input=std::io::BufReader::new(file); match get_dom(&mut input){ Ok(dom)=>{ - let object_refs = get_mesh_refs(&dom); - for &object_ref in object_refs.iter() { - if let Some(object)=dom.get_by_ref(object_ref){ - if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("MeshId") { - println!("Mesh content:{:?}",content); - if let Ok(asset_id)=content.clone().into_string().parse::(){ - mesh_list.insert(asset_id.0); - } - } + for object in dom.into_raw().1.into_values(){ + match object.class.as_str(){ + "MeshPart"=>accumulate_content_id(&mut mesh_list,&object,"MeshId"), + "SpecialMesh"=>accumulate_content_id(&mut mesh_list,&object,"MeshId"), + _=>(), } } }, Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), } } - println!("Mesh list:{:?}",mesh_list); - let processes_result:Result, _>=mesh_list.iter().map(|asset_id|{ - std::process::Command::new("wget") - .args(shared_args) - .arg(format!("meshes/unprocessed/{}",asset_id)) - .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id)) - .spawn() - }).collect(); - //naively wait for all because idk how to make an async progress bar lmao - for child in processes_result?{ - let output=child.wait_with_output()?; - println!("Mesh exit_success:{}",output.status.success()); - } + let mesh_list_string=mesh_list.into_iter().map(|id|id.to_string()).collect::>(); + println!("Mesh list:{:?}",mesh_list_string.join(" ")); + let output=std::process::Command::new("asset-tool") + .args(["download","environment","RBXCOOKIE","meshes/"]) + .args(mesh_list_string) + .spawn()? + .wait_with_output()?; + println!("Asset tool exit_success:{}",output.status.success()); Ok(()) } From 52ba44c6be1d7cb6b4125f08c37ecee6412ad33b Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 19 Apr 2024 00:18:20 -0700 Subject: [PATCH 097/125] named args --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 192f5995..4a834f4f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,11 +24,14 @@ enum Commands { #[derive(Args)] struct DownloadTexturesSubcommand { + #[arg(long,required=true)] roblox_files:Vec } #[derive(Args)] struct ExtractTexturesSubcommand { + #[arg(long)] bsp_file:PathBuf, + #[arg(long)] vpk_dir_files:Vec } #[derive(Args)] @@ -36,14 +39,17 @@ struct ConvertTexturesSubcommand { } #[derive(Args)] struct VPKContentsSubcommand { + #[arg(long)] input_file:PathBuf, } #[derive(Args)] struct BSPContentsSubcommand { + #[arg(long)] input_file:PathBuf, } #[derive(Args)] struct DownloadMeshesSubcommand { + #[arg(long,required=true)] roblox_files:Vec } #[derive(Args)] From 4d97a490c1948caf50dff23d0e1d2df4871821ed Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 30 Jan 2024 18:48:51 -0800 Subject: [PATCH 098/125] convert snf --- Cargo.lock | 832 ++++++++++++++++++++++++++++------------------------ Cargo.toml | 3 + src/main.rs | 87 +++++- 3 files changed, 535 insertions(+), 387 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e28c539..da0224c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -23,56 +23,57 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys", @@ -80,9 +81,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "approx" @@ -101,9 +102,9 @@ checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" @@ -113,9 +114,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base64" @@ -125,9 +126,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bcndecode-sys" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9164fe2e9d60bfddff0925911a4d47644f6330f37f8a186f74a177466844a168" +checksum = "4bb5511db7dbf0f4c2ccdf9cba03871484b99abb657e7fdeacebce1b51fb6019" dependencies = [ "cc", ] @@ -145,7 +146,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "173901312e9850391d4d7c1318c4e099fdc037d61870fca427429830efdb4e5f" dependencies = [ "array-init", - "binrw_derive", + "binrw_derive 0.13.3", + "bytemuck", +] + +[[package]] +name = "binrw" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f36b7cb3ab9ff6a2858650d8dc360e783a5d14dc29594db48c56a3c233cc265" +dependencies = [ + "array-init", + "binrw_derive 0.14.0", "bytemuck", ] @@ -162,6 +174,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "binrw_derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ea7a8c5c8eeffffac6d54d172444e15beffac6f817fac714460a9a9aa88da3" +dependencies = [ + "either", + "owo-colors", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "bit_field" version = "0.10.2" @@ -176,15 +201,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake3" -version = "1.5.0" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" dependencies = [ "arrayref", "arrayvec", @@ -193,12 +218,6 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - [[package]] name = "bv" version = "0.11.1" @@ -210,22 +229,22 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -242,12 +261,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.0.83" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" [[package]] name = "cfg-if" @@ -267,9 +283,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.14" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e92c5c1a78c62968ec57dbc2440366a2d6e5a23faf829970ff1585dc6b18e2" +checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" dependencies = [ "clap_builder", "clap_derive", @@ -277,9 +293,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.14" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4323769dc8a61e2c39ad7dc26f6f2800524691a44d74fe3d1071a5c24db6370" +checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" dependencies = [ "anstream", "anstyle", @@ -289,21 +305,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "color_quant" @@ -313,9 +329,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "constant_time_eq" @@ -325,9 +341,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -340,9 +356,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -368,9 +384,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -384,7 +400,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479dfe1e6737aa9e96c6ac7b69689dc4c32da8383f2c12744739d76afa8b66c4" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.6.0", "byteorder 1.5.0", "enum-primitive-derive", "num-traits", @@ -392,9 +408,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "enum-primitive-derive" @@ -429,9 +445,9 @@ dependencies = [ [[package]] name = "exr" -version = "1.6.4" +version = "1.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279d3efcc55e19917fff7ab3ddd6c14afb6a90881a0078465196fe2f99d08c56" +checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" dependencies = [ "bit_field", "flume", @@ -445,9 +461,9 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209098dd6dfc4445aa6111f0e98653ac323eaa4dfd212c9ca3931bf9955c31bd" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" dependencies = [ "simd-adler32", ] @@ -460,9 +476,9 @@ checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -470,14 +486,10 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.14" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "pin-project", "spin", ] @@ -487,46 +499,38 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] name = "gif" -version = "0.12.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" dependencies = [ "color_quant", "weezl", ] [[package]] -name = "half" -version = "2.3.1" +name = "glam" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94" + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "bytemuck", "cfg-if", @@ -535,9 +539,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -546,16 +550,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "hermit-abi" -version = "0.3.3" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "id" +version = "0.1.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "2337e7a6c273082b672e377e159d7a168fb51438461b7c4033c79a515dd7a25a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] [[package]] name = "image" -version = "0.24.7" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" dependencies = [ "bytemuck", "byteorder 1.5.0", @@ -563,7 +584,6 @@ dependencies = [ "exr", "gif", "jpeg-decoder", - "num-rational", "num-traits", "png", "qoi", @@ -588,9 +608,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -605,6 +625,12 @@ dependencies = [ "ispc_rt", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "ispc_rt" version = "2.0.1" @@ -617,36 +643,27 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "jpeg-decoder" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" dependencies = [ "rayon", ] -[[package]] -name = "js-sys" -version = "0.3.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "lazy-regex" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +checksum = "576c8060ecfdf2e56995cf3274b4f2d71fa5e4fa3607c1c0b63c10180ee58741" dependencies = [ "lazy-regex-proc_macros", "once_cell", @@ -655,21 +672,21 @@ dependencies = [ [[package]] name = "lazy-regex-proc_macros" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +checksum = "9efb9e65d4503df81c615dc33ff07042a9408ac7f26b45abee25566f7fbfd12c" dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lebe" @@ -679,9 +696,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -691,9 +708,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -701,9 +718,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logos" @@ -725,7 +742,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -739,9 +756,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.24.0" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "958b4caa893816eea05507c20cfe47574a43d9a697138a7872990bba8a0ece68" dependencies = [ "libc", "lz4-sys", @@ -749,9 +766,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.4" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868" dependencies = [ "cc", "libc", @@ -786,10 +803,13 @@ dependencies = [ "image", "image_dds", "lazy-regex", - "rbx_binary", - "rbx_dom_weak", - "rbx_reflection_database", - "rbx_xml", + "rbx_binary 0.7.5", + "rbx_dom_weak 2.8.0", + "rbx_reflection_database 0.2.11+roblox-634", + "rbx_xml 0.13.4", + "strafesnet_deferred_loader", + "strafesnet_rbx_loader", + "strafesnet_snf", "vbsp", "vmdl", "vmt-parser", @@ -799,9 +819,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" @@ -823,54 +843,24 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", ] -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -887,23 +877,23 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -941,46 +931,26 @@ dependencies = [ "regex", "regex-syntax 0.7.5", "structmeta", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "png" -version = "0.17.10" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -997,9 +967,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-crate" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ "toml_edit", ] @@ -1030,30 +1000,30 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135ede8821cf6376eb7a64148901e1690b788c11ae94dc297ae917dbc91dc0e" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b322d7d65c1ab449be3c890fcbd0db6e1092d0dd05d79dba2dd28032cebeb05" +checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1067,9 +1037,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1106,9 +1076,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -1116,9 +1086,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -1126,57 +1096,130 @@ dependencies = [ [[package]] name = "rbx_binary" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad50c13afe91296dad6508ea7e29f4b665fa56cb664ad01eaf8fdbd3da69d5e1" +version = "0.7.4" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "18b401155b93f7151217bf51e36bdfa7bddcaf5f0d26b563c9ac3b08a3701c27" dependencies = [ "log", "lz4", "profiling", - "rbx_dom_weak", - "rbx_reflection", - "rbx_reflection_database", + "rbx_dom_weak 2.7.0", + "rbx_reflection 4.5.0", + "rbx_reflection_database 0.2.10+roblox-607", + "thiserror", +] + +[[package]] +name = "rbx_binary" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7f03840a9fe103f124d1f71c86eb6e2c70e8c0db0454a0eb353db3c64d6de8e" +dependencies = [ + "log", + "lz4", + "profiling", + "rbx_dom_weak 2.8.0", + "rbx_reflection 4.6.0", + "rbx_reflection_database 0.2.11+roblox-634", "thiserror", ] [[package]] name = "rbx_dom_weak" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843a2e0e1446623625943f7228d9d4b5cf3883017e3964733600682506864b34" +version = "2.7.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "850d0a6c8d22592b125c9a82f8654857a7aba10f061b930cc2b86438e54157f1" dependencies = [ - "rbx_types", + "rbx_types 1.8.0", "serde", ] [[package]] -name = "rbx_reflection" -version = "4.4.0" +name = "rbx_dom_weak" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41e762dfca3217d2d37da631de2fa0d1616edaa61a0a2633263d5d3305baf8c3" +checksum = "34d35df0f09290d32976f655366342676a6645b87c39b6949473b9d28a969733" dependencies = [ - "rbx_types", + "rbx_types 1.9.0", + "serde", +] + +[[package]] +name = "rbx_mesh" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "864ead0e98afce28c960f653d6203483834890d07f87b60e2f01415530a2fe9d" +dependencies = [ + "binrw 0.14.0", + "lazy-regex", +] + +[[package]] +name = "rbx_reflection" +version = "4.5.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "80d31f6675c27c9f60b2322feb5565f4a4389ccbb75de4e737915e9208f0831f" +dependencies = [ + "rbx_types 1.8.0", + "serde", + "thiserror", +] + +[[package]] +name = "rbx_reflection" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04ca5496737668378b17bacc9090ad361fc9c8b5f346bbd33162e083c98fa248" +dependencies = [ + "rbx_types 1.9.0", "serde", "thiserror", ] [[package]] name = "rbx_reflection_database" -version = "0.2.9+roblox-596" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b18f088a2b4aa66324ec97b5b6ffacb53188aef19f3497d95d6a1d1dbb28e66" +version = "0.2.10+roblox-607" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "f4da9f73ca317c158b922b757fe02317f7d3bc31d3f9fdb4a748d48b3951b8b8" dependencies = [ "lazy_static", - "rbx_reflection", + "rbx_reflection 4.5.0", + "rmp-serde", + "serde", +] + +[[package]] +name = "rbx_reflection_database" +version = "0.2.11+roblox-634" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399ab2e1fa27c8428fe43fc4148d8085d187881f1c59cefea3711a2112e9cccc" +dependencies = [ + "lazy_static", + "rbx_reflection 4.6.0", "rmp-serde", "serde", ] [[package]] name = "rbx_types" -version = "1.7.0" +version = "1.8.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "6d0d394018a8df53fcd91e990301fe6e47b94e15067edfcb019e6238ae60e8bb" +dependencies = [ + "base64", + "bitflags 1.3.2", + "blake3", + "lazy_static", + "rand", + "serde", + "thiserror", +] + +[[package]] +name = "rbx_types" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a991523e3ad5f43a4d121cb4a1e5bc23f7826bb4a1db5aa51e94f1073150ec" +checksum = "6ed7bbc0e1864143546b12ee0cf64a1a6f447d8ce7baf4fae755e4581929d230" dependencies = [ "base64", "bitflags 1.3.2", @@ -1189,39 +1232,53 @@ dependencies = [ [[package]] name = "rbx_xml" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc87343301303ff0510903fb7eb3dbd1c75bdb6ab780fea6091bdc3f58b5829f" +version = "0.13.3" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "d6d1a15f58a1e4b4f578abe6eb5e1461cb16eea82fb4a147d5995c9b79f08d1f" dependencies = [ "base64", "log", - "rbx_dom_weak", - "rbx_reflection", - "rbx_reflection_database", + "rbx_dom_weak 2.7.0", + "rbx_reflection 4.5.0", + "rbx_reflection_database 0.2.10+roblox-607", + "xml-rs", +] + +[[package]] +name = "rbx_xml" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c2abac6e71c97a56243f00c9c2def504fe4b698019d854dd8720da700a80d7c" +dependencies = [ + "base64", + "log", + "rbx_dom_weak 2.8.0", + "rbx_reflection 4.6.0", + "rbx_reflection_database 0.2.11+roblox-634", "xml-rs", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] @@ -1238,15 +1295,15 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rmp" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" dependencies = [ "byteorder 1.5.0", "num-traits", @@ -1255,9 +1312,9 @@ dependencies = [ [[package]] name = "rmp-serde" -version = "1.1.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" dependencies = [ "byteorder 1.5.0", "rmp", @@ -1266,9 +1323,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "scopeguard" @@ -1278,33 +1335,33 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.195" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1315,9 +1372,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "spin" @@ -1334,11 +1391,61 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strafesnet_common" +version = "0.2.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "74580c59a09194ce39db49cd814a5c2fc2d61513c88c6b811b5b40c0da6de057" +dependencies = [ + "bitflags 2.6.0", + "glam", + "id", +] + +[[package]] +name = "strafesnet_deferred_loader" +version = "0.3.1" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "c3891dcbdbc20b03cf561786b810e839ae7c11dd8810fd005f2474805ee9cccc" +dependencies = [ + "lazy-regex", + "strafesnet_common", + "vbsp", +] + +[[package]] +name = "strafesnet_rbx_loader" +version = "0.3.2" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "21ea93b0170063dd2a063a138c41e6f7a6c14a82c6553fa4ba32df65a26efc6e" +dependencies = [ + "bytemuck", + "glam", + "lazy-regex", + "rbx_binary 0.7.4", + "rbx_dom_weak 2.7.0", + "rbx_mesh", + "rbx_reflection_database 0.2.10+roblox-607", + "rbx_xml 0.13.3", + "strafesnet_common", +] + +[[package]] +name = "strafesnet_snf" +version = "0.1.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "50acdfdc5423577e7acb2c361c370753217f49bd567bf3e42c7375851080ccee" +dependencies = [ + "binrw 0.14.0", + "id", + "strafesnet_common", +] + [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "structmeta" @@ -1349,7 +1456,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1360,7 +1467,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1378,7 +1485,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -1398,9 +1505,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -1441,29 +1548,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "tiff" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" dependencies = [ "flate2", "jpeg-decoder", @@ -1472,15 +1579,15 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", @@ -1506,7 +1613,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1526,9 +1633,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -1538,9 +1645,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "vbsp" @@ -1550,8 +1657,8 @@ checksum = "d9267540dab0c93bb5201c40ba3b2d027e2717bf355a8f9bf25377b06a5b32f6" dependencies = [ "ahash", "arrayvec", - "binrw", - "bitflags 2.4.1", + "binrw 0.13.3", + "bitflags 2.6.0", "bv", "cgmath", "itertools", @@ -1590,9 +1697,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vmdl" @@ -1601,7 +1708,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "892922743c4c107372331efd8f67c57282590f8c18c26b4465c4b0e1e6678664" dependencies = [ "arrayvec", - "bitflags 2.4.1", + "bitflags 2.6.0", "bytemuck", "cgmath", "itertools", @@ -1630,7 +1737,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60ec10e731515f58d5494d472f027d9c6fc8500fcb790ff55751031bcad87b6b" dependencies = [ "ahash", - "binrw", + "binrw 0.13.3", "thiserror", ] @@ -1654,65 +1761,11 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasm-bindgen" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" - [[package]] name = "weezl" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "windows-sys" @@ -1725,13 +1778,14 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -1740,79 +1794,85 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.33" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7520bbdec7211caa7c4e682eb1fbe07abe20cee6756b6e00f537c82c11816aa" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] [[package]] name = "xml-rs" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" +checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fb0dd6e1..3c1ef266 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,9 @@ rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" rbx_xml = "0.13.1" +strafesnet_deferred_loader = { version = "0.3.1", features = ["legacy"], registry = "strafesnet" } +strafesnet_rbx_loader = { version = "0.3.1", registry = "strafesnet" } +strafesnet_snf = { version = "0.1.0", registry = "strafesnet" } vbsp = "0.5.0" vmdl = "0.1.1" vmt-parser = "0.1.1" diff --git a/src/main.rs b/src/main.rs index 4a834f4f..1402ed62 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,7 @@ struct Cli { #[derive(Subcommand)] enum Commands { + RobloxToSNF(RobloxToSNFSubcommand), DownloadTextures(DownloadTexturesSubcommand), ExtractTextures(ExtractTexturesSubcommand), ConvertTextures(ConvertTexturesSubcommand), @@ -22,6 +23,13 @@ enum Commands { WriteAttributes(WriteAttributesSubcommand), } +#[derive(Args)] +struct RobloxToSNFSubcommand { + #[arg(long)] + output_folder:PathBuf, + #[arg(required=true)] + input_files:Vec, +} #[derive(Args)] struct DownloadTexturesSubcommand { #[arg(long,required=true)] @@ -59,6 +67,7 @@ struct WriteAttributesSubcommand { fn main() -> AResult<()> { let cli = Cli::parse(); match cli.command { + Commands::RobloxToSNF(subcommand)=>convert_to_snf(subcommand.input_files,subcommand.output_folder), Commands::DownloadTextures(subcommand)=>download_textures(subcommand.roblox_files), Commands::ExtractTextures(subcommand)=>extract_textures(vec![subcommand.bsp_file],subcommand.vpk_dir_files), Commands::VPKContents(subcommand)=>vpk_contents(subcommand.input_file), @@ -630,4 +639,80 @@ fn bsp_contents(path:PathBuf)->AResult<()>{ println!("file_name={:?}",file_name); } Ok(()) -} \ No newline at end of file +} + +#[derive(Debug)] +enum ConvertError{ + IO(std::io::Error), + SNFMap(strafesnet_snf::map::Error), + RbxLoader(strafesnet_rbx_loader::ReadError), +} +impl std::fmt::Display for ConvertError{ + fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ + write!(f,"{self:?}") + } +} +impl std::error::Error for ConvertError{} + +fn convert_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ + let start = std::time::Instant::now(); + let mut threads:Vec>>=Vec::new(); + for path in pathlist{ + let output_folder=output_folder.clone(); + threads.push(std::thread::spawn(move ||{ + let dom=strafesnet_rbx_loader::read( + std::fs::File::open(path.as_path()) + .map_err(ConvertError::IO)? + ).map_err(ConvertError::RbxLoader)?; + let mut loader=strafesnet_deferred_loader::roblox_legacy(); + + let (texture_loader,mesh_loader)=loader.get_inner_mut(); + + let map_step1=strafesnet_rbx_loader::convert( + &dom, + |name|texture_loader.acquire_render_config_id(name), + |name|mesh_loader.acquire_mesh_id(name), + ); + + let meshpart_meshes=mesh_loader.load_meshes().map_err(ConvertError::IO)?; + + let map_step2=map_step1.add_meshpart_meshes_and_calculate_attributes( + meshpart_meshes.into_iter().map(|(mesh_id,loader_model)| + (mesh_id,strafesnet_rbx_loader::data::RobloxMeshBytes::new(loader_model.get())) + ) + ); + + let (textures,render_configs)=loader.into_render_configs().map_err(ConvertError::IO)?.consume(); + + let map=map_step2.add_render_configs_and_textures( + render_configs.into_iter(), + textures.into_iter().map(|(texture_id,texture)| + (texture_id,match texture{ + strafesnet_deferred_loader::texture::Texture::ImageDDS(data)=>data, + }) + ) + ); + + let mut dest=output_folder.clone(); + dest.push(path.file_stem().unwrap()); + dest.set_extension("snfm"); + let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; + + strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; + Ok(()) + })); + } + + let mut i=0; + let n_threads=threads.len(); + for thread in threads{ + i+=1; + if let Err(e)=thread.join(){ + println!("thread error: {:?}",e); + }else{ + println!("{}/{}",i,n_threads); + } + } + println!("{:?}", start.elapsed()); + Ok(()) +} From 60e0197344d5330ff1570d755873f3c8f5038e46 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 29 Jul 2024 16:47:47 -0700 Subject: [PATCH 099/125] v1.5.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da0224c2..db37065e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -795,7 +795,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.5.0" +version = "1.5.1" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 3c1ef266..892ea188 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.5.0" +version = "1.5.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From ed9701981d31a6532bde6f365d5eeb713c04b150 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 30 Jul 2024 12:24:23 -0700 Subject: [PATCH 100/125] limit parallel threads by waiting for the first thread to complete --- src/main.rs | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1402ed62..371e783f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -654,12 +654,27 @@ impl std::fmt::Display for ConvertError{ } impl std::error::Error for ConvertError{} +type MapThread=std::thread::JoinHandle>; + fn convert_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ + let n_paths=pathlist.len(); let start = std::time::Instant::now(); - let mut threads:Vec>>=Vec::new(); + let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); + let mut i=0; + let mut join_thread=|thread:MapThread|{ + i+=1; + if let Err(e)=thread.join(){ + println!("thread error: {:?}",e); + }else{ + println!("{}/{}",i,n_paths); + } + }; for path in pathlist{ + if 32<=threads.len(){ + join_thread(threads.pop_front().unwrap()); + } let output_folder=output_folder.clone(); - threads.push(std::thread::spawn(move ||{ + threads.push_back(std::thread::spawn(move ||{ let dom=strafesnet_rbx_loader::read( std::fs::File::open(path.as_path()) .map_err(ConvertError::IO)? @@ -703,15 +718,8 @@ fn convert_to_snf(pathlist:Vec,output_folder:PathBuf)->AResu })); } - let mut i=0; - let n_threads=threads.len(); for thread in threads{ - i+=1; - if let Err(e)=thread.join(){ - println!("thread error: {:?}",e); - }else{ - println!("{}/{}",i,n_threads); - } + join_thread(thread); } println!("{:?}", start.elapsed()); Ok(()) From 451f3ccecbd2f78a514b7ee9a2037445b1e76bf3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 31 Jul 2024 11:51:18 -0700 Subject: [PATCH 101/125] source to snf --- Cargo.lock | 13 ++++++++ Cargo.toml | 1 + src/main.rs | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 101 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db37065e..0fb2922c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -807,6 +807,7 @@ dependencies = [ "rbx_dom_weak 2.8.0", "rbx_reflection_database 0.2.11+roblox-634", "rbx_xml 0.13.4", + "strafesnet_bsp_loader", "strafesnet_deferred_loader", "strafesnet_rbx_loader", "strafesnet_snf", @@ -1391,6 +1392,18 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strafesnet_bsp_loader" +version = "0.1.3" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "6d4af68c422b5f57febbaa218f44ba02d413fd25e84afff9e45e557a8caee2ce" +dependencies = [ + "glam", + "strafesnet_common", + "vbsp", + "vmdl", +] + [[package]] name = "strafesnet_common" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index 892ea188..7c352bfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ rbx_binary = "0.7.1" rbx_dom_weak = "2.5.0" rbx_reflection_database = "0.2.7" rbx_xml = "0.13.1" +strafesnet_bsp_loader = { version = "0.1.3", registry = "strafesnet" } strafesnet_deferred_loader = { version = "0.3.1", features = ["legacy"], registry = "strafesnet" } strafesnet_rbx_loader = { version = "0.3.1", registry = "strafesnet" } strafesnet_snf = { version = "0.1.0", registry = "strafesnet" } diff --git a/src/main.rs b/src/main.rs index 371e783f..1ca01807 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,7 @@ struct Cli { #[derive(Subcommand)] enum Commands { RobloxToSNF(RobloxToSNFSubcommand), + SourceToSNF(SourceToSNFSubcommand), DownloadTextures(DownloadTexturesSubcommand), ExtractTextures(ExtractTexturesSubcommand), ConvertTextures(ConvertTexturesSubcommand), @@ -31,6 +32,13 @@ struct RobloxToSNFSubcommand { input_files:Vec, } #[derive(Args)] +struct SourceToSNFSubcommand { + #[arg(long)] + output_folder:PathBuf, + #[arg(required=true)] + input_files:Vec, +} +#[derive(Args)] struct DownloadTexturesSubcommand { #[arg(long,required=true)] roblox_files:Vec @@ -67,7 +75,8 @@ struct WriteAttributesSubcommand { fn main() -> AResult<()> { let cli = Cli::parse(); match cli.command { - Commands::RobloxToSNF(subcommand)=>convert_to_snf(subcommand.input_files,subcommand.output_folder), + Commands::RobloxToSNF(subcommand)=>roblox_to_snf(subcommand.input_files,subcommand.output_folder), + Commands::SourceToSNF(subcommand)=>source_to_snf(subcommand.input_files,subcommand.output_folder), Commands::DownloadTextures(subcommand)=>download_textures(subcommand.roblox_files), Commands::ExtractTextures(subcommand)=>extract_textures(vec![subcommand.bsp_file],subcommand.vpk_dir_files), Commands::VPKContents(subcommand)=>vpk_contents(subcommand.input_file), @@ -646,6 +655,7 @@ enum ConvertError{ IO(std::io::Error), SNFMap(strafesnet_snf::map::Error), RbxLoader(strafesnet_rbx_loader::ReadError), + BspLoader(strafesnet_bsp_loader::ReadError), } impl std::fmt::Display for ConvertError{ fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ @@ -656,7 +666,7 @@ impl std::error::Error for ConvertError{} type MapThread=std::thread::JoinHandle>; -fn convert_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ +fn roblox_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ let n_paths=pathlist.len(); let start = std::time::Instant::now(); let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); @@ -724,3 +734,78 @@ fn convert_to_snf(pathlist:Vec,output_folder:PathBuf)->AResu println!("{:?}", start.elapsed()); Ok(()) } + +fn source_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ + let n_paths=pathlist.len(); + let start = std::time::Instant::now(); + let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); + let mut i=0; + let mut join_thread=|thread:MapThread|{ + i+=1; + if let Err(e)=thread.join(){ + println!("thread error: {:?}",e); + }else{ + println!("{}/{}",i,n_paths); + } + }; + for path in pathlist{ + if 32<=threads.len(){ + join_thread(threads.pop_front().unwrap()); + } + let output_folder=output_folder.clone(); + threads.push_back(std::thread::spawn(move ||{ + let bsp=strafesnet_bsp_loader::read( + std::fs::File::open(path.as_path()) + .map_err(ConvertError::IO)? + ).map_err(ConvertError::BspLoader)?; + let mut loader=strafesnet_deferred_loader::source_legacy(); + + let (texture_loader,mesh_loader)=loader.get_inner_mut(); + + let map_step1=strafesnet_bsp_loader::convert( + &bsp, + |name|texture_loader.acquire_render_config_id(name), + |name|mesh_loader.acquire_mesh_id(name), + ); + + let prop_meshes=mesh_loader.load_meshes(&bsp.as_ref()); + + let map_step2=map_step1.add_prop_meshes( + //the type conflagulator 9000 + prop_meshes.into_iter().map(|(mesh_id,loader_model)| + (mesh_id,strafesnet_bsp_loader::data::ModelData{ + mdl:strafesnet_bsp_loader::data::MdlData::new(loader_model.mdl.get()), + vtx:strafesnet_bsp_loader::data::VtxData::new(loader_model.vtx.get()), + vvd:strafesnet_bsp_loader::data::VvdData::new(loader_model.vvd.get()), + }) + ), + |name|texture_loader.acquire_render_config_id(name), + ); + + let (textures,render_configs)=loader.into_render_configs().map_err(ConvertError::IO)?.consume(); + + let map=map_step2.add_render_configs_and_textures( + render_configs.into_iter(), + textures.into_iter().map(|(texture_id,texture)| + (texture_id,match texture{ + strafesnet_deferred_loader::texture::Texture::ImageDDS(data)=>data, + }) + ), + ); + + let mut dest=output_folder.clone(); + dest.push(path.file_stem().unwrap()); + dest.set_extension("snfm"); + let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; + + strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; + Ok(()) + })); + } + + for thread in threads{ + join_thread(thread); + } + println!("{:?}", start.elapsed()); + Ok(()) +} From d0c59b51a418765487d4ccdc7747bc68c5824fd6 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 31 Jul 2024 11:51:38 -0700 Subject: [PATCH 102/125] v1.5.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0fb2922c..57c72fe7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -795,7 +795,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.5.1" +version = "1.5.2" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 7c352bfc..96a1c610 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.5.1" +version = "1.5.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 9cdeed160f5b37935091428137a9961f84620be3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 21 Sep 2024 13:45:32 -0700 Subject: [PATCH 103/125] update rbx_loader & run scripts --- Cargo.lock | 378 +++++++++++++++++++++++++++------------------------- Cargo.toml | 10 +- src/main.rs | 5 +- 3 files changed, 207 insertions(+), 186 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57c72fe7..13115616 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -102,15 +102,15 @@ checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" @@ -207,9 +207,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake3" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" dependencies = [ "arrayref", "arrayvec", @@ -218,6 +218,16 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "bstr" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "bv" version = "0.11.1" @@ -229,22 +239,22 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.16.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" +checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -261,9 +271,12 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.7" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -312,7 +325,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -335,9 +348,9 @@ checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "crc" @@ -569,7 +582,7 @@ checksum = "2337e7a6c273082b672e377e159d7a168fb51438461b7c4033c79a515dd7a25a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -608,9 +621,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -661,9 +674,9 @@ dependencies = [ [[package]] name = "lazy-regex" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576c8060ecfdf2e56995cf3274b4f2d71fa5e4fa3607c1c0b63c10180ee58741" +checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda" dependencies = [ "lazy-regex-proc_macros", "once_cell", @@ -672,14 +685,14 @@ dependencies = [ [[package]] name = "lazy-regex-proc_macros" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9efb9e65d4503df81c615dc33ff07042a9408ac7f26b45abee25566f7fbfd12c" +checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163" dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -696,9 +709,19 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] name = "libm" @@ -742,7 +765,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -755,20 +778,28 @@ dependencies = [ ] [[package]] -name = "lz4" -version = "1.26.0" +name = "luau0-src" +version = "0.10.3+luau640" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958b4caa893816eea05507c20cfe47574a43d9a697138a7872990bba8a0ece68" +checksum = "2f39d12b514a676c943990cfbe6200fedcb9c293c8c9219d29be512a6969be92" +dependencies = [ + "cc", +] + +[[package]] +name = "lz4" +version = "1.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a231296ca742e418c43660cb68e082486ff2538e8db432bc818580f3965025ed" dependencies = [ - "libc", "lz4-sys", ] [[package]] name = "lz4-sys" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868" +checksum = "fcb44a01837a858d47e5a630d2ccf304c8efcc4b83b8f9f75b7a9ee4fcc6e57d" dependencies = [ "cc", "libc", @@ -803,10 +834,10 @@ dependencies = [ "image", "image_dds", "lazy-regex", - "rbx_binary 0.7.5", - "rbx_dom_weak 2.8.0", - "rbx_reflection_database 0.2.11+roblox-634", - "rbx_xml 0.13.4", + "rbx_binary", + "rbx_dom_weak", + "rbx_reflection_database", + "rbx_xml", "strafesnet_bsp_loader", "strafesnet_deferred_loader", "strafesnet_rbx_loader", @@ -844,7 +875,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -857,6 +888,32 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "mlua" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d111deb18a9c9bd33e1541309f4742523bfab01d276bfa9a27519f6de9c11dc7" +dependencies = [ + "bstr", + "libloading", + "mlua-sys", + "num-traits", + "once_cell", + "rustc-hash", +] + +[[package]] +name = "mlua-sys" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe026d6bd1583a9cf9080e189030ddaea7e6f5f0deb366a8e26f8a26c4135b8" +dependencies = [ + "cc", + "cfg-if", + "luau0-src", + "pkg-config", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -894,7 +951,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -932,7 +989,7 @@ dependencies = [ "regex", "regex-syntax 0.7.5", "structmeta", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -947,6 +1004,12 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + [[package]] name = "png" version = "0.17.13" @@ -962,15 +1025,18 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] @@ -1024,7 +1090,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1038,9 +1104,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1104,44 +1170,19 @@ dependencies = [ "log", "lz4", "profiling", - "rbx_dom_weak 2.7.0", - "rbx_reflection 4.5.0", - "rbx_reflection_database 0.2.10+roblox-607", - "thiserror", -] - -[[package]] -name = "rbx_binary" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f03840a9fe103f124d1f71c86eb6e2c70e8c0db0454a0eb353db3c64d6de8e" -dependencies = [ - "log", - "lz4", - "profiling", - "rbx_dom_weak 2.8.0", - "rbx_reflection 4.6.0", - "rbx_reflection_database 0.2.11+roblox-634", + "rbx_dom_weak", + "rbx_reflection", + "rbx_reflection_database", "thiserror", ] [[package]] name = "rbx_dom_weak" -version = "2.7.0" +version = "2.9.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "850d0a6c8d22592b125c9a82f8654857a7aba10f061b930cc2b86438e54157f1" +checksum = "2a6b916687c98aaea36f9c03e80906bfafab057bebee248628c8c04def807f43" dependencies = [ - "rbx_types 1.8.0", - "serde", -] - -[[package]] -name = "rbx_dom_weak" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d35df0f09290d32976f655366342676a6645b87c39b6949473b9d28a969733" -dependencies = [ - "rbx_types 1.9.0", + "rbx_types", "serde", ] @@ -1157,70 +1198,32 @@ dependencies = [ [[package]] name = "rbx_reflection" -version = "4.5.0" +version = "4.7.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "80d31f6675c27c9f60b2322feb5565f4a4389ccbb75de4e737915e9208f0831f" +checksum = "c1b43fe592a4ce6fe54eb215fb82735efbb516d2cc045a94e3dc0234ff293620" dependencies = [ - "rbx_types 1.8.0", - "serde", - "thiserror", -] - -[[package]] -name = "rbx_reflection" -version = "4.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04ca5496737668378b17bacc9090ad361fc9c8b5f346bbd33162e083c98fa248" -dependencies = [ - "rbx_types 1.9.0", + "rbx_types", "serde", "thiserror", ] [[package]] name = "rbx_reflection_database" -version = "0.2.10+roblox-607" +version = "0.2.12+roblox-638" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "f4da9f73ca317c158b922b757fe02317f7d3bc31d3f9fdb4a748d48b3951b8b8" +checksum = "2e772bb9e1bc0ebe65d338f876d1bb1ea22e15a8f9a82e8245028010c2fea3c9" dependencies = [ "lazy_static", - "rbx_reflection 4.5.0", - "rmp-serde", - "serde", -] - -[[package]] -name = "rbx_reflection_database" -version = "0.2.11+roblox-634" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399ab2e1fa27c8428fe43fc4148d8085d187881f1c59cefea3711a2112e9cccc" -dependencies = [ - "lazy_static", - "rbx_reflection 4.6.0", + "rbx_reflection", "rmp-serde", "serde", ] [[package]] name = "rbx_types" -version = "1.8.0" +version = "1.10.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "6d0d394018a8df53fcd91e990301fe6e47b94e15067edfcb019e6238ae60e8bb" -dependencies = [ - "base64", - "bitflags 1.3.2", - "blake3", - "lazy_static", - "rand", - "serde", - "thiserror", -] - -[[package]] -name = "rbx_types" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed7bbc0e1864143546b12ee0cf64a1a6f447d8ce7baf4fae755e4581929d230" +checksum = "d7a390c44034fa448c53bd0983dfc2d70d8d6b2f65be4f164d4bec8b6a2a2d09" dependencies = [ "base64", "bitflags 1.3.2", @@ -1239,31 +1242,17 @@ checksum = "d6d1a15f58a1e4b4f578abe6eb5e1461cb16eea82fb4a147d5995c9b79f08d1f" dependencies = [ "base64", "log", - "rbx_dom_weak 2.7.0", - "rbx_reflection 4.5.0", - "rbx_reflection_database 0.2.10+roblox-607", - "xml-rs", -] - -[[package]] -name = "rbx_xml" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2abac6e71c97a56243f00c9c2def504fe4b698019d854dd8720da700a80d7c" -dependencies = [ - "base64", - "log", - "rbx_dom_weak 2.8.0", - "rbx_reflection 4.6.0", - "rbx_reflection_database 0.2.11+roblox-634", + "rbx_dom_weak", + "rbx_reflection", + "rbx_reflection_database", "xml-rs", ] [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -1322,6 +1311,26 @@ dependencies = [ "serde", ] +[[package]] +name = "roblox_emulator" +version = "0.2.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "62ab7e851fb72ba7d690734e1d33d8bd47e83a25b7dbdb28b4771fd3425f7538" +dependencies = [ + "glam", + "mlua", + "rbx_dom_weak", + "rbx_reflection", + "rbx_reflection_database", + "rbx_types", +] + +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustversion" version = "1.0.17" @@ -1336,22 +1345,22 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1362,9 +1371,15 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "simd-adler32" version = "0.3.7" @@ -1394,9 +1409,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strafesnet_bsp_loader" -version = "0.1.3" +version = "0.1.5" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "6d4af68c422b5f57febbaa218f44ba02d413fd25e84afff9e45e557a8caee2ce" +checksum = "35ee2c534efa039ad17ca41893ba1d75fafff014076353ac676c73fc808b9e44" dependencies = [ "glam", "strafesnet_common", @@ -1406,10 +1421,11 @@ dependencies = [ [[package]] name = "strafesnet_common" -version = "0.2.0" +version = "0.4.1" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "74580c59a09194ce39db49cd814a5c2fc2d61513c88c6b811b5b40c0da6de057" +checksum = "9a2621612e675a8f804abbbbe3b60caeafe58a2422cccbe453268d6f457df4f3" dependencies = [ + "arrayvec", "bitflags 2.6.0", "glam", "id", @@ -1417,9 +1433,9 @@ dependencies = [ [[package]] name = "strafesnet_deferred_loader" -version = "0.3.1" +version = "0.3.3" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "c3891dcbdbc20b03cf561786b810e839ae7c11dd8810fd005f2474805ee9cccc" +checksum = "596aba6d2747818781336ad95a1ee496e37f70052fd625a299fc7a555a6938d4" dependencies = [ "lazy-regex", "strafesnet_common", @@ -1428,26 +1444,27 @@ dependencies = [ [[package]] name = "strafesnet_rbx_loader" -version = "0.3.2" +version = "0.3.6" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "21ea93b0170063dd2a063a138c41e6f7a6c14a82c6553fa4ba32df65a26efc6e" +checksum = "edb389090ec58f2cb2ec93eafd362c9ef5dc4895092145dbd5d86602cdab3e5d" dependencies = [ "bytemuck", "glam", "lazy-regex", - "rbx_binary 0.7.4", - "rbx_dom_weak 2.7.0", + "rbx_binary", + "rbx_dom_weak", "rbx_mesh", - "rbx_reflection_database 0.2.10+roblox-607", - "rbx_xml 0.13.3", + "rbx_reflection_database", + "rbx_xml", + "roblox_emulator", "strafesnet_common", ] [[package]] name = "strafesnet_snf" -version = "0.1.0" +version = "0.1.3" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "50acdfdc5423577e7acb2c361c370753217f49bd567bf3e42c7375851080ccee" +checksum = "a9ae481152d0389be29967e1d5f0377498df8ff9638175d56cd8e2c2e6982bfa" dependencies = [ "binrw 0.14.0", "id", @@ -1469,7 +1486,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1480,7 +1497,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1518,9 +1535,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -1576,7 +1593,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1592,15 +1609,15 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ "indexmap", "toml_datetime", @@ -1626,7 +1643,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1640,9 +1657,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-width" @@ -1855,18 +1872,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] [[package]] name = "xml-rs" -version = "0.8.20" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" +checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" [[package]] name = "zerocopy" @@ -1874,6 +1891,7 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder 1.5.0", "zerocopy-derive", ] @@ -1885,7 +1903,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 96a1c610..8022a59a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,13 +12,13 @@ flate2 = "1.0.27" image = "0.24.7" image_dds = "0.1.1" lazy-regex = "3.1.0" -rbx_binary = "0.7.1" -rbx_dom_weak = "2.5.0" -rbx_reflection_database = "0.2.7" -rbx_xml = "0.13.1" +rbx_binary = { version = "0.7.4", registry = "strafesnet" } +rbx_dom_weak = { version = "2.7.0", registry = "strafesnet" } +rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" } +rbx_xml = { version = "0.13.3", registry = "strafesnet" } strafesnet_bsp_loader = { version = "0.1.3", registry = "strafesnet" } strafesnet_deferred_loader = { version = "0.3.1", features = ["legacy"], registry = "strafesnet" } -strafesnet_rbx_loader = { version = "0.3.1", registry = "strafesnet" } +strafesnet_rbx_loader = { version = "0.3.6", registry = "strafesnet" } strafesnet_snf = { version = "0.1.0", registry = "strafesnet" } vbsp = "0.5.0" vmdl = "0.1.1" diff --git a/src/main.rs b/src/main.rs index 1ca01807..d9e5e173 100644 --- a/src/main.rs +++ b/src/main.rs @@ -685,10 +685,13 @@ fn roblox_to_snf(pathlist:Vec,output_folder:PathBuf)->AResul } let output_folder=output_folder.clone(); threads.push_back(std::thread::spawn(move ||{ - let dom=strafesnet_rbx_loader::read( + let mut dom=strafesnet_rbx_loader::read( std::fs::File::open(path.as_path()) .map_err(ConvertError::IO)? ).map_err(ConvertError::RbxLoader)?; + + dom.run_scripts(); + let mut loader=strafesnet_deferred_loader::roblox_legacy(); let (texture_loader,mesh_loader)=loader.get_inner_mut(); From 6bab31f3b3d1c106d758af58ccf6baed864d4ea5 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 21 Sep 2024 13:47:40 -0700 Subject: [PATCH 104/125] silence dead code --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index d9e5e173..835ece5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -651,6 +651,7 @@ fn bsp_contents(path:PathBuf)->AResult<()>{ } #[derive(Debug)] +#[allow(dead_code)] enum ConvertError{ IO(std::io::Error), SNFMap(strafesnet_snf::map::Error), From 6f5a3c517632b1f8994cd676ca927b6d694b7e8a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 21 Sep 2024 13:48:23 -0700 Subject: [PATCH 105/125] v1.5.3 roblox emulator --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13115616..a85cb739 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -826,7 +826,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.5.2" +version = "1.5.3" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 8022a59a..b9236ccc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.5.2" +version = "1.5.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From b6a5324ae7fb7f5629009c7b336690780ff1303e Mon Sep 17 00:00:00 2001 From: 9382 Date: Wed, 25 Sep 2024 23:35:45 +0100 Subject: [PATCH 106/125] Fix asset-tool invocations when downloading assets --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 835ece5f..ef42af5e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -247,7 +247,7 @@ fn download_textures(paths:Vec)->AResult<()>{ let texture_list_string=texture_list.into_iter().map(|id|id.to_string()).collect::>(); println!("Texture list:{:?}",texture_list_string.join(" ")); let output=std::process::Command::new("asset-tool") - .args(["download","environment","RBXCOOKIE","textures/unprocessed/"]) + .args(["download","--cookie-literal","","--output-folder","textures/unprocessed/"]) .args(texture_list_string) .spawn()? .wait_with_output()?; @@ -282,7 +282,7 @@ fn download_meshes(paths:Vec)->AResult<()>{ let mesh_list_string=mesh_list.into_iter().map(|id|id.to_string()).collect::>(); println!("Mesh list:{:?}",mesh_list_string.join(" ")); let output=std::process::Command::new("asset-tool") - .args(["download","environment","RBXCOOKIE","meshes/"]) + .args(["download","--cookie-literal","","--output-folder","meshes/"]) .args(mesh_list_string) .spawn()? .wait_with_output()?; From a56c114d0899de5163c2a0f38061ecb1fa88b344 Mon Sep 17 00:00:00 2001 From: 9382 Date: Wed, 25 Sep 2024 23:48:59 +0100 Subject: [PATCH 107/125] Automatically create sub-directories when downloading assets; move dds files into the textures folder the latter change is because roblox-to-snf expects the files in textures, not textures/dds --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index ef42af5e..2e4abd22 100644 --- a/src/main.rs +++ b/src/main.rs @@ -246,6 +246,7 @@ fn download_textures(paths:Vec)->AResult<()>{ } let texture_list_string=texture_list.into_iter().map(|id|id.to_string()).collect::>(); println!("Texture list:{:?}",texture_list_string.join(" ")); + std::fs::create_dir_all("textures/unprocessed")?; let output=std::process::Command::new("asset-tool") .args(["download","--cookie-literal","","--output-folder","textures/unprocessed/"]) .args(texture_list_string) @@ -281,6 +282,7 @@ fn download_meshes(paths:Vec)->AResult<()>{ } let mesh_list_string=mesh_list.into_iter().map(|id|id.to_string()).collect::>(); println!("Mesh list:{:?}",mesh_list_string.join(" ")); + std::fs::create_dir_all("meshes/")?; let output=std::process::Command::new("asset-tool") .args(["download","--cookie-literal","","--output-folder","meshes/"]) .args(mesh_list_string) @@ -333,7 +335,7 @@ fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ )?; //write dds - let mut dest=PathBuf::from("textures/dds"); + let mut dest=PathBuf::from("textures"); dest.push(file_thing.file_name()); dest.set_extension("dds"); let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); @@ -355,6 +357,8 @@ fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ Ok(()) } fn convert_textures() -> AResult<()>{ + std::fs::create_dir_all("textures/unprocessed")?; + std::fs::create_dir_all("textures/processed")?; let start = std::time::Instant::now(); let mut threads=Vec::new(); for entry in std::fs::read_dir("textures/unprocessed")? { @@ -501,6 +505,7 @@ fn recursive_vmt_loaderAResult>>>(find_stuff:&F,ma } fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ + std::fs::create_dir_all("textures")?; let vpk_list:Vec=vpk_paths.into_iter().map(|vpk_path|vpk::VPK::read(&vpk_path).expect("vpk file does not exist")).collect(); for path in paths{ let mut deduplicate=std::collections::HashSet::new(); @@ -569,7 +574,7 @@ fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ )?; //write dds - let mut dest=PathBuf::from("textures/dds"); + let mut dest=PathBuf::from("textures"); dest.push(write_file_name); dest.set_extension("dds"); std::fs::create_dir_all(dest.parent().unwrap())?; From cf98f8e7bbfd0a8b218900b1bb0910efa6c25d86 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 1 Oct 2024 13:02:54 -0700 Subject: [PATCH 108/125] use rbxassetid parser from deferred_loader --- Cargo.lock | 80 ++++++++++++++++++++++++++++++++++++++++++++++++----- Cargo.toml | 2 +- src/main.rs | 17 +----------- 3 files changed, 75 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a85cb739..ea1ba6e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,6 +512,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -585,6 +594,16 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "image" version = "0.24.9" @@ -998,6 +1017,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -1313,9 +1338,9 @@ dependencies = [ [[package]] name = "roblox_emulator" -version = "0.2.0" +version = "0.2.2" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "62ab7e851fb72ba7d690734e1d33d8bd47e83a25b7dbdb28b4771fd3425f7538" +checksum = "1f084d8b843fd96371cca381799313c9b3d0634d2da23ac0c6334bdaf0a2225e" dependencies = [ "glam", "mlua", @@ -1433,20 +1458,20 @@ dependencies = [ [[package]] name = "strafesnet_deferred_loader" -version = "0.3.3" +version = "0.3.4" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "596aba6d2747818781336ad95a1ee496e37f70052fd625a299fc7a555a6938d4" +checksum = "64d6ca274b6582165ffd30a7a8eb33ad454af3a891e962efb4a0be37df0817ff" dependencies = [ - "lazy-regex", "strafesnet_common", + "url", "vbsp", ] [[package]] name = "strafesnet_rbx_loader" -version = "0.3.6" +version = "0.3.7" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "edb389090ec58f2cb2ec93eafd362c9ef5dc4895092145dbd5d86602cdab3e5d" +checksum = "5bbe74cf64c253b1b0277165653dff2dfaf6a1383293cb645c9e5e1375e9dbb3" dependencies = [ "bytemuck", "glam", @@ -1607,6 +1632,21 @@ dependencies = [ "weezl", ] +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "toml_datetime" version = "0.6.8" @@ -1655,12 +1695,27 @@ dependencies = [ "once_cell", ] +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-width" version = "0.1.13" @@ -1673,6 +1728,17 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + [[package]] name = "utf8parse" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index b9236ccc..1ba2c8d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ rbx_dom_weak = { version = "2.7.0", registry = "strafesnet" } rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" } rbx_xml = { version = "0.13.3", registry = "strafesnet" } strafesnet_bsp_loader = { version = "0.1.3", registry = "strafesnet" } -strafesnet_deferred_loader = { version = "0.3.1", features = ["legacy"], registry = "strafesnet" } +strafesnet_deferred_loader = { version = "0.3.4", features = ["legacy"], registry = "strafesnet" } strafesnet_rbx_loader = { version = "0.3.6", registry = "strafesnet" } strafesnet_snf = { version = "0.1.0", registry = "strafesnet" } vbsp = "0.5.0" diff --git a/src/main.rs b/src/main.rs index 2e4abd22..d1d20f85 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ use std::{collections::HashSet,io::{Read,Seek},path::PathBuf}; use clap::{Args,Parser,Subcommand}; use anyhow::Result as AResult; use rbx_dom_weak::Instance; +use strafesnet_deferred_loader::rbxassetid::RobloxAssetId; #[derive(Parser)] #[command(author, version, about, long_about = None)] @@ -152,22 +153,6 @@ fn get_dom(input:&mut R)->AResult{ } } -struct RobloxAssetId(u64); -struct RobloxAssetIdParseErr; -impl std::str::FromStr for RobloxAssetId { - type Err=RobloxAssetIdParseErr; - fn from_str(s: &str) -> Result{ - let regman=lazy_regex::regex!(r"(\d+)$"); - if let Some(captures) = regman.captures(s) { - if captures.len()==2{//captures[0] is all captures concatenated, and then each individual capture - if let Ok(id) = captures[0].parse::() { - return Ok(Self(id)); - } - } - } - Err(RobloxAssetIdParseErr) - } -} /* The ones I'm interested in: Beam.Texture Decal.Texture From 2b77ea57129a3c528fdd655a7a2c07433cc6a523 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 1 Oct 2024 13:15:48 -0700 Subject: [PATCH 109/125] v1.5.4 update to asset-tool 0.4.X + improve asset id parsing --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea1ba6e2..4bebd67a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -845,7 +845,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.5.3" +version = "1.5.4" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 1ba2c8d0..32d53233 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.5.3" +version = "1.5.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From b7000ee9af627dd7ae2e1fea78b44319c718bdd4 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 1 Oct 2024 17:16:56 -0700 Subject: [PATCH 110/125] update deps --- Cargo.lock | 862 ++++++++++++++++++++++++++++++++++++++++------------ Cargo.toml | 20 +- src/main.rs | 8 +- 3 files changed, 684 insertions(+), 206 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4bebd67a..8e150fbf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" version = "0.8.11" @@ -30,6 +36,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" + [[package]] name = "anstream" version = "0.6.15" @@ -81,9 +93,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "approx" @@ -94,6 +106,23 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" + +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "array-init" version = "2.1.0" @@ -114,9 +143,32 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "av1-grain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" +dependencies = [ + "arrayvec", +] [[package]] name = "base64" @@ -125,13 +177,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] -name = "bcndecode-sys" +name = "bcdec_rs" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb5511db7dbf0f4c2ccdf9cba03871484b99abb657e7fdeacebce1b51fb6019" -dependencies = [ - "cc", -] +checksum = "c9934c2b68e46448d814db20e34a840ef9b4e7b3b7c8b1da91161481230f6350" [[package]] name = "beef" @@ -205,6 +254,12 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bitstream-io" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81e1519b0d82120d2fd469d5bfb2919a9361c48b02d82d04befc1cdd2002452" + [[package]] name = "blake3" version = "1.5.4" @@ -218,6 +273,12 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "bnum" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50202def95bf36cb7d1d7a7962cea1c36a3f8ad42425e5d2b71d7acb8041b5b8" + [[package]] name = "bstr" version = "1.10.0" @@ -228,6 +289,18 @@ dependencies = [ "serde", ] +[[package]] +name = "built" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + [[package]] name = "bv" version = "0.11.1" @@ -254,7 +327,7 @@ checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -270,14 +343,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "cc" -version = "1.1.21" +name = "byteorder-lite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "cc" +version = "1.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" dependencies = [ + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -296,9 +387,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.11" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" +checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" dependencies = [ "clap_builder", "clap_derive", @@ -306,9 +397,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.11" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" +checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" dependencies = [ "anstream", "anstyle", @@ -318,14 +409,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.11" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -466,7 +557,7 @@ dependencies = [ "flume", "half", "lebe", - "miniz_oxide", + "miniz_oxide 0.7.4", "rayon-core", "smallvec", "zune-inflate", @@ -474,9 +565,9 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" dependencies = [ "simd-adler32", ] @@ -487,14 +578,26 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" +[[package]] +name = "fixed_wide" +version = "0.1.1" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "d9c2cf115b3785ede870fada07e8b1aeba3378345b4ca86fe3c772ecabc05c0f" +dependencies = [ + "arrayvec", + "bnum", + "paste", + "ratio_ops", +] + [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -544,9 +647,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94" +checksum = "c28091a37a5d09b555cb6628fd954da299b536433834f5b8e59eba78e0cbbf8a" [[package]] name = "half" @@ -561,15 +664,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -591,7 +688,7 @@ checksum = "2337e7a6c273082b672e377e159d7a168fb51438461b7c4033c79a515dd7a25a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -606,29 +703,44 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" dependencies = [ "bytemuck", - "byteorder 1.5.0", + "byteorder-lite", "color_quant", "exr", "gif", - "jpeg-decoder", + "image-webp", "num-traits", "png", "qoi", + "ravif", + "rayon", + "rgb", "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904" +dependencies = [ + "byteorder-lite", + "quick-error", ] [[package]] name = "image_dds" -version = "0.1.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6428a49d7bd80467bbfea4ffd85a3ce80174eb1c6d36ac060bc81f85907a48" +checksum = "7e332cf1abe0ecc56ef44c85248d580ef05bfeae806f586ee17890d1b09c05c8" dependencies = [ - "bcndecode-sys", + "bcdec_rs", "bytemuck", "ddsfile", "half", @@ -639,10 +751,16 @@ dependencies = [ ] [[package]] -name = "indexmap" -version = "2.5.0" +name = "imgref" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" + +[[package]] +name = "indexmap" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown", @@ -650,13 +768,24 @@ dependencies = [ [[package]] name = "intel_tex_2" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8183b892d72cefc079675302f0e69658fe8dec871f5551f556c65b394b63ccbf" +checksum = "bd699c0e6adcac28c06db24a220c834c8ec811e0d2d80f0261bb14e01737b4dc" dependencies = [ "ispc_rt", ] +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -682,14 +811,29 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "jpeg-decoder" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" -dependencies = [ - "rayon", -] [[package]] name = "lazy-regex" @@ -711,7 +855,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -728,9 +872,20 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" + +[[package]] +name = "libfuzzer-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" +dependencies = [ + "arbitrary", + "cc", + "once_cell", +] [[package]] name = "libloading" @@ -748,6 +903,17 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "linear_ops" +version = "0.1.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "b2e6977ac24f47086d8a7a2d4ae1c720e86dfdc8407cf5e34c18bfa01053c456" +dependencies = [ + "fixed_wide", + "paste", + "ratio_ops", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -766,36 +932,46 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logos" -version = "0.13.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" +checksum = "1c6b6e02facda28ca5fb8dbe4b152496ba3b1bd5a4b40bb2b1b2d8ad74e0f39b" dependencies = [ "logos-derive", ] [[package]] name = "logos-codegen" -version = "0.13.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +checksum = "b32eb6b5f26efacd015b000bfc562186472cd9b34bdba3f6b264e2a052676d10" dependencies = [ "beef", "fnv", + "lazy_static", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 2.0.77", + "regex-syntax", + "syn 2.0.79", ] [[package]] name = "logos-derive" -version = "0.13.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +checksum = "3e5d0c5463c911ef55624739fc353238b4e310f0144be1f875dc42fec6bfd5ec" dependencies = [ "logos-codegen", ] +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + [[package]] name = "luau0-src" version = "0.10.3+luau640" @@ -807,18 +983,18 @@ dependencies = [ [[package]] name = "lz4" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a231296ca742e418c43660cb68e082486ff2538e8db432bc818580f3965025ed" +checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" dependencies = [ "lz4-sys", ] [[package]] name = "lz4-sys" -version = "1.11.0" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb44a01837a858d47e5a630d2ccf304c8efcc4b83b8f9f75b7a9ee4fcc6e57d" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", @@ -868,6 +1044,15 @@ dependencies = [ "vtf", ] +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", +] + [[package]] name = "memchr" version = "2.7.4" @@ -876,27 +1061,33 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "5.10.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" dependencies = [ + "cfg-if", "miette-derive", - "once_cell", "thiserror", "unicode-width", ] [[package]] name = "miette-derive" -version = "5.10.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -904,6 +1095,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", "simd-adler32", ] @@ -933,6 +1133,69 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -970,14 +1233,17 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "owo-colors" @@ -987,28 +1253,52 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parse-display" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6509d08722b53e8dafe97f2027b22ccbe3a5db83cb352931e9716b0aa44bc5c" +checksum = "914a1c2265c98e2446911282c6ac86d8524f495792c38c5bd884f80499c7538a" dependencies = [ - "once_cell", - "parse-display-derive", + "parse-display-derive 0.9.1", "regex", + "regex-syntax", +] + +[[package]] +name = "parse-display" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287d8d3ebdce117b8539f59411e4ed9ec226e0a4153c7f55495c6070d68e6f72" +dependencies = [ + "parse-display-derive 0.10.0", + "regex", + "regex-syntax", ] [[package]] name = "parse-display-derive" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68517892c8daf78da08c0db777fcc17e07f2f63ef70041718f8a7630ad84f341" +checksum = "2ae7800a4c974efd12df917266338e79a7a74415173caf7e70aa0a0707345281" dependencies = [ - "once_cell", "proc-macro2", "quote", "regex", - "regex-syntax 0.7.5", + "regex-syntax", "structmeta", - "syn 2.0.77", + "syn 2.0.79", +] + +[[package]] +name = "parse-display-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc048687be30d79502dea2f623d052f3a074012c6eac41726b7ab17213616b1" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "regex-syntax", + "structmeta", + "syn 2.0.79", ] [[package]] @@ -1031,23 +1321,29 @@ checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "png" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.8.0", ] +[[package]] +name = "portable-atomic" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" + [[package]] name = "ppv-lite86" version = "0.2.20" @@ -1115,7 +1411,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1127,6 +1423,12 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quote" version = "1.0.37" @@ -1166,6 +1468,61 @@ dependencies = [ "getrandom", ] +[[package]] +name = "ratio_ops" +version = "0.1.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "01239195d6afe0509e7e3511b716c0540251dfe7ece0a9a5a27116afb766c42c" + +[[package]] +name = "rav1e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.12.1", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand", + "rand_chacha", + "simd_helpers", + "system-deps", + "thiserror", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f0bfd976333248de2078d350bfdf182ff96e168a24d23d2436cef320dd4bdd" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rgb", +] + [[package]] name = "rayon" version = "1.10.0" @@ -1275,44 +1632,41 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.4", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "regex-syntax" -version = "0.7.5" +name = "rgb" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" +dependencies = [ + "bytemuck", +] [[package]] name = "rmp" @@ -1338,9 +1692,9 @@ dependencies = [ [[package]] name = "roblox_emulator" -version = "0.2.2" +version = "0.2.3" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "1f084d8b843fd96371cca381799313c9b3d0634d2da23ac0c6334bdaf0a2225e" +checksum = "2fa2c785a17f607aad6bdd19eef6d19f9476f308ce38de139df931a99132bd46" dependencies = [ "glam", "mlua", @@ -1385,7 +1739,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1396,7 +1750,16 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", ] [[package]] @@ -1411,6 +1774,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -1434,9 +1806,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strafesnet_bsp_loader" -version = "0.1.5" +version = "0.2.2" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "35ee2c534efa039ad17ca41893ba1d75fafff014076353ac676c73fc808b9e44" +checksum = "34f944637bc3b3ed4c430819c672174b3a3edfd51f79b6b87f4931e3714a398e" dependencies = [ "glam", "strafesnet_common", @@ -1446,21 +1818,24 @@ dependencies = [ [[package]] name = "strafesnet_common" -version = "0.4.1" +version = "0.5.2" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "9a2621612e675a8f804abbbbe3b60caeafe58a2422cccbe453268d6f457df4f3" +checksum = "91cc1f3699bd8248da18bf5d11273264396a257b5d47b8558acb2cb4e1761219" dependencies = [ "arrayvec", "bitflags 2.6.0", + "fixed_wide", "glam", "id", + "linear_ops", + "ratio_ops", ] [[package]] name = "strafesnet_deferred_loader" -version = "0.3.4" +version = "0.4.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "64d6ca274b6582165ffd30a7a8eb33ad454af3a891e962efb4a0be37df0817ff" +checksum = "9985192a282473ddd40d03114e67afe057cba031bea665e9020b139a621afb07" dependencies = [ "strafesnet_common", "url", @@ -1469,9 +1844,9 @@ dependencies = [ [[package]] name = "strafesnet_rbx_loader" -version = "0.3.7" +version = "0.4.1" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "5bbe74cf64c253b1b0277165653dff2dfaf6a1383293cb645c9e5e1375e9dbb3" +checksum = "a1540fa66518857886cf4094dc597b3228341046d8973ccc70196fb52a47105b" dependencies = [ "bytemuck", "glam", @@ -1487,9 +1862,9 @@ dependencies = [ [[package]] name = "strafesnet_snf" -version = "0.1.3" +version = "0.2.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "a9ae481152d0389be29967e1d5f0377498df8ff9638175d56cd8e2c2e6982bfa" +checksum = "c6e8856d79c29bd5687b08bc1653370f7e242c84d5c06afa8629bd3e00c433bf" dependencies = [ "binrw 0.14.0", "id", @@ -1504,47 +1879,47 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "structmeta" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ad9e09554f0456d67a69c1584c9798ba733a5b50349a6c0d0948710523922d" +checksum = "2e1575d8d40908d70f6fd05537266b90ae71b15dbbe7a8b7dffa2b759306d329" dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "structmeta-derive" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" +checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "strum" -version = "0.24.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] @@ -1560,26 +1935,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "syn_util" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6754c4559b79657554e9d8a0d56e65e490c76d382b9c23108364ec4125dea23c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "synstructure" version = "0.12.6" @@ -1592,6 +1956,25 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + [[package]] name = "texpresso" version = "2.0.1" @@ -1603,22 +1986,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1647,19 +2030,36 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -1683,7 +2083,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1718,15 +2118,15 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" @@ -1746,51 +2146,57 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] -name = "vbsp" -version = "0.5.0" +name = "v_frame" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9267540dab0c93bb5201c40ba3b2d027e2717bf355a8f9bf25377b06a5b32f6" +checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + +[[package]] +name = "vbsp" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f14a5685e0bb386aac9b9c6046a05152a46a0bc58d53afb3fbe577f1a1c2bb05" dependencies = [ "ahash", "arrayvec", - "binrw 0.13.3", + "binrw 0.14.0", "bitflags 2.6.0", "bv", "cgmath", - "itertools", + "itertools 0.13.0", "lzma-rs", "num_enum", + "serde", "static_assertions", "thiserror", - "vbsp-derive", + "vdf-reader", "zip-lzma", ] -[[package]] -name = "vbsp-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ade687fadf34b1b7502387fc9eb7b4032ddc9b93022d31356e9984c957abaad" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "syn_util", -] - [[package]] name = "vdf-reader" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff9669f8e9cf7a82acac623509d7dbd119b4bc90da2469f1e7501097e04c5a3" +checksum = "543945fdc3d51b20e3e0f5fd845ddeca4a270e56522035cf152105bc144ffd65" dependencies = [ "logos", "miette", - "parse-display", + "parse-display 0.9.1", "serde", "thiserror", ] +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + [[package]] name = "version_check" version = "0.9.5" @@ -1799,15 +2205,17 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vmdl" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "892922743c4c107372331efd8f67c57282590f8c18c26b4465c4b0e1e6678664" +checksum = "da2f6b8c22da8937403a5da864e7ea390f30cd40b7a077079e40279aa6a4f553" dependencies = [ "arrayvec", "bitflags 2.6.0", "bytemuck", "cgmath", - "itertools", + "half", + "itertools 0.13.0", + "num_enum", "static_assertions", "thiserror", "tracing", @@ -1815,9 +2223,9 @@ dependencies = [ [[package]] name = "vmt-parser" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620c541038e4ea9ffcd32439f784ee60742c43da798d01ab62e4c005e7a22923" +checksum = "20c25c4e0ba68b6c74038e6c3c7b9bb16c01f01e25fe75c7db8f575a5a7c38cf" dependencies = [ "miette", "serde", @@ -1839,15 +2247,15 @@ dependencies = [ [[package]] name = "vtf" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404a2cecbe2920421b1bd2653308f6afc389577fa8cf7fb874121dc0eccd4773" +checksum = "66720c07784e3b49062ea42cddef8df72291f7c5d0ea7dcb5882a0653b32a21b" dependencies = [ "byteorder 1.5.0", "err-derive", "image", "num_enum", - "parse-display", + "parse-display 0.10.0", "texpresso", ] @@ -1857,6 +2265,61 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.79", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + [[package]] name = "weezl" version = "0.1.8" @@ -1938,9 +2401,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -1969,7 +2432,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1984,6 +2447,12 @@ dependencies = [ "lzma", ] +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -1992,3 +2461,12 @@ checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] + +[[package]] +name = "zune-jpeg" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" +dependencies = [ + "zune-core", +] diff --git a/Cargo.toml b/Cargo.toml index 32d53233..53e02a68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,22 +9,22 @@ edition = "2021" anyhow = "1.0.75" clap = { version = "4.4.2", features = ["derive"] } flate2 = "1.0.27" -image = "0.24.7" -image_dds = "0.1.1" +image = "0.25.2" +image_dds = "0.6.0" lazy-regex = "3.1.0" rbx_binary = { version = "0.7.4", registry = "strafesnet" } rbx_dom_weak = { version = "2.7.0", registry = "strafesnet" } rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" } rbx_xml = { version = "0.13.3", registry = "strafesnet" } -strafesnet_bsp_loader = { version = "0.1.3", registry = "strafesnet" } -strafesnet_deferred_loader = { version = "0.3.4", features = ["legacy"], registry = "strafesnet" } -strafesnet_rbx_loader = { version = "0.3.6", registry = "strafesnet" } -strafesnet_snf = { version = "0.1.0", registry = "strafesnet" } -vbsp = "0.5.0" -vmdl = "0.1.1" -vmt-parser = "0.1.1" +strafesnet_bsp_loader = { version = "0.2.1", registry = "strafesnet" } +strafesnet_deferred_loader = { version = "0.4.0", features = ["legacy"], registry = "strafesnet" } +strafesnet_rbx_loader = { version = "0.4.1", registry = "strafesnet" } +strafesnet_snf = { version = "0.2.0", registry = "strafesnet" } +vbsp = "0.6.0" +vmdl = "0.2.0" +vmt-parser = "0.2.0" vpk = "0.2.0" -vtf = "0.2.1" +vtf = "0.3.0" #[profile.release] #lto = true diff --git a/src/main.rs b/src/main.rs index d1d20f85..2688d441 100644 --- a/src/main.rs +++ b/src/main.rs @@ -307,9 +307,9 @@ fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ }?.to_rgba8();//this sets a=255, arcane is actually supposed to look like that let format=if image.width()%4!=0||image.height()%4!=0{ - image_dds::ImageFormat::R8G8B8A8Srgb + image_dds::ImageFormat::Rgba8UnormSrgb }else{ - image_dds::ImageFormat::BC7Srgb + image_dds::ImageFormat::BC7RgbaUnormSrgb }; //this fails if the image dimensions are not a multiple of 4 let dds = image_dds::dds_from_image( @@ -546,9 +546,9 @@ fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ let image=vtf::from_bytes(&mut stuff)?.highres_image.decode(0)?.to_rgba8(); let format=if image.width()%4!=0||image.height()%4!=0{ - image_dds::ImageFormat::R8G8B8A8Srgb + image_dds::ImageFormat::Rgba8UnormSrgb }else{ - image_dds::ImageFormat::BC7Srgb + image_dds::ImageFormat::BC7RgbaUnormSrgb }; //this fails if the image dimensions are not a multiple of 4 let dds = image_dds::dds_from_image( From a18aea828c2e9b9e129d6251efe5c446fe9c6830 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 1 Oct 2024 17:24:43 -0700 Subject: [PATCH 111/125] v1.5.5 update deps --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e150fbf..940216ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1021,7 +1021,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.5.4" +version = "1.5.5" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 53e02a68..3aa93a25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.5.4" +version = "1.5.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 1989369956caa7c2983606b0da9da919f3c33fd0 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 3 Oct 2024 20:01:06 -0700 Subject: [PATCH 112/125] update rbx_loader --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- src/main.rs | 7 ++++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 940216ae..f3abe295 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1692,9 +1692,9 @@ dependencies = [ [[package]] name = "roblox_emulator" -version = "0.2.3" +version = "0.3.1" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "2fa2c785a17f607aad6bdd19eef6d19f9476f308ce38de139df931a99132bd46" +checksum = "b58d7bb42d458984e629a012757474710fd0e429c2c824a2529574be5e7c2fd6" dependencies = [ "glam", "mlua", @@ -1833,9 +1833,9 @@ dependencies = [ [[package]] name = "strafesnet_deferred_loader" -version = "0.4.0" +version = "0.4.1" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "9985192a282473ddd40d03114e67afe057cba031bea665e9020b139a621afb07" +checksum = "cb47034893e945c640063a6c0fb09c6186dcc9f0b221b8c41f5a22070fe430f4" dependencies = [ "strafesnet_common", "url", @@ -1844,9 +1844,9 @@ dependencies = [ [[package]] name = "strafesnet_rbx_loader" -version = "0.4.1" +version = "0.5.1" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "a1540fa66518857886cf4094dc597b3228341046d8973ccc70196fb52a47105b" +checksum = "bb3539939618714ed418aca2f2d10578022f984d223d05f99b857805c02d7cfe" dependencies = [ "bytemuck", "glam", @@ -2097,9 +2097,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" diff --git a/Cargo.toml b/Cargo.toml index 3aa93a25..6356530a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" } rbx_xml = { version = "0.13.3", registry = "strafesnet" } strafesnet_bsp_loader = { version = "0.2.1", registry = "strafesnet" } strafesnet_deferred_loader = { version = "0.4.0", features = ["legacy"], registry = "strafesnet" } -strafesnet_rbx_loader = { version = "0.4.1", registry = "strafesnet" } +strafesnet_rbx_loader = { version = "0.5.1", registry = "strafesnet" } strafesnet_snf = { version = "0.2.0", registry = "strafesnet" } vbsp = "0.6.0" vmdl = "0.2.0" diff --git a/src/main.rs b/src/main.rs index 2688d441..578c2347 100644 --- a/src/main.rs +++ b/src/main.rs @@ -676,19 +676,20 @@ fn roblox_to_snf(pathlist:Vec,output_folder:PathBuf)->AResul } let output_folder=output_folder.clone(); threads.push_back(std::thread::spawn(move ||{ - let mut dom=strafesnet_rbx_loader::read( + let model=strafesnet_rbx_loader::read( std::fs::File::open(path.as_path()) .map_err(ConvertError::IO)? ).map_err(ConvertError::RbxLoader)?; - dom.run_scripts(); + let mut place=model.into_place(); + place.run_scripts(); let mut loader=strafesnet_deferred_loader::roblox_legacy(); let (texture_loader,mesh_loader)=loader.get_inner_mut(); let map_step1=strafesnet_rbx_loader::convert( - &dom, + &place, |name|texture_loader.acquire_render_config_id(name), |name|mesh_loader.acquire_mesh_id(name), ); From 602061b44c2dcbd5553b603b690f89196173ae51 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 3 Oct 2024 20:35:54 -0700 Subject: [PATCH 113/125] v1.5.6 update rbx_loader --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3abe295..03b2d371 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1021,7 +1021,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.5.5" +version = "1.5.6" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 6356530a..c06681c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.5.5" +version = "1.5.6" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From a2ab23097b5201ebd1d503c3f330d4d6a5202d58 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 4 Oct 2024 20:00:12 -0700 Subject: [PATCH 114/125] update rbx_loader --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 03b2d371..eda58479 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1692,9 +1692,9 @@ dependencies = [ [[package]] name = "roblox_emulator" -version = "0.3.1" +version = "0.4.1" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "b58d7bb42d458984e629a012757474710fd0e429c2c824a2529574be5e7c2fd6" +checksum = "6935943e8d473c8d19b52623877bee18421743072e2675730886d13592008266" dependencies = [ "glam", "mlua", @@ -1844,9 +1844,9 @@ dependencies = [ [[package]] name = "strafesnet_rbx_loader" -version = "0.5.1" +version = "0.5.2" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "bb3539939618714ed418aca2f2d10578022f984d223d05f99b857805c02d7cfe" +checksum = "bb852ee329d26410daee50f1e583ea8286caf6a81a42ff887b78f21477c48731" dependencies = [ "bytemuck", "glam", From 41b28fa7d2ecae8a6a2532f250d40b0c29aa8046 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 4 Oct 2024 20:04:13 -0700 Subject: [PATCH 115/125] v1.5.7 update rbx_loader --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eda58479..ebdc9fb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1021,7 +1021,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.5.6" +version = "1.5.7" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index c06681c0..119a0e63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.5.6" +version = "1.5.7" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 1ad972390591e20073e4171b7418364fd9942725 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 27 Jan 2025 07:04:05 -0800 Subject: [PATCH 116/125] move writeattributes to mapfixer --- src/main.rs | 84 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 82 deletions(-) diff --git a/src/main.rs b/src/main.rs index 578c2347..927f1d79 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,6 @@ enum Commands { VPKContents(VPKContentsSubcommand), BSPContents(BSPContentsSubcommand), DownloadMeshes(DownloadMeshesSubcommand), - WriteAttributes(WriteAttributesSubcommand), } #[derive(Args)] @@ -69,9 +68,6 @@ struct DownloadMeshesSubcommand { #[arg(long,required=true)] roblox_files:Vec } -#[derive(Args)] -struct WriteAttributesSubcommand { -} fn main() -> AResult<()> { let cli = Cli::parse(); @@ -84,27 +80,9 @@ fn main() -> AResult<()> { Commands::BSPContents(subcommand)=>bsp_contents(subcommand.input_file), Commands::ConvertTextures(_subcommand)=>convert_textures(), Commands::DownloadMeshes(subcommand)=>download_meshes(subcommand.roblox_files), - Commands::WriteAttributes(_subcommand)=>write_attributes(), } } -fn recursive_collect_regex(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, regex: &lazy_regex::Lazy){ - for &referent in instance.children() { - if let Some(c) = dom.get_by_ref(referent) { - if regex.captures(c.name.as_str()).is_some(){ - objects.push(c.referent());//copy ref - } - recursive_collect_regex(objects,dom,c,regex); - } - } -} - -fn get_button_refs(dom:&rbx_dom_weak::WeakDom) -> Vec{ - let mut buttons = std::vec::Vec::new(); - recursive_collect_regex(&mut buttons, dom, dom.root(),lazy_regex::regex!(r"Button(\d+)$")); - buttons -} - enum ReaderType<'a, R:Read+Seek>{ GZip(flate2::read::GzDecoder<&'a mut R>), Raw(&'a mut R), @@ -140,19 +118,6 @@ fn load_dom(input:&mut R)->AResult{ } } -fn get_dom(input:&mut R)->AResult{ - match maybe_gzip_decode(input){ - Ok(ReaderType::GZip(mut readable)) => { - //gzip - let mut extracted:Vec=Vec::new(); - readable.read_to_end(&mut extracted)?; - Ok(load_dom(&mut std::io::Cursor::new(extracted))?) - }, - Ok(ReaderType::Raw(readable)) => Ok(load_dom(readable)?), - Err(e) => Err(e)?, - } -} - /* The ones I'm interested in: Beam.Texture Decal.Texture @@ -202,7 +167,7 @@ fn download_textures(paths:Vec)->AResult<()>{ } }; let mut input=std::io::BufReader::new(file); - match get_dom(&mut input){ + match load_dom(&mut input){ Ok(dom)=>{ for object in dom.into_raw().1.into_values(){ match object.class.as_str(){ @@ -252,7 +217,7 @@ fn download_meshes(paths:Vec)->AResult<()>{ } }; let mut input=std::io::BufReader::new(file); - match get_dom(&mut input){ + match load_dom(&mut input){ Ok(dom)=>{ for object in dom.into_raw().1.into_values(){ match object.class.as_str(){ @@ -370,51 +335,6 @@ fn convert_textures() -> AResult<()>{ Ok(()) } -fn write_attributes() -> AResult<()>{ - for entry in std::fs::read_dir("maps/unprocessed")? { - let file_thing=entry?; - println!("processing map={:?}",file_thing.file_name()); - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let mut dom = get_dom(&mut input)?; - - let button_refs = get_button_refs(&dom); - - for &button_ref in &button_refs { - if let Some(button)=dom.get_by_ref_mut(button_ref){ - match button.properties.get_mut("Attributes"){ - Some(rbx_dom_weak::types::Variant::Attributes(attributes))=>{ - println!("Appending Ref={} to existing attributes for {}",button_ref,button.name); - attributes.insert("Ref".to_string(),rbx_dom_weak::types::Variant::String(button_ref.to_string())); - }, - None=>{ - println!("Creating new attributes with Ref={} for {}",button_ref,button.name); - let mut attributes=rbx_dom_weak::types::Attributes::new(); - attributes.insert("Ref".to_string(),rbx_dom_weak::types::Variant::String(button_ref.to_string())); - button.properties.insert("Attributes".to_string(),rbx_dom_weak::types::Variant::Attributes(attributes)); - } - _=>unreachable!("Fetching attributes did not return attributes."), - } - } - } - let mut dest={ - let mut dest=PathBuf::from("maps/attributes"); - dest.push(file_thing.file_name()); - let output = std::io::BufWriter::new(std::fs::File::create(dest)?); - //write workspace:GetChildren()[1] - let workspace_children=dom.root().children(); - if workspace_children.len()!=1{ - return Err(anyhow::Error::msg("there can only be one model")); - } - rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; - //move original to processed folder - PathBuf::from("maps/unaltered") - }; - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - Ok(()) -} - enum VMTContent{ VMT(String), VTF(String), From 1ce51dd4daba815d1a572ae7b099c8c29357e04f Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 27 Jan 2025 07:44:39 -0800 Subject: [PATCH 117/125] split commands into roblox and source --- src/common.rs | 75 ++++++ src/main.rs | 724 ++------------------------------------------------ src/roblox.rs | 273 +++++++++++++++++++ src/source.rs | 364 +++++++++++++++++++++++++ 4 files changed, 727 insertions(+), 709 deletions(-) create mode 100644 src/common.rs create mode 100644 src/roblox.rs create mode 100644 src/source.rs diff --git a/src/common.rs b/src/common.rs new file mode 100644 index 00000000..95744c9d --- /dev/null +++ b/src/common.rs @@ -0,0 +1,75 @@ +use std::path::PathBuf; +use std::io::{Read,Seek}; +use anyhow::Result as AResult; + +fn load_image(input:&mut R)->AResult{ + let mut fourcc=[0u8;4]; + input.read_exact(&mut fourcc)?; + input.rewind()?; + match &fourcc{ + b"\x89PNG"=>Ok(image::load(input,image::ImageFormat::Png)?), + b"\xFF\xD8\xFF\xE0"=>Ok(image::load(input,image::ImageFormat::Jpeg)?),//JFIF + b"Err(anyhow::Error::msg("Roblox xml garbage is not supported yet")), + other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))), + } +} + +fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ + let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + + let image=load_image(&mut input)?.to_rgba8();//this sets a=255, arcane is actually supposed to look like that + + let format=if image.width()%4!=0||image.height()%4!=0{ + image_dds::ImageFormat::Rgba8UnormSrgb + }else{ + image_dds::ImageFormat::BC7RgbaUnormSrgb + }; + //this fails if the image dimensions are not a multiple of 4 + let dds = image_dds::dds_from_image( + &image, + format, + image_dds::Quality::Slow, + image_dds::Mipmaps::GeneratedAutomatic, + )?; + + //write dds + let mut dest=PathBuf::from("textures"); + dest.push(file_thing.file_name()); + dest.set_extension("dds"); + let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); + dds.write(&mut writer)?; + + //move file to processed + let mut dest=PathBuf::from("textures/processed"); + dest.push(file_thing.file_name()); + std::fs::rename(file_thing.path(), dest)?; + Ok(()) +} +pub fn convert_textures() -> AResult<()>{ + std::fs::create_dir_all("textures/unprocessed")?; + std::fs::create_dir_all("textures/processed")?; + let start = std::time::Instant::now(); + let mut threads=Vec::new(); + for entry in std::fs::read_dir("textures/unprocessed")? { + let file_thing=entry?; + threads.push(std::thread::spawn(move ||{ + let file_name=format!("{:?}",file_thing); + let result=convert(file_thing); + if let Err(e)=result{ + println!("error processing file:{:?} error message:{:?}",file_name,e); + } + })); + } + let mut i=0; + let n_threads=threads.len(); + for thread in threads{ + i+=1; + if let Err(e)=thread.join(){ + println!("thread error: {:?}",e); + }else{ + println!("{}/{}",i,n_threads); + } + } + println!("{:?}", start.elapsed()); + Ok(()) +} diff --git a/src/main.rs b/src/main.rs index 927f1d79..e54d7b1c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,9 @@ -use std::{collections::HashSet,io::{Read,Seek},path::PathBuf}; -use clap::{Args,Parser,Subcommand}; +mod common; +mod roblox; +mod source; + +use clap::{Parser,Subcommand}; use anyhow::Result as AResult; -use rbx_dom_weak::Instance; -use strafesnet_deferred_loader::rbxassetid::RobloxAssetId; #[derive(Parser)] #[command(author, version, about, long_about = None)] @@ -13,714 +14,19 @@ struct Cli { } #[derive(Subcommand)] -enum Commands { - RobloxToSNF(RobloxToSNFSubcommand), - SourceToSNF(SourceToSNFSubcommand), - DownloadTextures(DownloadTexturesSubcommand), - ExtractTextures(ExtractTexturesSubcommand), - ConvertTextures(ConvertTexturesSubcommand), - VPKContents(VPKContentsSubcommand), - BSPContents(BSPContentsSubcommand), - DownloadMeshes(DownloadMeshesSubcommand), -} - -#[derive(Args)] -struct RobloxToSNFSubcommand { - #[arg(long)] - output_folder:PathBuf, - #[arg(required=true)] - input_files:Vec, -} -#[derive(Args)] -struct SourceToSNFSubcommand { - #[arg(long)] - output_folder:PathBuf, - #[arg(required=true)] - input_files:Vec, -} -#[derive(Args)] -struct DownloadTexturesSubcommand { - #[arg(long,required=true)] - roblox_files:Vec -} -#[derive(Args)] -struct ExtractTexturesSubcommand { - #[arg(long)] - bsp_file:PathBuf, - #[arg(long)] - vpk_dir_files:Vec -} -#[derive(Args)] -struct ConvertTexturesSubcommand { -} -#[derive(Args)] -struct VPKContentsSubcommand { - #[arg(long)] - input_file:PathBuf, -} -#[derive(Args)] -struct BSPContentsSubcommand { - #[arg(long)] - input_file:PathBuf, -} -#[derive(Args)] -struct DownloadMeshesSubcommand { - #[arg(long,required=true)] - roblox_files:Vec +enum Commands{ + #[command(flatten)] + Roblox(roblox::Commands), + #[command(flatten)] + Source(source::Commands), + ConvertTextures, } fn main() -> AResult<()> { let cli = Cli::parse(); - match cli.command { - Commands::RobloxToSNF(subcommand)=>roblox_to_snf(subcommand.input_files,subcommand.output_folder), - Commands::SourceToSNF(subcommand)=>source_to_snf(subcommand.input_files,subcommand.output_folder), - Commands::DownloadTextures(subcommand)=>download_textures(subcommand.roblox_files), - Commands::ExtractTextures(subcommand)=>extract_textures(vec![subcommand.bsp_file],subcommand.vpk_dir_files), - Commands::VPKContents(subcommand)=>vpk_contents(subcommand.input_file), - Commands::BSPContents(subcommand)=>bsp_contents(subcommand.input_file), - Commands::ConvertTextures(_subcommand)=>convert_textures(), - Commands::DownloadMeshes(subcommand)=>download_meshes(subcommand.roblox_files), + match cli.command{ + Commands::Roblox(commands)=>commands.run(), + Commands::Source(commands)=>commands.run(), + Commands::ConvertTextures=>common::convert_textures(), } } - -enum ReaderType<'a, R:Read+Seek>{ - GZip(flate2::read::GzDecoder<&'a mut R>), - Raw(&'a mut R), -} - -fn maybe_gzip_decode(input:&mut R)->AResult>{ - let mut first_2=[0u8;2]; - if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_2),std::io::Seek::rewind(input)){ - match &first_2{ - b"\x1f\x8b"=>Ok(ReaderType::GZip(flate2::read::GzDecoder::new(input))), - _=>Ok(ReaderType::Raw(input)), - } - }else{ - Err(anyhow::Error::msg("failed to peek")) - } -} - -fn load_dom(input:&mut R)->AResult{ - let mut first_8=[0u8;8]; - if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_8),std::io::Seek::rewind(input)){ - match &first_8[0..4]{ - b"{ - match &first_8[4..8]{ - b"lox!"=>rbx_binary::from_reader(input).map_err(anyhow::Error::msg), - b"lox "=>rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), - other=>Err(anyhow::Error::msg(format!("Unknown Roblox file type {:?}",other))), - } - }, - _=>Err(anyhow::Error::msg("unsupported file type")), - } - }else{ - Err(anyhow::Error::msg("peek failed")) - } -} - -/* The ones I'm interested in: -Beam.Texture -Decal.Texture -FileMesh.MeshId -FileMesh.TextureId -MaterialVariant.ColorMap -MaterialVariant.MetalnessMap -MaterialVariant.NormalMap -MaterialVariant.RoughnessMap -MeshPart.MeshId -MeshPart.TextureID -ParticleEmitter.Texture -Sky.MoonTextureId -Sky.SkyboxBk -Sky.SkyboxDn -Sky.SkyboxFt -Sky.SkyboxLf -Sky.SkyboxRt -Sky.SkyboxUp -Sky.SunTextureId -SurfaceAppearance.ColorMap -SurfaceAppearance.MetalnessMap -SurfaceAppearance.NormalMap -SurfaceAppearance.RoughnessMap -SurfaceAppearance.TexturePack -*/ -fn accumulate_content_id(content_list:&mut HashSet,object:&Instance,property:&str){ - if let Some(rbx_dom_weak::types::Variant::Content(content))=object.properties.get(property){ - if let Ok(asset_id)=AsRef::::as_ref(content).parse::(){ - content_list.insert(asset_id.0); - }else{ - println!("Content failed to parse into AssetID: {:?}",content); - } - }else{ - println!("property={} does not exist for class={}",object.class.as_str(),property); - } -} -fn download_textures(paths:Vec)->AResult<()>{ - println!("Reading files, this could take a hot minute..."); - let mut texture_list=HashSet::new(); - for path in paths{ - let file=match std::fs::File::open(path.as_path()){ - Ok(file)=>file, - Err(e)=>{ - println!("file error {e}"); - continue; - } - }; - let mut input=std::io::BufReader::new(file); - match load_dom(&mut input){ - Ok(dom)=>{ - for object in dom.into_raw().1.into_values(){ - match object.class.as_str(){ - "Beam"=>accumulate_content_id(&mut texture_list,&object,"Texture"), - "Decal"=>accumulate_content_id(&mut texture_list,&object,"Texture"), - "Texture"=>accumulate_content_id(&mut texture_list,&object,"Texture"), - "FileMesh"=>accumulate_content_id(&mut texture_list,&object,"TextureId"), - "MeshPart"=>accumulate_content_id(&mut texture_list,&object,"TextureID"), - "ParticleEmitter"=>accumulate_content_id(&mut texture_list,&object,"Texture"), - "Sky"=>{ - accumulate_content_id(&mut texture_list,&object,"MoonTextureId"); - accumulate_content_id(&mut texture_list,&object,"SkyboxBk"); - accumulate_content_id(&mut texture_list,&object,"SkyboxDn"); - accumulate_content_id(&mut texture_list,&object,"SkyboxFt"); - accumulate_content_id(&mut texture_list,&object,"SkyboxLf"); - accumulate_content_id(&mut texture_list,&object,"SkyboxRt"); - accumulate_content_id(&mut texture_list,&object,"SkyboxUp"); - accumulate_content_id(&mut texture_list,&object,"SunTextureId"); - }, - _=>(), - } - } - }, - Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), - } - } - let texture_list_string=texture_list.into_iter().map(|id|id.to_string()).collect::>(); - println!("Texture list:{:?}",texture_list_string.join(" ")); - std::fs::create_dir_all("textures/unprocessed")?; - let output=std::process::Command::new("asset-tool") - .args(["download","--cookie-literal","","--output-folder","textures/unprocessed/"]) - .args(texture_list_string) - .spawn()? - .wait_with_output()?; - println!("Asset tool exit_success:{}",output.status.success()); - Ok(()) -} -fn download_meshes(paths:Vec)->AResult<()>{ - println!("Reading files, this could take a hot minute..."); - let mut mesh_list=HashSet::new(); - for path in paths{ - let file=match std::fs::File::open(path.as_path()){ - Ok(file)=>file, - Err(e)=>{ - println!("file error {e}"); - continue; - } - }; - let mut input=std::io::BufReader::new(file); - match load_dom(&mut input){ - Ok(dom)=>{ - for object in dom.into_raw().1.into_values(){ - match object.class.as_str(){ - "MeshPart"=>accumulate_content_id(&mut mesh_list,&object,"MeshId"), - "SpecialMesh"=>accumulate_content_id(&mut mesh_list,&object,"MeshId"), - _=>(), - } - } - }, - Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), - } - } - let mesh_list_string=mesh_list.into_iter().map(|id|id.to_string()).collect::>(); - println!("Mesh list:{:?}",mesh_list_string.join(" ")); - std::fs::create_dir_all("meshes/")?; - let output=std::process::Command::new("asset-tool") - .args(["download","--cookie-literal","","--output-folder","meshes/"]) - .args(mesh_list_string) - .spawn()? - .wait_with_output()?; - println!("Asset tool exit_success:{}",output.status.success()); - Ok(()) -} - -fn load_image(input:&mut R)->AResult{ - let mut fourcc=[0u8;4]; - input.read_exact(&mut fourcc)?; - input.rewind()?; - match &fourcc{ - b"\x89PNG"=>Ok(image::load(input,image::ImageFormat::Png)?), - b"\xFF\xD8\xFF\xE0"=>Ok(image::load(input,image::ImageFormat::Jpeg)?),//JFIF - b"Err(anyhow::Error::msg("Roblox xml garbage is not supported yet")), - other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))), - } -} - -fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - - let mut extracted_input=None; - let image=match maybe_gzip_decode(&mut input){ - Ok(ReaderType::GZip(mut readable)) => { - //gzip - let mut extracted:Vec=Vec::new(); - //read the entire thing to the end so that I can clone the data and write a png to processed images - readable.read_to_end(&mut extracted)?; - extracted_input=Some(extracted.clone()); - load_image(&mut std::io::Cursor::new(extracted)) - }, - Ok(ReaderType::Raw(readable)) => load_image(readable), - Err(e) => Err(e)?, - }?.to_rgba8();//this sets a=255, arcane is actually supposed to look like that - - let format=if image.width()%4!=0||image.height()%4!=0{ - image_dds::ImageFormat::Rgba8UnormSrgb - }else{ - image_dds::ImageFormat::BC7RgbaUnormSrgb - }; - //this fails if the image dimensions are not a multiple of 4 - let dds = image_dds::dds_from_image( - &image, - format, - image_dds::Quality::Slow, - image_dds::Mipmaps::GeneratedAutomatic, - )?; - - //write dds - let mut dest=PathBuf::from("textures"); - dest.push(file_thing.file_name()); - dest.set_extension("dds"); - let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); - dds.write(&mut writer)?; - - if let Some(mut extracted)=extracted_input{ - //write extracted to processed - let mut dest=PathBuf::from("textures/processed"); - dest.push(file_thing.file_name()); - std::fs::write(dest, &mut extracted)?; - //delete ugly gzip file - std::fs::remove_file(file_thing.path())?; - }else{ - //move file to processed - let mut dest=PathBuf::from("textures/processed"); - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - } - Ok(()) -} -fn convert_textures() -> AResult<()>{ - std::fs::create_dir_all("textures/unprocessed")?; - std::fs::create_dir_all("textures/processed")?; - let start = std::time::Instant::now(); - let mut threads=Vec::new(); - for entry in std::fs::read_dir("textures/unprocessed")? { - let file_thing=entry?; - threads.push(std::thread::spawn(move ||{ - let file_name=format!("{:?}",file_thing); - let result=convert(file_thing); - if let Err(e)=result{ - println!("error processing file:{:?} error message:{:?}",file_name,e); - } - })); - } - let mut i=0; - let n_threads=threads.len(); - for thread in threads{ - i+=1; - if let Err(e)=thread.join(){ - println!("thread error: {:?}",e); - }else{ - println!("{}/{}",i,n_threads); - } - } - println!("{:?}", start.elapsed()); - Ok(()) -} - -enum VMTContent{ - VMT(String), - VTF(String), - Patch(vmt_parser::material::PatchMaterial), - Unsupported,//don't want to deal with whatever vmt variant - Unresolved,//could not locate a texture because of vmt content -} -impl VMTContent{ - fn vtf(opt:Option)->Self{ - match opt{ - Some(s)=>Self::VTF(s), - None=>Self::Unresolved, - } - } -} - -fn get_some_texture(material:vmt_parser::material::Material)->AResult{ - //just grab some texture from somewhere for now - Ok(match material{ - vmt_parser::material::Material::LightMappedGeneric(mat)=>VMTContent::vtf(Some(mat.base_texture)), - vmt_parser::material::Material::VertexLitGeneric(mat)=>VMTContent::vtf(mat.base_texture.or(mat.decal_texture)),//this just dies if there is none - vmt_parser::material::Material::VertexLitGenericDx6(mat)=>VMTContent::vtf(mat.base_texture.or(mat.decal_texture)), - vmt_parser::material::Material::UnlitGeneric(mat)=>VMTContent::vtf(mat.base_texture), - vmt_parser::material::Material::UnlitTwoTexture(mat)=>VMTContent::vtf(mat.base_texture), - vmt_parser::material::Material::Water(mat)=>VMTContent::vtf(mat.base_texture), - vmt_parser::material::Material::WorldVertexTransition(mat)=>VMTContent::vtf(Some(mat.base_texture)), - vmt_parser::material::Material::EyeRefract(mat)=>VMTContent::vtf(Some(mat.cornea_texture)), - vmt_parser::material::Material::SubRect(mat)=>VMTContent::VMT(mat.material),//recursive - vmt_parser::material::Material::Sprite(mat)=>VMTContent::vtf(Some(mat.base_texture)), - vmt_parser::material::Material::SpriteCard(mat)=>VMTContent::vtf(mat.base_texture), - vmt_parser::material::Material::Cable(mat)=>VMTContent::vtf(Some(mat.base_texture)), - vmt_parser::material::Material::Refract(mat)=>VMTContent::vtf(mat.base_texture), - vmt_parser::material::Material::Modulate(mat)=>VMTContent::vtf(Some(mat.base_texture)), - vmt_parser::material::Material::DecalModulate(mat)=>VMTContent::vtf(Some(mat.base_texture)), - vmt_parser::material::Material::Sky(mat)=>VMTContent::vtf(Some(mat.base_texture)), - vmt_parser::material::Material::Replacements(_mat)=>VMTContent::Unsupported, - vmt_parser::material::Material::Patch(mat)=>VMTContent::Patch(mat), - _=>return Err(anyhow::Error::msg("vmt failed to parse")), - }) -} - -fn get_vmtAResult>>>(find_stuff:&F,search_name:String)->AResult{ - if let Some(stuff)=find_stuff(search_name)?{ - //decode vmt and then write - let stuff=String::from_utf8(stuff)?; - let material=vmt_parser::from_str(stuff.as_str())?; - println!("vmt material={:?}",material); - return Ok(material); - } - Err(anyhow::Error::msg("vmt not found")) -} - -fn recursive_vmt_loaderAResult>>>(find_stuff:&F,material:vmt_parser::material::Material)->AResult>>{ - match get_some_texture(material)?{ - VMTContent::VMT(s)=>recursive_vmt_loader(find_stuff,get_vmt(find_stuff,s)?), - VMTContent::VTF(s)=>{ - let mut texture_file_name=PathBuf::from("materials"); - texture_file_name.push(s); - texture_file_name.set_extension("vtf"); - find_stuff(texture_file_name.into_os_string().into_string().unwrap()) - }, - VMTContent::Patch(mat)=>recursive_vmt_loader(find_stuff, - mat.resolve(|search_name|{ - match find_stuff(search_name.to_string())?{ - Some(bytes)=>Ok(String::from_utf8(bytes)?), - None=>Err(anyhow::Error::msg("could not find vmt")), - } - })? - ), - VMTContent::Unsupported=>{println!("Unsupported vmt");Ok(None)},//print and move on - VMTContent::Unresolved=>{println!("Unresolved vmt");Ok(None)}, - } -} - -fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ - std::fs::create_dir_all("textures")?; - let vpk_list:Vec=vpk_paths.into_iter().map(|vpk_path|vpk::VPK::read(&vpk_path).expect("vpk file does not exist")).collect(); - for path in paths{ - let mut deduplicate=std::collections::HashSet::new(); - let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; - for texture in bsp.textures(){ - deduplicate.insert(PathBuf::from(texture.name())); - } - //dedupe prop models - let mut model_dedupe=std::collections::HashSet::new(); - for prop in bsp.static_props(){ - model_dedupe.insert(prop.model()); - } - - //grab texture names from props - for model_name in model_dedupe{ - //.mdl, .vvd, .dx90.vtx - let mut path=PathBuf::from(model_name); - let file_name=PathBuf::from(path.file_stem().unwrap()); - path.pop(); - path.push(file_name); - let mut vvd_path=path.clone(); - let mut vtx_path=path.clone(); - vvd_path.set_extension("vvd"); - vtx_path.set_extension("dx90.vtx"); - match (bsp.pack.get(model_name),bsp.pack.get(vvd_path.as_os_str().to_str().unwrap()),bsp.pack.get(vtx_path.as_os_str().to_str().unwrap())){ - (Ok(Some(mdl_file)),Ok(Some(vvd_file)),Ok(Some(vtx_file)))=>{ - match (vmdl::mdl::Mdl::read(mdl_file.as_ref()),vmdl::vvd::Vvd::read(vvd_file.as_ref()),vmdl::vtx::Vtx::read(vtx_file.as_ref())){ - (Ok(mdl),Ok(vvd),Ok(vtx))=>{ - let model=vmdl::Model::from_parts(mdl,vtx,vvd); - for texture in model.textures(){ - for search_path in &texture.search_paths{ - let mut path=PathBuf::from(search_path.as_str()); - path.push(texture.name.as_str()); - deduplicate.insert(path); - } - } - }, - _=>println!("model_name={} error",model_name), - } - }, - _=>println!("no model name={}",model_name), - } - } - - let pack=&bsp.pack; - let vpk_list=&vpk_list; - std::thread::scope(move|s|{ - let mut thread_handles=Vec::new(); - for texture_name in deduplicate{ - let mut found_texture=false; - //LMAO imagine having to write type names - let write_image=|mut stuff,write_file_name|{ - let image=vtf::from_bytes(&mut stuff)?.highres_image.decode(0)?.to_rgba8(); - - let format=if image.width()%4!=0||image.height()%4!=0{ - image_dds::ImageFormat::Rgba8UnormSrgb - }else{ - image_dds::ImageFormat::BC7RgbaUnormSrgb - }; - //this fails if the image dimensions are not a multiple of 4 - let dds = image_dds::dds_from_image( - &image, - format, - image_dds::Quality::Slow, - image_dds::Mipmaps::GeneratedAutomatic, - )?; - - //write dds - let mut dest=PathBuf::from("textures"); - dest.push(write_file_name); - dest.set_extension("dds"); - std::fs::create_dir_all(dest.parent().unwrap())?; - let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); - dds.write(&mut writer)?; - Ok::<(),anyhow::Error>(()) - }; - let find_stuff=|search_file_name:String|{ - println!("search_file_name={}",search_file_name); - match pack.get(search_file_name.as_str())?{ - Some(file)=>return Ok(Some(file)), - _=>(), - } - //search pak list - for vpk_index in vpk_list{ - if let Some(vpk_entry)=vpk_index.tree.get(search_file_name.as_str()){ - return Ok(Some(match vpk_entry.get()?{ - std::borrow::Cow::Borrowed(bytes)=>bytes.to_vec(), - std::borrow::Cow::Owned(bytes)=>bytes, - })); - } - } - Ok::>,anyhow::Error>(None) - }; - let loader=|texture_name:String|{ - let mut texture_file_name=PathBuf::from("materials"); - //lower case - let texture_file_name_lowercase=texture_name.to_lowercase(); - texture_file_name.push(texture_file_name_lowercase.clone()); - //remove stem and search for both vtf and vmt files - let stem=PathBuf::from(texture_file_name.file_stem().unwrap()); - texture_file_name.pop(); - texture_file_name.push(stem); - //somehow search for both files - let mut texture_file_name_vmt=texture_file_name.clone(); - texture_file_name.set_extension("vtf"); - texture_file_name_vmt.set_extension("vmt"); - if let Some(stuff)=find_stuff(texture_file_name.to_string_lossy().to_string())?{ - return Ok(Some(stuff)) - } - recursive_vmt_loader(&find_stuff,get_vmt(&find_stuff,texture_file_name_vmt.to_string_lossy().to_string())?) - }; - if let Some(stuff)=loader(texture_name.to_string_lossy().to_string())?{ - found_texture=true; - let texture_name=texture_name.clone(); - thread_handles.push(s.spawn(move||write_image(stuff,texture_name))); - } - if !found_texture{ - println!("no data"); - } - } - for thread in thread_handles{ - match thread.join(){ - Ok(Err(e))=>println!("write error: {:?}",e), - Err(e)=>println!("thread error: {:?}",e), - Ok(_)=>(), - } - } - Ok::<(),anyhow::Error>(()) - })? - } - Ok(()) -} - -fn vpk_contents(vpk_path:PathBuf)->AResult<()>{ - let vpk_index=vpk::VPK::read(&vpk_path)?; - for (label,entry) in vpk_index.tree.into_iter(){ - println!("vpk label={} entry={:?}",label,entry); - } - Ok(()) -} - -fn bsp_contents(path:PathBuf)->AResult<()>{ - let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; - for file_name in bsp.pack.into_zip().into_inner().unwrap().file_names(){ - println!("file_name={:?}",file_name); - } - Ok(()) -} - -#[derive(Debug)] -#[allow(dead_code)] -enum ConvertError{ - IO(std::io::Error), - SNFMap(strafesnet_snf::map::Error), - RbxLoader(strafesnet_rbx_loader::ReadError), - BspLoader(strafesnet_bsp_loader::ReadError), -} -impl std::fmt::Display for ConvertError{ - fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ - write!(f,"{self:?}") - } -} -impl std::error::Error for ConvertError{} - -type MapThread=std::thread::JoinHandle>; - -fn roblox_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ - let n_paths=pathlist.len(); - let start = std::time::Instant::now(); - let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); - let mut i=0; - let mut join_thread=|thread:MapThread|{ - i+=1; - if let Err(e)=thread.join(){ - println!("thread error: {:?}",e); - }else{ - println!("{}/{}",i,n_paths); - } - }; - for path in pathlist{ - if 32<=threads.len(){ - join_thread(threads.pop_front().unwrap()); - } - let output_folder=output_folder.clone(); - threads.push_back(std::thread::spawn(move ||{ - let model=strafesnet_rbx_loader::read( - std::fs::File::open(path.as_path()) - .map_err(ConvertError::IO)? - ).map_err(ConvertError::RbxLoader)?; - - let mut place=model.into_place(); - place.run_scripts(); - - let mut loader=strafesnet_deferred_loader::roblox_legacy(); - - let (texture_loader,mesh_loader)=loader.get_inner_mut(); - - let map_step1=strafesnet_rbx_loader::convert( - &place, - |name|texture_loader.acquire_render_config_id(name), - |name|mesh_loader.acquire_mesh_id(name), - ); - - let meshpart_meshes=mesh_loader.load_meshes().map_err(ConvertError::IO)?; - - let map_step2=map_step1.add_meshpart_meshes_and_calculate_attributes( - meshpart_meshes.into_iter().map(|(mesh_id,loader_model)| - (mesh_id,strafesnet_rbx_loader::data::RobloxMeshBytes::new(loader_model.get())) - ) - ); - - let (textures,render_configs)=loader.into_render_configs().map_err(ConvertError::IO)?.consume(); - - let map=map_step2.add_render_configs_and_textures( - render_configs.into_iter(), - textures.into_iter().map(|(texture_id,texture)| - (texture_id,match texture{ - strafesnet_deferred_loader::texture::Texture::ImageDDS(data)=>data, - }) - ) - ); - - let mut dest=output_folder.clone(); - dest.push(path.file_stem().unwrap()); - dest.set_extension("snfm"); - let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; - - strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; - Ok(()) - })); - } - - for thread in threads{ - join_thread(thread); - } - println!("{:?}", start.elapsed()); - Ok(()) -} - -fn source_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ - let n_paths=pathlist.len(); - let start = std::time::Instant::now(); - let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); - let mut i=0; - let mut join_thread=|thread:MapThread|{ - i+=1; - if let Err(e)=thread.join(){ - println!("thread error: {:?}",e); - }else{ - println!("{}/{}",i,n_paths); - } - }; - for path in pathlist{ - if 32<=threads.len(){ - join_thread(threads.pop_front().unwrap()); - } - let output_folder=output_folder.clone(); - threads.push_back(std::thread::spawn(move ||{ - let bsp=strafesnet_bsp_loader::read( - std::fs::File::open(path.as_path()) - .map_err(ConvertError::IO)? - ).map_err(ConvertError::BspLoader)?; - let mut loader=strafesnet_deferred_loader::source_legacy(); - - let (texture_loader,mesh_loader)=loader.get_inner_mut(); - - let map_step1=strafesnet_bsp_loader::convert( - &bsp, - |name|texture_loader.acquire_render_config_id(name), - |name|mesh_loader.acquire_mesh_id(name), - ); - - let prop_meshes=mesh_loader.load_meshes(&bsp.as_ref()); - - let map_step2=map_step1.add_prop_meshes( - //the type conflagulator 9000 - prop_meshes.into_iter().map(|(mesh_id,loader_model)| - (mesh_id,strafesnet_bsp_loader::data::ModelData{ - mdl:strafesnet_bsp_loader::data::MdlData::new(loader_model.mdl.get()), - vtx:strafesnet_bsp_loader::data::VtxData::new(loader_model.vtx.get()), - vvd:strafesnet_bsp_loader::data::VvdData::new(loader_model.vvd.get()), - }) - ), - |name|texture_loader.acquire_render_config_id(name), - ); - - let (textures,render_configs)=loader.into_render_configs().map_err(ConvertError::IO)?.consume(); - - let map=map_step2.add_render_configs_and_textures( - render_configs.into_iter(), - textures.into_iter().map(|(texture_id,texture)| - (texture_id,match texture{ - strafesnet_deferred_loader::texture::Texture::ImageDDS(data)=>data, - }) - ), - ); - - let mut dest=output_folder.clone(); - dest.push(path.file_stem().unwrap()); - dest.set_extension("snfm"); - let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; - - strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; - Ok(()) - })); - } - - for thread in threads{ - join_thread(thread); - } - println!("{:?}", start.elapsed()); - Ok(()) -} diff --git a/src/roblox.rs b/src/roblox.rs new file mode 100644 index 00000000..53a7a5b5 --- /dev/null +++ b/src/roblox.rs @@ -0,0 +1,273 @@ +use std::path::PathBuf; +use std::io::{Read,Seek}; +use std::collections::HashSet; +use clap::{Args,Subcommand}; +use anyhow::Result as AResult; +use rbx_dom_weak::Instance; +use strafesnet_deferred_loader::rbxassetid::RobloxAssetId; + +#[derive(Subcommand)] +pub enum Commands{ + RobloxToSNF(RobloxToSNFSubcommand), + DownloadTextures(DownloadTexturesSubcommand), + DownloadMeshes(DownloadMeshesSubcommand), +} + +#[derive(Args)] +pub struct RobloxToSNFSubcommand { + #[arg(long)] + output_folder:PathBuf, + #[arg(required=true)] + input_files:Vec, +} +#[derive(Args)] +pub struct DownloadTexturesSubcommand { + #[arg(long,required=true)] + roblox_files:Vec +} +#[derive(Args)] +pub struct DownloadMeshesSubcommand { + #[arg(long,required=true)] + roblox_files:Vec +} + +impl Commands{ + pub fn run(self)->AResult<()>{ + match self{ + Commands::RobloxToSNF(subcommand)=>roblox_to_snf(subcommand.input_files,subcommand.output_folder), + Commands::DownloadTextures(subcommand)=>download_textures(subcommand.roblox_files), + Commands::DownloadMeshes(subcommand)=>download_meshes(subcommand.roblox_files), + } + } +} + +fn load_dom(input:&mut R)->AResult{ + let mut first_8=[0u8;8]; + if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_8),std::io::Seek::rewind(input)){ + match &first_8[0..4]{ + b"{ + match &first_8[4..8]{ + b"lox!"=>rbx_binary::from_reader(input).map_err(anyhow::Error::msg), + b"lox "=>rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), + other=>Err(anyhow::Error::msg(format!("Unknown Roblox file type {:?}",other))), + } + }, + _=>Err(anyhow::Error::msg("unsupported file type")), + } + }else{ + Err(anyhow::Error::msg("peek failed")) + } +} + +/* The ones I'm interested in: +Beam.Texture +Decal.Texture +FileMesh.MeshId +FileMesh.TextureId +MaterialVariant.ColorMap +MaterialVariant.MetalnessMap +MaterialVariant.NormalMap +MaterialVariant.RoughnessMap +MeshPart.MeshId +MeshPart.TextureID +ParticleEmitter.Texture +Sky.MoonTextureId +Sky.SkyboxBk +Sky.SkyboxDn +Sky.SkyboxFt +Sky.SkyboxLf +Sky.SkyboxRt +Sky.SkyboxUp +Sky.SunTextureId +SurfaceAppearance.ColorMap +SurfaceAppearance.MetalnessMap +SurfaceAppearance.NormalMap +SurfaceAppearance.RoughnessMap +SurfaceAppearance.TexturePack +*/ +fn accumulate_content_id(content_list:&mut HashSet,object:&Instance,property:&str){ + if let Some(rbx_dom_weak::types::Variant::Content(content))=object.properties.get(property){ + if let Ok(asset_id)=AsRef::::as_ref(content).parse::(){ + content_list.insert(asset_id.0); + }else{ + println!("Content failed to parse into AssetID: {:?}",content); + } + }else{ + println!("property={} does not exist for class={}",object.class.as_str(),property); + } +} +fn download_textures(paths:Vec)->AResult<()>{ + println!("Reading files, this could take a hot minute..."); + let mut texture_list=HashSet::new(); + for path in paths{ + let file=match std::fs::File::open(path.as_path()){ + Ok(file)=>file, + Err(e)=>{ + println!("file error {e}"); + continue; + } + }; + let mut input=std::io::BufReader::new(file); + match load_dom(&mut input){ + Ok(dom)=>{ + for object in dom.into_raw().1.into_values(){ + match object.class.as_str(){ + "Beam"=>accumulate_content_id(&mut texture_list,&object,"Texture"), + "Decal"=>accumulate_content_id(&mut texture_list,&object,"Texture"), + "Texture"=>accumulate_content_id(&mut texture_list,&object,"Texture"), + "FileMesh"=>accumulate_content_id(&mut texture_list,&object,"TextureId"), + "MeshPart"=>accumulate_content_id(&mut texture_list,&object,"TextureID"), + "ParticleEmitter"=>accumulate_content_id(&mut texture_list,&object,"Texture"), + "Sky"=>{ + accumulate_content_id(&mut texture_list,&object,"MoonTextureId"); + accumulate_content_id(&mut texture_list,&object,"SkyboxBk"); + accumulate_content_id(&mut texture_list,&object,"SkyboxDn"); + accumulate_content_id(&mut texture_list,&object,"SkyboxFt"); + accumulate_content_id(&mut texture_list,&object,"SkyboxLf"); + accumulate_content_id(&mut texture_list,&object,"SkyboxRt"); + accumulate_content_id(&mut texture_list,&object,"SkyboxUp"); + accumulate_content_id(&mut texture_list,&object,"SunTextureId"); + }, + _=>(), + } + } + }, + Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), + } + } + let texture_list_string=texture_list.into_iter().map(|id|id.to_string()).collect::>(); + println!("Texture list:{:?}",texture_list_string.join(" ")); + std::fs::create_dir_all("textures/unprocessed")?; + let output=std::process::Command::new("asset-tool") + .args(["download","--cookie-literal","","--output-folder","textures/unprocessed/"]) + .args(texture_list_string) + .spawn()? + .wait_with_output()?; + println!("Asset tool exit_success:{}",output.status.success()); + Ok(()) +} +fn download_meshes(paths:Vec)->AResult<()>{ + println!("Reading files, this could take a hot minute..."); + let mut mesh_list=HashSet::new(); + for path in paths{ + let file=match std::fs::File::open(path.as_path()){ + Ok(file)=>file, + Err(e)=>{ + println!("file error {e}"); + continue; + } + }; + let mut input=std::io::BufReader::new(file); + match load_dom(&mut input){ + Ok(dom)=>{ + for object in dom.into_raw().1.into_values(){ + match object.class.as_str(){ + "MeshPart"=>accumulate_content_id(&mut mesh_list,&object,"MeshId"), + "SpecialMesh"=>accumulate_content_id(&mut mesh_list,&object,"MeshId"), + _=>(), + } + } + }, + Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), + } + } + let mesh_list_string=mesh_list.into_iter().map(|id|id.to_string()).collect::>(); + println!("Mesh list:{:?}",mesh_list_string.join(" ")); + std::fs::create_dir_all("meshes/")?; + let output=std::process::Command::new("asset-tool") + .args(["download","--cookie-literal","","--output-folder","meshes/"]) + .args(mesh_list_string) + .spawn()? + .wait_with_output()?; + println!("Asset tool exit_success:{}",output.status.success()); + Ok(()) +} + +#[derive(Debug)] +#[allow(dead_code)] +enum ConvertError{ + IO(std::io::Error), + SNFMap(strafesnet_snf::map::Error), + RbxLoader(strafesnet_rbx_loader::ReadError), +} +impl std::fmt::Display for ConvertError{ + fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ + write!(f,"{self:?}") + } +} +impl std::error::Error for ConvertError{} + +type MapThread=std::thread::JoinHandle>; + +fn roblox_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ + let n_paths=pathlist.len(); + let start = std::time::Instant::now(); + let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); + let mut i=0; + let mut join_thread=|thread:MapThread|{ + i+=1; + if let Err(e)=thread.join(){ + println!("thread error: {:?}",e); + }else{ + println!("{}/{}",i,n_paths); + } + }; + for path in pathlist{ + if 32<=threads.len(){ + join_thread(threads.pop_front().unwrap()); + } + let output_folder=output_folder.clone(); + threads.push_back(std::thread::spawn(move ||{ + let model=strafesnet_rbx_loader::read( + std::fs::File::open(path.as_path()) + .map_err(ConvertError::IO)? + ).map_err(ConvertError::RbxLoader)?; + + let mut place=model.into_place(); + place.run_scripts(); + + let mut loader=strafesnet_deferred_loader::roblox_legacy(); + + let (texture_loader,mesh_loader)=loader.get_inner_mut(); + + let map_step1=strafesnet_rbx_loader::convert( + &place, + |name|texture_loader.acquire_render_config_id(name), + |name|mesh_loader.acquire_mesh_id(name), + ); + + let meshpart_meshes=mesh_loader.load_meshes().map_err(ConvertError::IO)?; + + let map_step2=map_step1.add_meshpart_meshes_and_calculate_attributes( + meshpart_meshes.into_iter().map(|(mesh_id,loader_model)| + (mesh_id,strafesnet_rbx_loader::data::RobloxMeshBytes::new(loader_model.get())) + ) + ); + + let (textures,render_configs)=loader.into_render_configs().map_err(ConvertError::IO)?.consume(); + + let map=map_step2.add_render_configs_and_textures( + render_configs.into_iter(), + textures.into_iter().map(|(texture_id,texture)| + (texture_id,match texture{ + strafesnet_deferred_loader::texture::Texture::ImageDDS(data)=>data, + }) + ) + ); + + let mut dest=output_folder.clone(); + dest.push(path.file_stem().unwrap()); + dest.set_extension("snfm"); + let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; + + strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; + Ok(()) + })); + } + + for thread in threads{ + join_thread(thread); + } + println!("{:?}", start.elapsed()); + Ok(()) +} diff --git a/src/source.rs b/src/source.rs new file mode 100644 index 00000000..1d0f803c --- /dev/null +++ b/src/source.rs @@ -0,0 +1,364 @@ +use std::path::PathBuf; +use clap::{Args,Subcommand}; +use anyhow::Result as AResult; + +#[derive(Subcommand)] +pub enum Commands{ + SourceToSNF(SourceToSNFSubcommand), + ExtractTextures(ExtractTexturesSubcommand), + VPKContents(VPKContentsSubcommand), + BSPContents(BSPContentsSubcommand), +} + +#[derive(Args)] +pub struct SourceToSNFSubcommand { + #[arg(long)] + output_folder:PathBuf, + #[arg(required=true)] + input_files:Vec, +} +#[derive(Args)] +pub struct ExtractTexturesSubcommand { + #[arg(long)] + bsp_file:PathBuf, + #[arg(long)] + vpk_dir_files:Vec +} +#[derive(Args)] +pub struct VPKContentsSubcommand { + #[arg(long)] + input_file:PathBuf, +} +#[derive(Args)] +pub struct BSPContentsSubcommand { + #[arg(long)] + input_file:PathBuf, +} + +impl Commands{ + pub fn run(self)->AResult<()>{ + match self{ + Commands::SourceToSNF(subcommand)=>source_to_snf(subcommand.input_files,subcommand.output_folder), + Commands::ExtractTextures(subcommand)=>extract_textures(vec![subcommand.bsp_file],subcommand.vpk_dir_files), + Commands::VPKContents(subcommand)=>vpk_contents(subcommand.input_file), + Commands::BSPContents(subcommand)=>bsp_contents(subcommand.input_file), + } + } +} + + +enum VMTContent{ + VMT(String), + VTF(String), + Patch(vmt_parser::material::PatchMaterial), + Unsupported,//don't want to deal with whatever vmt variant + Unresolved,//could not locate a texture because of vmt content +} +impl VMTContent{ + fn vtf(opt:Option)->Self{ + match opt{ + Some(s)=>Self::VTF(s), + None=>Self::Unresolved, + } + } +} + +fn get_some_texture(material:vmt_parser::material::Material)->AResult{ + //just grab some texture from somewhere for now + Ok(match material{ + vmt_parser::material::Material::LightMappedGeneric(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::VertexLitGeneric(mat)=>VMTContent::vtf(mat.base_texture.or(mat.decal_texture)),//this just dies if there is none + vmt_parser::material::Material::VertexLitGenericDx6(mat)=>VMTContent::vtf(mat.base_texture.or(mat.decal_texture)), + vmt_parser::material::Material::UnlitGeneric(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::UnlitTwoTexture(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::Water(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::WorldVertexTransition(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::EyeRefract(mat)=>VMTContent::vtf(Some(mat.cornea_texture)), + vmt_parser::material::Material::SubRect(mat)=>VMTContent::VMT(mat.material),//recursive + vmt_parser::material::Material::Sprite(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::SpriteCard(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::Cable(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::Refract(mat)=>VMTContent::vtf(mat.base_texture), + vmt_parser::material::Material::Modulate(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::DecalModulate(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::Sky(mat)=>VMTContent::vtf(Some(mat.base_texture)), + vmt_parser::material::Material::Replacements(_mat)=>VMTContent::Unsupported, + vmt_parser::material::Material::Patch(mat)=>VMTContent::Patch(mat), + _=>return Err(anyhow::Error::msg("vmt failed to parse")), + }) +} + +fn get_vmtAResult>>>(find_stuff:&F,search_name:String)->AResult{ + if let Some(stuff)=find_stuff(search_name)?{ + //decode vmt and then write + let stuff=String::from_utf8(stuff)?; + let material=vmt_parser::from_str(stuff.as_str())?; + println!("vmt material={:?}",material); + return Ok(material); + } + Err(anyhow::Error::msg("vmt not found")) +} + +fn recursive_vmt_loaderAResult>>>(find_stuff:&F,material:vmt_parser::material::Material)->AResult>>{ + match get_some_texture(material)?{ + VMTContent::VMT(s)=>recursive_vmt_loader(find_stuff,get_vmt(find_stuff,s)?), + VMTContent::VTF(s)=>{ + let mut texture_file_name=PathBuf::from("materials"); + texture_file_name.push(s); + texture_file_name.set_extension("vtf"); + find_stuff(texture_file_name.into_os_string().into_string().unwrap()) + }, + VMTContent::Patch(mat)=>recursive_vmt_loader(find_stuff, + mat.resolve(|search_name|{ + match find_stuff(search_name.to_string())?{ + Some(bytes)=>Ok(String::from_utf8(bytes)?), + None=>Err(anyhow::Error::msg("could not find vmt")), + } + })? + ), + VMTContent::Unsupported=>{println!("Unsupported vmt");Ok(None)},//print and move on + VMTContent::Unresolved=>{println!("Unresolved vmt");Ok(None)}, + } +} + +fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ + std::fs::create_dir_all("textures")?; + let vpk_list:Vec=vpk_paths.into_iter().map(|vpk_path|vpk::VPK::read(&vpk_path).expect("vpk file does not exist")).collect(); + for path in paths{ + let mut deduplicate=std::collections::HashSet::new(); + let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; + for texture in bsp.textures(){ + deduplicate.insert(PathBuf::from(texture.name())); + } + //dedupe prop models + let mut model_dedupe=std::collections::HashSet::new(); + for prop in bsp.static_props(){ + model_dedupe.insert(prop.model()); + } + + //grab texture names from props + for model_name in model_dedupe{ + //.mdl, .vvd, .dx90.vtx + let mut path=PathBuf::from(model_name); + let file_name=PathBuf::from(path.file_stem().unwrap()); + path.pop(); + path.push(file_name); + let mut vvd_path=path.clone(); + let mut vtx_path=path.clone(); + vvd_path.set_extension("vvd"); + vtx_path.set_extension("dx90.vtx"); + match (bsp.pack.get(model_name),bsp.pack.get(vvd_path.as_os_str().to_str().unwrap()),bsp.pack.get(vtx_path.as_os_str().to_str().unwrap())){ + (Ok(Some(mdl_file)),Ok(Some(vvd_file)),Ok(Some(vtx_file)))=>{ + match (vmdl::mdl::Mdl::read(mdl_file.as_ref()),vmdl::vvd::Vvd::read(vvd_file.as_ref()),vmdl::vtx::Vtx::read(vtx_file.as_ref())){ + (Ok(mdl),Ok(vvd),Ok(vtx))=>{ + let model=vmdl::Model::from_parts(mdl,vtx,vvd); + for texture in model.textures(){ + for search_path in &texture.search_paths{ + let mut path=PathBuf::from(search_path.as_str()); + path.push(texture.name.as_str()); + deduplicate.insert(path); + } + } + }, + _=>println!("model_name={} error",model_name), + } + }, + _=>println!("no model name={}",model_name), + } + } + + let pack=&bsp.pack; + let vpk_list=&vpk_list; + std::thread::scope(move|s|{ + let mut thread_handles=Vec::new(); + for texture_name in deduplicate{ + let mut found_texture=false; + //LMAO imagine having to write type names + let write_image=|mut stuff,write_file_name|{ + let image=vtf::from_bytes(&mut stuff)?.highres_image.decode(0)?.to_rgba8(); + + let format=if image.width()%4!=0||image.height()%4!=0{ + image_dds::ImageFormat::Rgba8UnormSrgb + }else{ + image_dds::ImageFormat::BC7RgbaUnormSrgb + }; + //this fails if the image dimensions are not a multiple of 4 + let dds = image_dds::dds_from_image( + &image, + format, + image_dds::Quality::Slow, + image_dds::Mipmaps::GeneratedAutomatic, + )?; + + //write dds + let mut dest=PathBuf::from("textures"); + dest.push(write_file_name); + dest.set_extension("dds"); + std::fs::create_dir_all(dest.parent().unwrap())?; + let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); + dds.write(&mut writer)?; + Ok::<(),anyhow::Error>(()) + }; + let find_stuff=|search_file_name:String|{ + println!("search_file_name={}",search_file_name); + match pack.get(search_file_name.as_str())?{ + Some(file)=>return Ok(Some(file)), + _=>(), + } + //search pak list + for vpk_index in vpk_list{ + if let Some(vpk_entry)=vpk_index.tree.get(search_file_name.as_str()){ + return Ok(Some(match vpk_entry.get()?{ + std::borrow::Cow::Borrowed(bytes)=>bytes.to_vec(), + std::borrow::Cow::Owned(bytes)=>bytes, + })); + } + } + Ok::>,anyhow::Error>(None) + }; + let loader=|texture_name:String|{ + let mut texture_file_name=PathBuf::from("materials"); + //lower case + let texture_file_name_lowercase=texture_name.to_lowercase(); + texture_file_name.push(texture_file_name_lowercase.clone()); + //remove stem and search for both vtf and vmt files + let stem=PathBuf::from(texture_file_name.file_stem().unwrap()); + texture_file_name.pop(); + texture_file_name.push(stem); + //somehow search for both files + let mut texture_file_name_vmt=texture_file_name.clone(); + texture_file_name.set_extension("vtf"); + texture_file_name_vmt.set_extension("vmt"); + if let Some(stuff)=find_stuff(texture_file_name.to_string_lossy().to_string())?{ + return Ok(Some(stuff)) + } + recursive_vmt_loader(&find_stuff,get_vmt(&find_stuff,texture_file_name_vmt.to_string_lossy().to_string())?) + }; + if let Some(stuff)=loader(texture_name.to_string_lossy().to_string())?{ + found_texture=true; + let texture_name=texture_name.clone(); + thread_handles.push(s.spawn(move||write_image(stuff,texture_name))); + } + if !found_texture{ + println!("no data"); + } + } + for thread in thread_handles{ + match thread.join(){ + Ok(Err(e))=>println!("write error: {:?}",e), + Err(e)=>println!("thread error: {:?}",e), + Ok(_)=>(), + } + } + Ok::<(),anyhow::Error>(()) + })? + } + Ok(()) +} + +fn vpk_contents(vpk_path:PathBuf)->AResult<()>{ + let vpk_index=vpk::VPK::read(&vpk_path)?; + for (label,entry) in vpk_index.tree.into_iter(){ + println!("vpk label={} entry={:?}",label,entry); + } + Ok(()) +} + +fn bsp_contents(path:PathBuf)->AResult<()>{ + let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; + for file_name in bsp.pack.into_zip().into_inner().unwrap().file_names(){ + println!("file_name={:?}",file_name); + } + Ok(()) +} + +#[derive(Debug)] +#[allow(dead_code)] +enum ConvertError{ + IO(std::io::Error), + SNFMap(strafesnet_snf::map::Error), + BspLoader(strafesnet_bsp_loader::ReadError), +} +impl std::fmt::Display for ConvertError{ + fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ + write!(f,"{self:?}") + } +} +impl std::error::Error for ConvertError{} + +type MapThread=std::thread::JoinHandle>; + +fn source_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ + let n_paths=pathlist.len(); + let start = std::time::Instant::now(); + let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); + let mut i=0; + let mut join_thread=|thread:MapThread|{ + i+=1; + if let Err(e)=thread.join(){ + println!("thread error: {:?}",e); + }else{ + println!("{}/{}",i,n_paths); + } + }; + for path in pathlist{ + if 32<=threads.len(){ + join_thread(threads.pop_front().unwrap()); + } + let output_folder=output_folder.clone(); + threads.push_back(std::thread::spawn(move ||{ + let bsp=strafesnet_bsp_loader::read( + std::fs::File::open(path.as_path()) + .map_err(ConvertError::IO)? + ).map_err(ConvertError::BspLoader)?; + let mut loader=strafesnet_deferred_loader::source_legacy(); + + let (texture_loader,mesh_loader)=loader.get_inner_mut(); + + let map_step1=strafesnet_bsp_loader::convert( + &bsp, + |name|texture_loader.acquire_render_config_id(name), + |name|mesh_loader.acquire_mesh_id(name), + ); + + let prop_meshes=mesh_loader.load_meshes(&bsp.as_ref()); + + let map_step2=map_step1.add_prop_meshes( + //the type conflagulator 9000 + prop_meshes.into_iter().map(|(mesh_id,loader_model)| + (mesh_id,strafesnet_bsp_loader::data::ModelData{ + mdl:strafesnet_bsp_loader::data::MdlData::new(loader_model.mdl.get()), + vtx:strafesnet_bsp_loader::data::VtxData::new(loader_model.vtx.get()), + vvd:strafesnet_bsp_loader::data::VvdData::new(loader_model.vvd.get()), + }) + ), + |name|texture_loader.acquire_render_config_id(name), + ); + + let (textures,render_configs)=loader.into_render_configs().map_err(ConvertError::IO)?.consume(); + + let map=map_step2.add_render_configs_and_textures( + render_configs.into_iter(), + textures.into_iter().map(|(texture_id,texture)| + (texture_id,match texture{ + strafesnet_deferred_loader::texture::Texture::ImageDDS(data)=>data, + }) + ), + ); + + let mut dest=output_folder.clone(); + dest.push(path.file_stem().unwrap()); + dest.set_extension("snfm"); + let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; + + strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; + Ok(()) + })); + } + + for thread in threads{ + join_thread(thread); + } + println!("{:?}", start.elapsed()); + Ok(()) +} From 3227a6486abb3596f09f844f50ce364a8f406989 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 27 Jan 2025 07:48:13 -0800 Subject: [PATCH 118/125] update deps --- Cargo.lock | 847 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 561 insertions(+), 286 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ebdc9fb1..a0b77962 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,12 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +version = 4 [[package]] name = "adler2" @@ -44,9 +38,9 @@ checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -59,43 +53,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "approx" @@ -108,9 +103,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" [[package]] name = "arg_enum_proc_macro" @@ -120,7 +115,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -163,9 +158,9 @@ dependencies = [ [[package]] name = "avif-serialize" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" +checksum = "e335041290c43101ca215eed6f43ec437eb5a42125573f600fc3fa42b9bddd62" dependencies = [ "arrayvec", ] @@ -201,12 +196,12 @@ dependencies = [ [[package]] name = "binrw" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f36b7cb3ab9ff6a2858650d8dc360e783a5d14dc29594db48c56a3c233cc265" +checksum = "7d4bca59c20d6f40c2cc0802afbe1e788b89096f61bdf7aeea6bf00f10c2909b" dependencies = [ "array-init", - "binrw_derive 0.14.0", + "binrw_derive 0.14.1", "bytemuck", ] @@ -225,9 +220,9 @@ dependencies = [ [[package]] name = "binrw_derive" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ea7a8c5c8eeffffac6d54d172444e15beffac6f817fac714460a9a9aa88da3" +checksum = "d8ba42866ce5bced2645bfa15e97eef2c62d2bdb530510538de8dd3d04efff3c" dependencies = [ "either", "owo-colors", @@ -250,21 +245,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitstream-io" -version = "2.5.3" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b81e1519b0d82120d2fd469d5bfb2919a9361c48b02d82d04befc1cdd2002452" +checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" [[package]] name = "blake3" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" dependencies = [ "arrayref", "arrayvec", @@ -275,15 +270,15 @@ dependencies = [ [[package]] name = "bnum" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50202def95bf36cb7d1d7a7962cea1c36a3f8ad42425e5d2b71d7acb8041b5b8" +checksum = "f781dba93de3a5ef6dc5b17c9958b208f6f3f021623b360fb605ea51ce443f10" [[package]] name = "bstr" -version = "1.10.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "serde", @@ -291,9 +286,9 @@ dependencies = [ [[package]] name = "built" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" +checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" [[package]] name = "bumpalo" @@ -312,22 +307,22 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.7.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -350,9 +345,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.1.24" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "jobserver", "libc", @@ -387,9 +382,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" dependencies = [ "clap_builder", "clap_derive", @@ -397,9 +392,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" dependencies = [ "anstream", "anstyle", @@ -409,21 +404,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "color_quant" @@ -433,9 +428,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "constant_time_eq" @@ -469,9 +464,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -488,15 +483,15 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "ddsfile" @@ -504,12 +499,23 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479dfe1e6737aa9e96c6ac7b69689dc4c32da8383f2c12744739d76afa8b66c4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "byteorder 1.5.0", "enum-primitive-derive", "num-traits", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "either" version = "1.13.0" @@ -544,20 +550,19 @@ dependencies = [ "quote", "rustversion", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] name = "exr" -version = "1.72.0" +version = "1.73.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" +checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" dependencies = [ "bit_field", - "flume", "half", "lebe", - "miniz_oxide 0.7.4", + "miniz_oxide", "rayon-core", "smallvec", "zune-inflate", @@ -565,9 +570,9 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" dependencies = [ "simd-adler32", ] @@ -592,21 +597,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", -] - -[[package]] -name = "flume" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" -dependencies = [ - "spin", + "miniz_oxide", ] [[package]] @@ -647,9 +643,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.29.0" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28091a37a5d09b555cb6628fd954da299b536433834f5b8e59eba78e0cbbf8a" +checksum = "dc46dd3ec48fdd8e693a98d2b8bafae273a2d54c1de02a2a7e3d57d501f39677" [[package]] name = "half" @@ -664,9 +660,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -680,6 +676,124 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "id" version = "0.1.0" @@ -688,24 +802,35 @@ checksum = "2337e7a6c273082b672e377e159d7a168fb51438461b7c4033c79a515dd7a25a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] name = "image" -version = "0.25.2" +version = "0.25.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" dependencies = [ "bytemuck", "byteorder-lite", @@ -726,9 +851,9 @@ dependencies = [ [[package]] name = "image-webp" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904" +checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f" dependencies = [ "byteorder-lite", "quick-error", @@ -736,9 +861,9 @@ dependencies = [ [[package]] name = "image_dds" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e332cf1abe0ecc56ef44c85248d580ef05bfeae806f586ee17890d1b09c05c8" +checksum = "84c6d1a2d80bc7dd2928b2a72a46d71bccbb6becf8ce207522b0b92daf0a417f" dependencies = [ "bcdec_rs", "bytemuck", @@ -752,15 +877,15 @@ dependencies = [ [[package]] name = "imgref" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" +checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown", @@ -783,7 +908,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -837,9 +962,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "lazy-regex" -version = "3.3.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda" +checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126" dependencies = [ "lazy-regex-proc_macros", "once_cell", @@ -848,14 +973,14 @@ dependencies = [ [[package]] name = "lazy-regex-proc_macros" -version = "3.3.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163" +checksum = "4ba01db5ef81e17eb10a5e0f2109d1b3a3e29bac3070fdbd7d156bf7dbd206a1" dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -872,26 +997,25 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libfuzzer-sys" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" +checksum = "9b9569d2f74e257076d8c6bfa73fb505b46b851e51ddaecc825944aa3bed17fa" dependencies = [ "arbitrary", "cc", - "once_cell", ] [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets", @@ -899,9 +1023,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linear_ops" @@ -914,6 +1038,12 @@ dependencies = [ "ratio_ops", ] +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -926,24 +1056,24 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "logos" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6b6e02facda28ca5fb8dbe4b152496ba3b1bd5a4b40bb2b1b2d8ad74e0f39b" +checksum = "7251356ef8cb7aec833ddf598c6cb24d17b689d20b993f9d11a3d764e34e6458" dependencies = [ "logos-derive", ] [[package]] name = "logos-codegen" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32eb6b5f26efacd015b000bfc562186472cd9b34bdba3f6b264e2a052676d10" +checksum = "59f80069600c0d66734f5ff52cc42f2dabd6b29d205f333d61fd7832e9e9963f" dependencies = [ "beef", "fnv", @@ -951,14 +1081,14 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] name = "logos-derive" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5d0c5463c911ef55624739fc353238b4e310f0144be1f875dc42fec6bfd5ec" +checksum = "24fb722b06a9dc12adb0963ed585f19fc61dc5413e6a9be9422ef92c091e731d" dependencies = [ "logos-codegen", ] @@ -974,18 +1104,18 @@ dependencies = [ [[package]] name = "luau0-src" -version = "0.10.3+luau640" +version = "0.11.2+luau653" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f39d12b514a676c943990cfbe6200fedcb9c293c8c9219d29be512a6969be92" +checksum = "02313a53daf1fae25e82f7e7ca56180b72d1f08c514426672877cd957298201c" dependencies = [ "cc", ] [[package]] name = "lz4" -version = "1.28.0" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" +checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" dependencies = [ "lz4-sys", ] @@ -1051,6 +1181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" dependencies = [ "cfg-if", + "rayon", ] [[package]] @@ -1061,9 +1192,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" dependencies = [ "cfg-if", "miette-derive", @@ -1073,13 +1204,13 @@ dependencies = [ [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1090,18 +1221,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", "simd-adler32", @@ -1109,23 +1231,24 @@ dependencies = [ [[package]] name = "mlua" -version = "0.9.9" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d111deb18a9c9bd33e1541309f4742523bfab01d276bfa9a27519f6de9c11dc7" +checksum = "9ea43c3ffac2d0798bd7128815212dd78c98316b299b7a902dabef13dc7b6b8d" dependencies = [ "bstr", + "either", "libloading", "mlua-sys", "num-traits", - "once_cell", + "parking_lot", "rustc-hash", ] [[package]] name = "mlua-sys" -version = "0.6.3" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe026d6bd1583a9cf9080e189030ddaea7e6f5f0deb366a8e26f8a26c4135b8" +checksum = "63a11d485edf0f3f04a508615d36c7d50d299cf61a7ee6d3e2530651e0a31771" dependencies = [ "cc", "cfg-if", @@ -1173,7 +1296,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1233,17 +1356,14 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "owo-colors" @@ -1251,6 +1371,29 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + [[package]] name = "parse-display" version = "0.9.1" @@ -1284,7 +1427,7 @@ dependencies = [ "regex", "regex-syntax", "structmeta", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1298,7 +1441,7 @@ dependencies = [ "regex", "regex-syntax", "structmeta", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1314,10 +1457,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "pin-project-lite" -version = "0.2.14" +name = "phf" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pkg-config" @@ -1327,23 +1512,17 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "png" -version = "0.17.14" +version = "0.17.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.8.0", + "miniz_oxide", ] -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -1388,30 +1567,30 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1431,9 +1610,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -1511,15 +1690,16 @@ dependencies = [ [[package]] name = "ravif" -version = "0.11.10" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f0bfd976333248de2078d350bfdf182ff96e168a24d23d2436cef320dd4bdd" +checksum = "2413fd96bd0ea5cdeeb37eaf446a22e6ed7b981d792828721e74ded1980a45c6" dependencies = [ "avif-serialize", "imgref", "loop9", "quick-error", "rav1e", + "rayon", "rgb", ] @@ -1574,7 +1754,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "864ead0e98afce28c960f653d6203483834890d07f87b60e2f01415530a2fe9d" dependencies = [ - "binrw 0.14.0", + "binrw 0.14.1", "lazy-regex", ] @@ -1631,10 +1811,19 @@ dependencies = [ ] [[package]] -name = "regex" -version = "1.11.0" +name = "redox_syscall" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags 2.8.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1644,9 +1833,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1664,9 +1853,6 @@ name = "rgb" version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" -dependencies = [ - "bytemuck", -] [[package]] name = "rmp" @@ -1692,12 +1878,13 @@ dependencies = [ [[package]] name = "roblox_emulator" -version = "0.4.1" +version = "0.4.6" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "6935943e8d473c8d19b52623877bee18421743072e2675730886d13592008266" +checksum = "03e2535327bd9069b20caa9df0a5cac87fa886cd2418c7f174016502d584a488" dependencies = [ "glam", "mlua", + "phf", "rbx_dom_weak", "rbx_reflection", "rbx_reflection_database", @@ -1706,15 +1893,15 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "scopeguard" @@ -1724,22 +1911,22 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1750,7 +1937,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1783,6 +1970,12 @@ dependencies = [ "quote", ] +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "smallvec" version = "1.13.2" @@ -1790,13 +1983,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] -name = "spin" -version = "0.9.8" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "static_assertions" @@ -1823,7 +2013,7 @@ source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" checksum = "91cc1f3699bd8248da18bf5d11273264396a257b5d47b8558acb2cb4e1761219" dependencies = [ "arrayvec", - "bitflags 2.6.0", + "bitflags 2.8.0", "fixed_wide", "glam", "id", @@ -1866,7 +2056,7 @@ version = "0.2.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" checksum = "c6e8856d79c29bd5687b08bc1653370f7e242c84d5c06afa8629bd3e00c433bf" dependencies = [ - "binrw 0.14.0", + "binrw 0.14.1", "id", "strafesnet_common", ] @@ -1886,7 +2076,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1897,7 +2087,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1919,7 +2109,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -1935,9 +2125,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -1956,6 +2146,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "system-deps" version = "6.2.2" @@ -1986,22 +2187,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] @@ -2016,20 +2217,15 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.8.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "toml" version = "0.8.19" @@ -2066,9 +2262,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -2077,44 +2273,29 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] +checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" [[package]] name = "unicode-width" @@ -2130,15 +2311,27 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -2164,8 +2357,8 @@ checksum = "f14a5685e0bb386aac9b9c6046a05152a46a0bc58d53afb3fbe577f1a1c2bb05" dependencies = [ "ahash", "arrayvec", - "binrw 0.14.0", - "bitflags 2.6.0", + "binrw 0.14.1", + "bitflags 2.8.0", "bv", "cgmath", "itertools 0.13.0", @@ -2210,7 +2403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da2f6b8c22da8937403a5da864e7ea390f30cd40b7a077079e40279aa6a4f553" dependencies = [ "arrayvec", - "bitflags 2.6.0", + "bitflags 2.8.0", "bytemuck", "cgmath", "half", @@ -2267,35 +2460,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2303,22 +2496,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "weezl" @@ -2328,9 +2524,9 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] @@ -2401,18 +2597,54 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] [[package]] -name = "xml-rs" -version = "0.8.22" +name = "write16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xml-rs" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure 0.13.1", +] [[package]] name = "zerocopy" @@ -2432,7 +2664,50 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.96", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure 0.13.1", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] @@ -2464,9 +2739,9 @@ dependencies = [ [[package]] name = "zune-jpeg" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" +checksum = "99a5bab8d7dedf81405c4bb1f2b83ea057643d9cb28778cea9eecddeedd2e028" dependencies = [ "zune-core", ] From d455cf4dc93fd7c87878ba64cb04c4a75ae51577 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 11 Oct 2024 09:21:55 -0700 Subject: [PATCH 119/125] Add strafesnet registry --- .cargo/config.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..8b662bc2 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[registries.strafesnet] +index = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" \ No newline at end of file From 349cd9c2334f9af90bde35ead219270db3eab443 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 27 Jan 2025 07:49:49 -0800 Subject: [PATCH 120/125] v1.6.0 split roblox and source --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0b77962..52092e5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1151,7 +1151,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.5.7" +version = "1.6.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 119a0e63..30891111 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.5.7" +version = "1.6.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From a5079f21d72a7fa199787918637fa5780cea56bb Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 27 Jan 2025 08:47:51 -0800 Subject: [PATCH 121/125] wip download_assets (pre-tokio) --- src/roblox.rs | 185 +++++++++++++++++++++----------------------------- 1 file changed, 76 insertions(+), 109 deletions(-) diff --git a/src/roblox.rs b/src/roblox.rs index 53a7a5b5..b22b62fd 100644 --- a/src/roblox.rs +++ b/src/roblox.rs @@ -1,5 +1,5 @@ -use std::path::PathBuf; -use std::io::{Read,Seek}; +use std::path::{Path,PathBuf}; +use std::io::{Cursor,Read,Seek}; use std::collections::HashSet; use clap::{Args,Subcommand}; use anyhow::Result as AResult; @@ -9,8 +9,7 @@ use strafesnet_deferred_loader::rbxassetid::RobloxAssetId; #[derive(Subcommand)] pub enum Commands{ RobloxToSNF(RobloxToSNFSubcommand), - DownloadTextures(DownloadTexturesSubcommand), - DownloadMeshes(DownloadMeshesSubcommand), + DownloadAssets(DownloadAssetsSubcommand), } #[derive(Args)] @@ -21,12 +20,7 @@ pub struct RobloxToSNFSubcommand { input_files:Vec, } #[derive(Args)] -pub struct DownloadTexturesSubcommand { - #[arg(long,required=true)] - roblox_files:Vec -} -#[derive(Args)] -pub struct DownloadMeshesSubcommand { +pub struct DownloadAssetsSubcommand{ #[arg(long,required=true)] roblox_files:Vec } @@ -35,27 +29,19 @@ impl Commands{ pub fn run(self)->AResult<()>{ match self{ Commands::RobloxToSNF(subcommand)=>roblox_to_snf(subcommand.input_files,subcommand.output_folder), - Commands::DownloadTextures(subcommand)=>download_textures(subcommand.roblox_files), - Commands::DownloadMeshes(subcommand)=>download_meshes(subcommand.roblox_files), + Commands::DownloadAssets(subcommand)=>download_assets(subcommand.roblox_files), } } } -fn load_dom(input:&mut R)->AResult{ +fn load_dom(mut input:R)->AResult{ let mut first_8=[0u8;8]; - if let (Ok(()),Ok(()))=(std::io::Read::read_exact(input, &mut first_8),std::io::Seek::rewind(input)){ - match &first_8[0..4]{ - b"{ - match &first_8[4..8]{ - b"lox!"=>rbx_binary::from_reader(input).map_err(anyhow::Error::msg), - b"lox "=>rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), - other=>Err(anyhow::Error::msg(format!("Unknown Roblox file type {:?}",other))), - } - }, - _=>Err(anyhow::Error::msg("unsupported file type")), - } - }else{ - Err(anyhow::Error::msg("peek failed")) + input.read_exact(&mut first_8)?; + input.rewind()?; + match &first_8{ + b"rbx_binary::from_reader(input).map_err(anyhow::Error::msg), + b"rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), + _=>Err(anyhow::Error::msg("unsupported file type")), } } @@ -85,10 +71,11 @@ SurfaceAppearance.NormalMap SurfaceAppearance.RoughnessMap SurfaceAppearance.TexturePack */ -fn accumulate_content_id(content_list:&mut HashSet,object:&Instance,property:&str){ +fn accumulate_content_id(content_list:&mut HashSet,object:&Instance,property:&str){ if let Some(rbx_dom_weak::types::Variant::Content(content))=object.properties.get(property){ - if let Ok(asset_id)=AsRef::::as_ref(content).parse::(){ - content_list.insert(asset_id.0); + let url:&str=content.as_ref(); + if let Ok(asset_id)=url.parse(){ + content_list.insert(asset_id); }else{ println!("Content failed to parse into AssetID: {:?}",content); } @@ -96,90 +83,70 @@ fn accumulate_content_id(content_list:&mut HashSet,object:&Instance,propert println!("property={} does not exist for class={}",object.class.as_str(),property); } } -fn download_textures(paths:Vec)->AResult<()>{ - println!("Reading files, this could take a hot minute..."); - let mut texture_list=HashSet::new(); - for path in paths{ - let file=match std::fs::File::open(path.as_path()){ - Ok(file)=>file, - Err(e)=>{ - println!("file error {e}"); - continue; - } - }; - let mut input=std::io::BufReader::new(file); - match load_dom(&mut input){ - Ok(dom)=>{ - for object in dom.into_raw().1.into_values(){ - match object.class.as_str(){ - "Beam"=>accumulate_content_id(&mut texture_list,&object,"Texture"), - "Decal"=>accumulate_content_id(&mut texture_list,&object,"Texture"), - "Texture"=>accumulate_content_id(&mut texture_list,&object,"Texture"), - "FileMesh"=>accumulate_content_id(&mut texture_list,&object,"TextureId"), - "MeshPart"=>accumulate_content_id(&mut texture_list,&object,"TextureID"), - "ParticleEmitter"=>accumulate_content_id(&mut texture_list,&object,"Texture"), - "Sky"=>{ - accumulate_content_id(&mut texture_list,&object,"MoonTextureId"); - accumulate_content_id(&mut texture_list,&object,"SkyboxBk"); - accumulate_content_id(&mut texture_list,&object,"SkyboxDn"); - accumulate_content_id(&mut texture_list,&object,"SkyboxFt"); - accumulate_content_id(&mut texture_list,&object,"SkyboxLf"); - accumulate_content_id(&mut texture_list,&object,"SkyboxRt"); - accumulate_content_id(&mut texture_list,&object,"SkyboxUp"); - accumulate_content_id(&mut texture_list,&object,"SunTextureId"); - }, - _=>(), - } - } - }, - Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), - } - } - let texture_list_string=texture_list.into_iter().map(|id|id.to_string()).collect::>(); - println!("Texture list:{:?}",texture_list_string.join(" ")); - std::fs::create_dir_all("textures/unprocessed")?; - let output=std::process::Command::new("asset-tool") - .args(["download","--cookie-literal","","--output-folder","textures/unprocessed/"]) - .args(texture_list_string) - .spawn()? - .wait_with_output()?; - println!("Asset tool exit_success:{}",output.status.success()); - Ok(()) +fn read_entire_file(path:impl AsRef)->Result>,std::io::Error>{ + let mut file=std::fs::File::open(path)?; + let mut data=Vec::new(); + file.read_to_end(&mut data)?; + Ok(Cursor::new(data)) } -fn download_meshes(paths:Vec)->AResult<()>{ - println!("Reading files, this could take a hot minute..."); - let mut mesh_list=HashSet::new(); - for path in paths{ - let file=match std::fs::File::open(path.as_path()){ - Ok(file)=>file, - Err(e)=>{ - println!("file error {e}"); - continue; - } - }; - let mut input=std::io::BufReader::new(file); - match load_dom(&mut input){ - Ok(dom)=>{ - for object in dom.into_raw().1.into_values(){ - match object.class.as_str(){ - "MeshPart"=>accumulate_content_id(&mut mesh_list,&object,"MeshId"), - "SpecialMesh"=>accumulate_content_id(&mut mesh_list,&object,"MeshId"), - _=>(), - } - } +#[derive(Default)] +struct UniqueAssets{ + meshes:HashSet, + unions:HashSet, + textures:HashSet, +} +impl UniqueAssets{ + fn collect(&mut self,object:&Instance){ + match object.class.as_str(){ + "Beam"=>accumulate_content_id(&mut self.textures,object,"Texture"), + "Decal"=>accumulate_content_id(&mut self.textures,object,"Texture"), + "Texture"=>accumulate_content_id(&mut self.textures,object,"Texture"), + "FileMesh"=>accumulate_content_id(&mut self.textures,object,"TextureId"), + "MeshPart"=>{ + accumulate_content_id(&mut self.textures,object,"TextureID"); + accumulate_content_id(&mut self.meshes,object,"MeshId"); }, - Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), + "SpecialMesh"=>accumulate_content_id(&mut self.meshes,object,"MeshId"), + "ParticleEmitter"=>accumulate_content_id(&mut self.textures,object,"Texture"), + "Sky"=>{ + accumulate_content_id(&mut self.textures,object,"MoonTextureId"); + accumulate_content_id(&mut self.textures,object,"SkyboxBk"); + accumulate_content_id(&mut self.textures,object,"SkyboxDn"); + accumulate_content_id(&mut self.textures,object,"SkyboxFt"); + accumulate_content_id(&mut self.textures,object,"SkyboxLf"); + accumulate_content_id(&mut self.textures,object,"SkyboxRt"); + accumulate_content_id(&mut self.textures,object,"SkyboxUp"); + accumulate_content_id(&mut self.textures,object,"SunTextureId"); + }, + "UnionOperation"=>accumulate_content_id(&mut self.unions,object,"AssetId"), + _=>(), } } - let mesh_list_string=mesh_list.into_iter().map(|id|id.to_string()).collect::>(); - println!("Mesh list:{:?}",mesh_list_string.join(" ")); - std::fs::create_dir_all("meshes/")?; - let output=std::process::Command::new("asset-tool") - .args(["download","--cookie-literal","","--output-folder","meshes/"]) - .args(mesh_list_string) - .spawn()? - .wait_with_output()?; - println!("Asset tool exit_success:{}",output.status.success()); +} +fn unique_assets(path:&Path)->AResult{ + // read entire file + let mut assets=UniqueAssets::default(); + let data=read_entire_file(path)?; + let dom=load_dom(data)?; + for object in dom.into_raw().1.into_values(){ + assets.collect(&object); + } + Ok(assets) +} +struct UniqueAssetsResult{ + path:std::path::PathBuf, + result:AResult, +} +fn do_thread(path:std::path::PathBuf,send:std::sync::mpsc::Sender){ + std::thread::spawn(move ||{ + let result=unique_assets(path.as_path()); + send.send(UniqueAssetsResult{ + path, + result, + }).unwrap(); + }); +} +fn download_assets(paths:Vec)->AResult<()>{ Ok(()) } From 6522c255cd93327f279f10ab7eca0c014e7cd3b5 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 4 Feb 2025 09:04:40 -0800 Subject: [PATCH 122/125] remove common --- src/common.rs | 75 --------------------------------------------------- src/main.rs | 3 --- 2 files changed, 78 deletions(-) delete mode 100644 src/common.rs diff --git a/src/common.rs b/src/common.rs deleted file mode 100644 index 95744c9d..00000000 --- a/src/common.rs +++ /dev/null @@ -1,75 +0,0 @@ -use std::path::PathBuf; -use std::io::{Read,Seek}; -use anyhow::Result as AResult; - -fn load_image(input:&mut R)->AResult{ - let mut fourcc=[0u8;4]; - input.read_exact(&mut fourcc)?; - input.rewind()?; - match &fourcc{ - b"\x89PNG"=>Ok(image::load(input,image::ImageFormat::Png)?), - b"\xFF\xD8\xFF\xE0"=>Ok(image::load(input,image::ImageFormat::Jpeg)?),//JFIF - b"Err(anyhow::Error::msg("Roblox xml garbage is not supported yet")), - other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))), - } -} - -fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{ - let mut input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - - let image=load_image(&mut input)?.to_rgba8();//this sets a=255, arcane is actually supposed to look like that - - let format=if image.width()%4!=0||image.height()%4!=0{ - image_dds::ImageFormat::Rgba8UnormSrgb - }else{ - image_dds::ImageFormat::BC7RgbaUnormSrgb - }; - //this fails if the image dimensions are not a multiple of 4 - let dds = image_dds::dds_from_image( - &image, - format, - image_dds::Quality::Slow, - image_dds::Mipmaps::GeneratedAutomatic, - )?; - - //write dds - let mut dest=PathBuf::from("textures"); - dest.push(file_thing.file_name()); - dest.set_extension("dds"); - let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); - dds.write(&mut writer)?; - - //move file to processed - let mut dest=PathBuf::from("textures/processed"); - dest.push(file_thing.file_name()); - std::fs::rename(file_thing.path(), dest)?; - Ok(()) -} -pub fn convert_textures() -> AResult<()>{ - std::fs::create_dir_all("textures/unprocessed")?; - std::fs::create_dir_all("textures/processed")?; - let start = std::time::Instant::now(); - let mut threads=Vec::new(); - for entry in std::fs::read_dir("textures/unprocessed")? { - let file_thing=entry?; - threads.push(std::thread::spawn(move ||{ - let file_name=format!("{:?}",file_thing); - let result=convert(file_thing); - if let Err(e)=result{ - println!("error processing file:{:?} error message:{:?}",file_name,e); - } - })); - } - let mut i=0; - let n_threads=threads.len(); - for thread in threads{ - i+=1; - if let Err(e)=thread.join(){ - println!("thread error: {:?}",e); - }else{ - println!("{}/{}",i,n_threads); - } - } - println!("{:?}", start.elapsed()); - Ok(()) -} diff --git a/src/main.rs b/src/main.rs index e54d7b1c..9b43f9e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -mod common; mod roblox; mod source; @@ -19,7 +18,6 @@ enum Commands{ Roblox(roblox::Commands), #[command(flatten)] Source(source::Commands), - ConvertTextures, } fn main() -> AResult<()> { @@ -27,6 +25,5 @@ fn main() -> AResult<()> { match cli.command{ Commands::Roblox(commands)=>commands.run(), Commands::Source(commands)=>commands.run(), - Commands::ConvertTextures=>common::convert_textures(), } } From ca50bf35c25dc64b8e99ca73db869b39928dca0f Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 4 Feb 2025 09:09:01 -0800 Subject: [PATCH 123/125] loader + tokio rewrite --- Cargo.lock | 1166 ++++++++++++++++++++++++++++++++++++++++++++++--- Cargo.toml | 15 +- src/main.rs | 9 +- src/roblox.rs | 389 ++++++++++++----- src/source.rs | 536 +++++++++++++---------- 5 files changed, 1708 insertions(+), 407 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52092e5c..57718387 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + [[package]] name = "adler2" version = "2.0.0" @@ -15,7 +24,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -36,6 +45,21 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" version = "0.6.18" @@ -72,7 +96,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -83,7 +107,7 @@ checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", "once_cell", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -136,6 +160,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.4.0" @@ -165,6 +195,21 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + [[package]] name = "base64" version = "0.13.1" @@ -172,10 +217,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] -name = "bcdec_rs" -version = "0.1.2" +name = "base64" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9934c2b68e46448d814db20e34a840ef9b4e7b3b7c8b1da91161481230f6350" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bcdec_rs" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09c37bc0e9f0924b7dae9988265ef3c76c88538f41a3b06caf4bed07cee5226" [[package]] name = "beef" @@ -292,9 +343,9 @@ checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bv" @@ -344,10 +395,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] -name = "cc" -version = "1.2.10" +name = "bytes" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" + +[[package]] +name = "cc" +version = "1.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" dependencies = [ "jobserver", "libc", @@ -380,6 +437,21 @@ dependencies = [ "num-traits", ] +[[package]] +name = "chrono" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets", +] + [[package]] name = "clap" version = "4.5.27" @@ -438,6 +510,22 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "crc" version = "3.2.1" @@ -522,6 +610,15 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "enum-primitive-derive" version = "0.2.2" @@ -553,6 +650,16 @@ dependencies = [ "synstructure 0.12.6", ] +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "exr" version = "1.73.0" @@ -568,6 +675,12 @@ dependencies = [ "zune-inflate", ] +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + [[package]] name = "fdeflate" version = "0.3.7" @@ -585,9 +698,9 @@ checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" [[package]] name = "fixed_wide" -version = "0.1.1" +version = "0.1.2" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "d9c2cf115b3785ede870fada07e8b1aeba3378345b4ca86fe3c772ecabc05c0f" +checksum = "a7e01a5b738e313c912fc41c425cf36e10c51647d3fd21d96db3d616344549fa" dependencies = [ "arrayvec", "bnum", @@ -611,6 +724,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -620,6 +748,95 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -628,7 +845,19 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", ] [[package]] @@ -641,12 +870,37 @@ dependencies = [ "weezl", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "glam" version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc46dd3ec48fdd8e693a98d2b8bafae273a2d54c1de02a2a7e3d57d501f39677" +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -676,6 +930,141 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "http" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "icu_collections" version = "1.5.0" @@ -861,9 +1250,9 @@ dependencies = [ [[package]] name = "image_dds" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c6d1a2d80bc7dd2928b2a72a46d71bccbb6becf8ce207522b0b92daf0a417f" +checksum = "550c3f4c985c41d96aa133651aa1a3dbd54961c28a68aca574487fe8bbdda6fb" dependencies = [ "bcdec_rs", "bytemuck", @@ -872,7 +1261,7 @@ dependencies = [ "image", "intel_tex_2", "strum", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -911,6 +1300,12 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -945,6 +1340,12 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + [[package]] name = "jobserver" version = "0.1.32" @@ -960,6 +1361,16 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + [[package]] name = "lazy-regex" version = "3.4.1" @@ -1003,9 +1414,9 @@ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libfuzzer-sys" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b9569d2f74e257076d8c6bfa73fb505b46b851e51ddaecc825944aa3bed17fa" +checksum = "cf78f52d400cf2d84a3a973a78a592b4adc535739e0a5597a0da6f0c357adc75" dependencies = [ "arbitrary", "cc", @@ -1038,6 +1449,12 @@ dependencies = [ "ratio_ops", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + [[package]] name = "litemap" version = "0.7.4" @@ -1104,9 +1521,9 @@ dependencies = [ [[package]] name = "luau0-src" -version = "0.11.2+luau653" +version = "0.12.0+luau657" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02313a53daf1fae25e82f7e7ca56180b72d1f08c514426672877cd957298201c" +checksum = "3a4b4c16b82ddf60e0fa93ca5a6afc504a6db22310cc82ecec629cd2e405b2ca" dependencies = [ "cc", ] @@ -1156,17 +1573,22 @@ dependencies = [ "anyhow", "clap", "flate2", + "futures", "image", "image_dds", "lazy-regex", + "rbx_asset", "rbx_binary", "rbx_dom_weak", "rbx_reflection_database", "rbx_xml", + "rbxassetid", "strafesnet_bsp_loader", "strafesnet_deferred_loader", "strafesnet_rbx_loader", "strafesnet_snf", + "thiserror 2.0.11", + "tokio", "vbsp", "vmdl", "vmt-parser", @@ -1198,7 +1620,7 @@ checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" dependencies = [ "cfg-if", "miette-derive", - "thiserror", + "thiserror 1.0.69", "unicode-width", ] @@ -1213,6 +1635,22 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1230,10 +1668,21 @@ dependencies = [ ] [[package]] -name = "mlua" -version = "0.10.2" +name = "mio" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea43c3ffac2d0798bd7128815212dd78c98316b299b7a902dabef13dc7b6b8d" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "mlua" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3f763c1041eff92ffb5d7169968a327e1ed2ebfe425dac0ee5a35f29082534b" dependencies = [ "bstr", "either", @@ -1246,9 +1695,9 @@ dependencies = [ [[package]] name = "mlua-sys" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a11d485edf0f3f04a508615d36c7d50d299cf61a7ee6d3e2530651e0a31771" +checksum = "1901c1a635a22fe9250ffcc4fcc937c16b47c2e9e71adba8784af8bca1f69594" dependencies = [ "cc", "cfg-if", @@ -1256,6 +1705,23 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "native-tls" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -1359,12 +1825,65 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "openssl" +version = "0.10.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" +dependencies = [ + "bitflags 2.8.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "owo-colors" version = "3.5.0" @@ -1504,6 +2023,12 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" version = "0.3.31" @@ -1644,7 +2169,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -1683,7 +2208,7 @@ dependencies = [ "rand_chacha", "simd_helpers", "system-deps", - "thiserror", + "thiserror 1.0.69", "v_frame", "wasm-bindgen", ] @@ -1723,6 +2248,20 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rbx_asset" +version = "0.2.5" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "dcf243f46bd41b3880a27278177a3f9996f95ab231d9a04345ad9dd381c3a54a" +dependencies = [ + "chrono", + "flate2", + "reqwest", + "serde", + "serde_json", + "url", +] + [[package]] name = "rbx_binary" version = "0.7.4" @@ -1735,7 +2274,7 @@ dependencies = [ "rbx_dom_weak", "rbx_reflection", "rbx_reflection_database", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1750,9 +2289,9 @@ dependencies = [ [[package]] name = "rbx_mesh" -version = "0.1.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864ead0e98afce28c960f653d6203483834890d07f87b60e2f01415530a2fe9d" +checksum = "36372fd7feb6d3c5780d2ada39d1397be9e196ddfbb23ba1d84e7a75cf790adb" dependencies = [ "binrw 0.14.1", "lazy-regex", @@ -1766,7 +2305,7 @@ checksum = "c1b43fe592a4ce6fe54eb215fb82735efbb516d2cc045a94e3dc0234ff293620" dependencies = [ "rbx_types", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1787,13 +2326,13 @@ version = "1.10.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" checksum = "d7a390c44034fa448c53bd0983dfc2d70d8d6b2f65be4f164d4bec8b6a2a2d09" dependencies = [ - "base64", + "base64 0.13.1", "bitflags 1.3.2", "blake3", "lazy_static", "rand", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1802,7 +2341,7 @@ version = "0.13.3" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" checksum = "d6d1a15f58a1e4b4f578abe6eb5e1461cb16eea82fb4a147d5995c9b79f08d1f" dependencies = [ - "base64", + "base64 0.13.1", "log", "rbx_dom_weak", "rbx_reflection", @@ -1810,6 +2349,15 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "rbxassetid" +version = "0.1.0" +source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" +checksum = "e6821fe9eaff54cd142932cb04c612b7599d9b8586973145b7ec1230ae84d184" +dependencies = [ + "url", +] + [[package]] name = "redox_syscall" version = "0.5.8" @@ -1848,12 +2396,72 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "reqwest" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + [[package]] name = "rgb" version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.15", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "rmp" version = "0.8.14" @@ -1878,9 +2486,9 @@ dependencies = [ [[package]] name = "roblox_emulator" -version = "0.4.6" +version = "0.4.7" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "03e2535327bd9069b20caa9df0a5cac87fa886cd2418c7f174016502d584a488" +checksum = "7fc98335ce4b8548b725d727c5b32bd0b38274606c48fce6b6e7e5807d94db6b" dependencies = [ "glam", "mlua", @@ -1891,24 +2499,120 @@ dependencies = [ "rbx_types", ] +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + [[package]] name = "rustc-hash" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.8.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.8.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "serde" version = "1.0.217" @@ -1929,6 +2633,18 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "serde_json" +version = "1.0.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.19" @@ -1949,6 +2665,18 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1976,12 +2704,37 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1996,21 +2749,23 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strafesnet_bsp_loader" -version = "0.2.2" +version = "0.3.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "34f944637bc3b3ed4c430819c672174b3a3edfd51f79b6b87f4931e3714a398e" +checksum = "3cc98773f2b98eb708b098946870b769975b63a396b84698b67e3d968029005d" dependencies = [ "glam", "strafesnet_common", + "strafesnet_deferred_loader", "vbsp", "vmdl", + "vpk", ] [[package]] name = "strafesnet_common" -version = "0.5.2" +version = "0.6.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "91cc1f3699bd8248da18bf5d11273264396a257b5d47b8558acb2cb4e1761219" +checksum = "0c1d7a83e1f6b579c6a9b4dc70c92373ab53b938601cd75928dd6795b5ffef21" dependencies = [ "arrayvec", "bitflags 2.8.0", @@ -2023,20 +2778,18 @@ dependencies = [ [[package]] name = "strafesnet_deferred_loader" -version = "0.4.1" +version = "0.5.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "cb47034893e945c640063a6c0fb09c6186dcc9f0b221b8c41f5a22070fe430f4" +checksum = "63d5d48e587d5f8bf5385bee3505ed790727fef68de855cf58247a08c5952bef" dependencies = [ "strafesnet_common", - "url", - "vbsp", ] [[package]] name = "strafesnet_rbx_loader" -version = "0.5.2" +version = "0.6.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "bb852ee329d26410daee50f1e583ea8286caf6a81a42ff887b78f21477c48731" +checksum = "e4659a49128c8d12b9fbdb289969cae04bfc5c1750d4273897700c5c17730d8a" dependencies = [ "bytemuck", "glam", @@ -2046,15 +2799,17 @@ dependencies = [ "rbx_mesh", "rbx_reflection_database", "rbx_xml", + "rbxassetid", "roblox_emulator", "strafesnet_common", + "strafesnet_deferred_loader", ] [[package]] name = "strafesnet_snf" -version = "0.2.0" +version = "0.3.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "c6e8856d79c29bd5687b08bc1653370f7e242c84d5c06afa8629bd3e00c433bf" +checksum = "fd24a22c484ca04213fa44b1d34bfbec385f0d176a2b5829cfa59ba7987b80d5" dependencies = [ "binrw 0.14.1", "id", @@ -2112,6 +2867,12 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "syn" version = "1.0.109" @@ -2134,6 +2895,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -2157,6 +2927,27 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.8.0", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "system-deps" version = "6.2.2" @@ -2176,6 +2967,20 @@ version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +[[package]] +name = "tempfile" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom 0.3.1", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + [[package]] name = "texpresso" version = "2.0.1" @@ -2191,7 +2996,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -2205,6 +3019,17 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "tiff" version = "0.9.1" @@ -2226,6 +3051,66 @@ dependencies = [ "zerovec", ] +[[package]] +name = "tokio" +version = "1.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.8.19" @@ -2249,9 +3134,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" dependencies = [ "indexmap", "serde", @@ -2260,6 +3145,33 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + [[package]] name = "tracing" version = "0.1.41" @@ -2292,10 +3204,22 @@ dependencies = [ ] [[package]] -name = "unicode-ident" -version = "1.0.15" +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-width" @@ -2309,6 +3233,12 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.5.4" @@ -2366,11 +3296,17 @@ dependencies = [ "num_enum", "serde", "static_assertions", - "thiserror", + "thiserror 1.0.69", "vdf-reader", "zip-lzma", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "vdf-reader" version = "0.2.0" @@ -2381,7 +3317,7 @@ dependencies = [ "miette", "parse-display 0.9.1", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2410,7 +3346,7 @@ dependencies = [ "itertools 0.13.0", "num_enum", "static_assertions", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -2423,7 +3359,7 @@ dependencies = [ "miette", "serde", "serde_repr", - "thiserror", + "thiserror 1.0.69", "vdf-reader", ] @@ -2435,7 +3371,7 @@ checksum = "60ec10e731515f58d5494d472f027d9c6fc8500fcb790ff55751031bcad87b6b" dependencies = [ "ahash", "binrw 0.13.3", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2452,12 +3388,30 @@ dependencies = [ "texpresso", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -2484,6 +3438,19 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.100" @@ -2516,12 +3483,70 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "weezl" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.59.0" @@ -2597,13 +3622,22 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.24" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419" dependencies = [ "memchr", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "write16" version = "1.0.0" @@ -2688,6 +3722,12 @@ dependencies = [ "synstructure 0.13.1", ] +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + [[package]] name = "zerovec" version = "0.10.4" diff --git a/Cargo.toml b/Cargo.toml index 30891111..ac3282f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,17 +9,22 @@ edition = "2021" anyhow = "1.0.75" clap = { version = "4.4.2", features = ["derive"] } flate2 = "1.0.27" +futures = "0.3.31" image = "0.25.2" -image_dds = "0.6.0" +image_dds = "0.7.1" lazy-regex = "3.1.0" +rbx_asset = { version = "0.2.5", registry = "strafesnet" } rbx_binary = { version = "0.7.4", registry = "strafesnet" } rbx_dom_weak = { version = "2.7.0", registry = "strafesnet" } rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" } rbx_xml = { version = "0.13.3", registry = "strafesnet" } -strafesnet_bsp_loader = { version = "0.2.1", registry = "strafesnet" } -strafesnet_deferred_loader = { version = "0.4.0", features = ["legacy"], registry = "strafesnet" } -strafesnet_rbx_loader = { version = "0.5.1", registry = "strafesnet" } -strafesnet_snf = { version = "0.2.0", registry = "strafesnet" } +rbxassetid = { version = "0.1.0", registry = "strafesnet" } +strafesnet_bsp_loader = { version = "0.3.0", registry = "strafesnet" } +strafesnet_deferred_loader = { version = "0.5.0", registry = "strafesnet" } +strafesnet_rbx_loader = { version = "0.6.0", registry = "strafesnet" } +strafesnet_snf = { version = "0.3.0", registry = "strafesnet" } +thiserror = "2.0.11" +tokio = { version = "1.43.0", features = ["macros", "rt-multi-thread", "fs"] } vbsp = "0.6.0" vmdl = "0.2.0" vmt-parser = "0.2.0" diff --git a/src/main.rs b/src/main.rs index 9b43f9e3..da5352b6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,10 +20,11 @@ enum Commands{ Source(source::Commands), } -fn main() -> AResult<()> { - let cli = Cli::parse(); +#[tokio::main] +async fn main()->AResult<()>{ + let cli=Cli::parse(); match cli.command{ - Commands::Roblox(commands)=>commands.run(), - Commands::Source(commands)=>commands.run(), + Commands::Roblox(commands)=>commands.run().await, + Commands::Source(commands)=>commands.run().await, } } diff --git a/src/roblox.rs b/src/roblox.rs index b22b62fd..da2c0d11 100644 --- a/src/roblox.rs +++ b/src/roblox.rs @@ -4,7 +4,11 @@ use std::collections::HashSet; use clap::{Args,Subcommand}; use anyhow::Result as AResult; use rbx_dom_weak::Instance; -use strafesnet_deferred_loader::rbxassetid::RobloxAssetId; +use strafesnet_deferred_loader::deferred_loader::LoadFailureMode; +use rbxassetid::RobloxAssetId; +use tokio::io::AsyncReadExt; + +const DOWNLOAD_LIMIT:usize=16; #[derive(Subcommand)] pub enum Commands{ @@ -21,27 +25,40 @@ pub struct RobloxToSNFSubcommand { } #[derive(Args)] pub struct DownloadAssetsSubcommand{ - #[arg(long,required=true)] - roblox_files:Vec + #[arg(required=true)] + roblox_files:Vec, + // #[arg(long)] + // cookie_file:Option, } impl Commands{ - pub fn run(self)->AResult<()>{ + pub async fn run(self)->AResult<()>{ match self{ - Commands::RobloxToSNF(subcommand)=>roblox_to_snf(subcommand.input_files,subcommand.output_folder), - Commands::DownloadAssets(subcommand)=>download_assets(subcommand.roblox_files), + Commands::RobloxToSNF(subcommand)=>roblox_to_snf(subcommand.input_files,subcommand.output_folder).await, + Commands::DownloadAssets(subcommand)=>download_assets( + subcommand.roblox_files, + rbx_asset::cookie::Cookie::new("".to_string()), + ).await, } } } -fn load_dom(mut input:R)->AResult{ +#[allow(unused)] +#[derive(Debug)] +enum LoadDomError{ + IO(std::io::Error), + Binary(rbx_binary::DecodeError), + Xml(rbx_xml::DecodeError), + UnknownFormat, +} +fn load_dom(mut input:R)->Result{ let mut first_8=[0u8;8]; - input.read_exact(&mut first_8)?; - input.rewind()?; + input.read_exact(&mut first_8).map_err(LoadDomError::IO)?; + input.rewind().map_err(LoadDomError::IO)?; match &first_8{ - b"rbx_binary::from_reader(input).map_err(anyhow::Error::msg), - b"rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(anyhow::Error::msg), - _=>Err(anyhow::Error::msg("unsupported file type")), + b"rbx_binary::from_reader(input).map_err(LoadDomError::Binary), + b"rbx_xml::from_reader(input,rbx_xml::DecodeOptions::default()).map_err(LoadDomError::Xml), + _=>Err(LoadDomError::UnknownFormat), } } @@ -80,13 +97,13 @@ fn accumulate_content_id(content_list:&mut HashSet,object:&Instan println!("Content failed to parse into AssetID: {:?}",content); } }else{ - println!("property={} does not exist for class={}",object.class.as_str(),property); + println!("property={} does not exist for class={}",property,object.class.as_str()); } } -fn read_entire_file(path:impl AsRef)->Result>,std::io::Error>{ - let mut file=std::fs::File::open(path)?; +async fn read_entire_file(path:impl AsRef)->Result>,std::io::Error>{ + let mut file=tokio::fs::File::open(path).await?; let mut data=Vec::new(); - file.read_to_end(&mut data)?; + file.read_to_end(&mut data).await?; Ok(Cursor::new(data)) } #[derive(Default)] @@ -123,30 +140,232 @@ impl UniqueAssets{ } } } -fn unique_assets(path:&Path)->AResult{ + +#[allow(unused)] +#[derive(Debug)] +enum UniqueAssetError{ + IO(std::io::Error), + LoadDom(LoadDomError), +} +async fn unique_assets(path:&Path)->Result{ // read entire file let mut assets=UniqueAssets::default(); - let data=read_entire_file(path)?; - let dom=load_dom(data)?; + let data=read_entire_file(path).await.map_err(UniqueAssetError::IO)?; + let dom=load_dom(data).map_err(UniqueAssetError::LoadDom)?; for object in dom.into_raw().1.into_values(){ assets.collect(&object); } Ok(assets) } -struct UniqueAssetsResult{ - path:std::path::PathBuf, - result:AResult, +enum DownloadType{ + Texture(RobloxAssetId), + Mesh(RobloxAssetId), + Union(RobloxAssetId), } -fn do_thread(path:std::path::PathBuf,send:std::sync::mpsc::Sender){ - std::thread::spawn(move ||{ - let result=unique_assets(path.as_path()); - send.send(UniqueAssetsResult{ - path, - result, - }).unwrap(); +impl DownloadType{ + fn path(&self)->PathBuf{ + match self{ + DownloadType::Texture(asset_id)=>format!("downloaded_textures/{}",asset_id.0.to_string()).into(), + DownloadType::Mesh(asset_id)=>format!("meshes/{}",asset_id.0.to_string()).into(), + DownloadType::Union(asset_id)=>format!("unions/{}",asset_id.0.to_string()).into(), + } + } + fn asset_id(&self)->u64{ + match self{ + DownloadType::Texture(asset_id)=>asset_id.0, + DownloadType::Mesh(asset_id)=>asset_id.0, + DownloadType::Union(asset_id)=>asset_id.0, + } + } +} +enum DownloadResult{ + Cached(PathBuf), + Data(Vec), + Failed, +} +#[derive(Default,Debug)] +struct Stats{ + total_assets:u32, + cached_assets:u32, + downloaded_assets:u32, + failed_downloads:u32, + timed_out_downloads:u32, +} +async fn download_retry(stats:&mut Stats,context:&rbx_asset::cookie::CookieContext,download_instruction:DownloadType)->Result{ + stats.total_assets+=1; + let download_instruction=download_instruction; + // check if file exists on disk + let path=download_instruction.path(); + if tokio::fs::try_exists(path.as_path()).await?{ + stats.cached_assets+=1; + return Ok(DownloadResult::Cached(path)); + } + let asset_id=download_instruction.asset_id(); + // if not, download file + let mut retry=0; + const BACKOFF_MUL:f32=1.3956124250860895286;//exp(1/3) + let mut backoff=1000f32; + loop{ + let asset_result=context.get_asset(rbx_asset::cookie::GetAssetRequest{ + asset_id, + version:None, + }).await; + match asset_result{ + Ok(asset_result)=>{ + stats.downloaded_assets+=1; + tokio::fs::write(path,&asset_result).await?; + break Ok(DownloadResult::Data(asset_result)); + }, + Err(rbx_asset::cookie::GetError::Response(rbx_asset::ResponseError::StatusCodeWithUrlAndBody(scwuab)))=>{ + if scwuab.status_code.as_u16()==429{ + if retry==12{ + println!("Giving up asset download {asset_id}"); + stats.timed_out_downloads+=1; + break Ok(DownloadResult::Failed); + } + println!("Hit roblox rate limit, waiting {:.0}ms...",backoff); + tokio::time::sleep(std::time::Duration::from_millis(backoff as u64)).await; + backoff*=BACKOFF_MUL; + retry+=1; + }else{ + stats.failed_downloads+=1; + println!("weird scuwab error: {scwuab:?}"); + break Ok(DownloadResult::Failed); + } + }, + Err(e)=>{ + stats.failed_downloads+=1; + println!("sadly error: {e}"); + break Ok(DownloadResult::Failed); + }, + } + } +} +#[derive(Debug,thiserror::Error)] +enum ConvertTextureError{ + #[error("Io error {0:?}")] + Io(#[from]std::io::Error), + #[error("Image error {0:?}")] + Image(#[from]image::ImageError), + #[error("DDS create error {0:?}")] + DDS(#[from]image_dds::CreateDdsError), + #[error("DDS write error {0:?}")] + DDSWrite(#[from]image_dds::ddsfile::Error), +} +async fn convert_texture(asset_id:RobloxAssetId,download_result:DownloadResult)->Result<(),ConvertTextureError>{ + let data=match download_result{ + DownloadResult::Cached(path)=>tokio::fs::read(path).await?, + DownloadResult::Data(data)=>data, + DownloadResult::Failed=>return Ok(()), + }; + // image::ImageFormat::Png + // image::ImageFormat::Jpeg + let image=image::load_from_memory(&data)?.to_rgba8(); + + // pick format + let format=if image.width()%4!=0||image.height()%4!=0{ + image_dds::ImageFormat::Rgba8UnormSrgb + }else{ + image_dds::ImageFormat::BC7RgbaUnormSrgb + }; + + //this fails if the image dimensions are not a multiple of 4 + let dds=image_dds::dds_from_image( + &image, + format, + image_dds::Quality::Slow, + image_dds::Mipmaps::GeneratedAutomatic, + )?; + + let file_name=format!("textures/{}.dds",asset_id.0); + let mut file=std::fs::File::create(file_name)?; + dds.write(&mut file)?; + Ok(()) +} +async fn download_assets(paths:Vec,cookie:rbx_asset::cookie::Cookie)->AResult<()>{ + tokio::try_join!( + tokio::fs::create_dir_all("downloaded_textures"), + tokio::fs::create_dir_all("textures"), + tokio::fs::create_dir_all("meshes"), + tokio::fs::create_dir_all("unions"), + )?; + // use mpsc + let thread_limit=std::thread::available_parallelism()?.get(); + let (send_assets,mut recv_assets)=tokio::sync::mpsc::channel(DOWNLOAD_LIMIT); + let (send_texture,mut recv_texture)=tokio::sync::mpsc::channel(thread_limit); + // map decode dispatcher + // read files multithreaded + // produce UniqueAssetsResult per file + tokio::spawn(async move{ + // move send so it gets dropped when all maps have been decoded + // closing the channel + let mut it=paths.into_iter(); + static SEM:tokio::sync::Semaphore=tokio::sync::Semaphore::const_new(0); + SEM.add_permits(thread_limit); + while let (Ok(permit),Some(path))=(SEM.acquire().await,it.next()){ + let send=send_assets.clone(); + tokio::spawn(async move{ + let result=unique_assets(path.as_path()).await; + _=send.send(result).await; + drop(permit); + }); + } }); -} -fn download_assets(paths:Vec)->AResult<()>{ + // download manager + // insert into global unique assets guy + // add to download queue if the asset is globally unique and does not already exist on disk + let mut stats=Stats::default(); + let context=rbx_asset::cookie::CookieContext::new(cookie); + let mut globally_unique_assets=UniqueAssets::default(); + // pop a job = retry_queue.pop_front() or ingest(recv.recv().await) + // SLOW MODE: + // acquire all permits + // drop all permits + // pop one job + // if it succeeds go into fast mode + // FAST MODE: + // acquire one permit + // pop a job + let download_thread=tokio::spawn(async move{ + while let Some(result)=recv_assets.recv().await{ + let unique_assets=match result{ + Ok(unique_assets)=>unique_assets, + Err(e)=>{ + println!("error: {e:?}"); + continue; + }, + }; + for texture_id in unique_assets.textures{ + if globally_unique_assets.textures.insert(texture_id){ + let data=download_retry(&mut stats,&context,DownloadType::Texture(texture_id)).await?; + send_texture.send((texture_id,data)).await?; + } + } + for mesh_id in unique_assets.meshes{ + if globally_unique_assets.meshes.insert(mesh_id){ + download_retry(&mut stats,&context,DownloadType::Mesh(mesh_id)).await?; + } + } + for union_id in unique_assets.unions{ + if globally_unique_assets.unions.insert(union_id){ + download_retry(&mut stats,&context,DownloadType::Union(union_id)).await?; + } + } + } + dbg!(stats); + Ok::<(),anyhow::Error>(()) + }); + static SEM:tokio::sync::Semaphore=tokio::sync::Semaphore::const_new(0); + SEM.add_permits(thread_limit); + while let (Ok(permit),Some((asset_id,download_result)))=(SEM.acquire().await,recv_texture.recv().await){ + tokio::spawn(async move{ + let result=convert_texture(asset_id,download_result).await; + drop(permit); + result.unwrap(); + }); + } + download_thread.await??; + _=SEM.acquire_many(thread_limit as u32).await.unwrap(); Ok(()) } @@ -155,7 +374,8 @@ fn download_assets(paths:Vec)->AResult<()>{ enum ConvertError{ IO(std::io::Error), SNFMap(strafesnet_snf::map::Error), - RbxLoader(strafesnet_rbx_loader::ReadError), + RobloxRead(strafesnet_rbx_loader::ReadError), + RobloxLoad(strafesnet_rbx_loader::LoadError), } impl std::fmt::Display for ConvertError{ fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ @@ -163,78 +383,49 @@ impl std::fmt::Display for ConvertError{ } } impl std::error::Error for ConvertError{} +async fn convert_to_snf(path:&Path,output_folder:PathBuf)->AResult<()>{ + let entire_file=tokio::fs::read(path).await?; -type MapThread=std::thread::JoinHandle>; + let model=strafesnet_rbx_loader::read( + std::io::Cursor::new(entire_file) + ).map_err(ConvertError::RobloxRead)?; -fn roblox_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ - let n_paths=pathlist.len(); - let start = std::time::Instant::now(); - let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); - let mut i=0; - let mut join_thread=|thread:MapThread|{ - i+=1; - if let Err(e)=thread.join(){ - println!("thread error: {:?}",e); - }else{ - println!("{}/{}",i,n_paths); - } - }; - for path in pathlist{ - if 32<=threads.len(){ - join_thread(threads.pop_front().unwrap()); - } - let output_folder=output_folder.clone(); - threads.push_back(std::thread::spawn(move ||{ - let model=strafesnet_rbx_loader::read( - std::fs::File::open(path.as_path()) - .map_err(ConvertError::IO)? - ).map_err(ConvertError::RbxLoader)?; + let mut place=model.into_place(); + place.run_scripts(); - let mut place=model.into_place(); - place.run_scripts(); + let map=place.to_snf(LoadFailureMode::DefaultToNone).map_err(ConvertError::RobloxLoad)?; - let mut loader=strafesnet_deferred_loader::roblox_legacy(); + let mut dest=output_folder; + dest.push(path.file_stem().unwrap()); + dest.set_extension("snfm"); + let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; - let (texture_loader,mesh_loader)=loader.get_inner_mut(); + strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; - let map_step1=strafesnet_rbx_loader::convert( - &place, - |name|texture_loader.acquire_render_config_id(name), - |name|mesh_loader.acquire_mesh_id(name), - ); - - let meshpart_meshes=mesh_loader.load_meshes().map_err(ConvertError::IO)?; - - let map_step2=map_step1.add_meshpart_meshes_and_calculate_attributes( - meshpart_meshes.into_iter().map(|(mesh_id,loader_model)| - (mesh_id,strafesnet_rbx_loader::data::RobloxMeshBytes::new(loader_model.get())) - ) - ); - - let (textures,render_configs)=loader.into_render_configs().map_err(ConvertError::IO)?.consume(); - - let map=map_step2.add_render_configs_and_textures( - render_configs.into_iter(), - textures.into_iter().map(|(texture_id,texture)| - (texture_id,match texture{ - strafesnet_deferred_loader::texture::Texture::ImageDDS(data)=>data, - }) - ) - ); - - let mut dest=output_folder.clone(); - dest.push(path.file_stem().unwrap()); - dest.set_extension("snfm"); - let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; - - strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; - Ok(()) - })); - } - - for thread in threads{ - join_thread(thread); - } - println!("{:?}", start.elapsed()); + Ok(()) +} + +async fn roblox_to_snf(paths:Vec,output_folder:PathBuf)->AResult<()>{ + let start=std::time::Instant::now(); + + let thread_limit=std::thread::available_parallelism()?.get(); + let mut it=paths.into_iter(); + static SEM:tokio::sync::Semaphore=tokio::sync::Semaphore::const_new(0); + SEM.add_permits(thread_limit); + + while let (Ok(permit),Some(path))=(SEM.acquire().await,it.next()){ + let output_folder=output_folder.clone(); + tokio::spawn(async move{ + let result=convert_to_snf(path.as_path(),output_folder).await; + drop(permit); + match result{ + Ok(())=>(), + Err(e)=>println!("Convert error: {e:?}"), + } + }); + } + _=SEM.acquire_many(thread_limit as u32).await.unwrap(); + + println!("elapsed={:?}", start.elapsed()); Ok(()) } diff --git a/src/source.rs b/src/source.rs index 1d0f803c..5fcecea7 100644 --- a/src/source.rs +++ b/src/source.rs @@ -1,6 +1,11 @@ -use std::path::PathBuf; +use std::path::{Path,PathBuf}; +use std::borrow::Cow; use clap::{Args,Subcommand}; use anyhow::Result as AResult; +use futures::StreamExt; +use strafesnet_bsp_loader::loader::BspFinder; +use strafesnet_deferred_loader::loader::Loader; +use strafesnet_deferred_loader::deferred_loader::{LoadFailureMode,MeshDeferredLoader,RenderConfigDeferredLoader}; #[derive(Subcommand)] pub enum Commands{ @@ -16,13 +21,15 @@ pub struct SourceToSNFSubcommand { output_folder:PathBuf, #[arg(required=true)] input_files:Vec, + #[arg(long)] + vpks:Vec, } #[derive(Args)] -pub struct ExtractTexturesSubcommand { +pub struct ExtractTexturesSubcommand{ + #[arg(required=true)] + bsp_files:Vec, #[arg(long)] - bsp_file:PathBuf, - #[arg(long)] - vpk_dir_files:Vec + vpks:Vec, } #[derive(Args)] pub struct VPKContentsSubcommand { @@ -36,10 +43,10 @@ pub struct BSPContentsSubcommand { } impl Commands{ - pub fn run(self)->AResult<()>{ + pub async fn run(self)->AResult<()>{ match self{ - Commands::SourceToSNF(subcommand)=>source_to_snf(subcommand.input_files,subcommand.output_folder), - Commands::ExtractTextures(subcommand)=>extract_textures(vec![subcommand.bsp_file],subcommand.vpk_dir_files), + Commands::SourceToSNF(subcommand)=>source_to_snf(subcommand.input_files,subcommand.output_folder,subcommand.vpks).await, + Commands::ExtractTextures(subcommand)=>extract_textures(subcommand.bsp_files,subcommand.vpks).await, Commands::VPKContents(subcommand)=>vpk_contents(subcommand.input_file), Commands::BSPContents(subcommand)=>bsp_contents(subcommand.input_file), } @@ -63,9 +70,9 @@ impl VMTContent{ } } -fn get_some_texture(material:vmt_parser::material::Material)->AResult{ +fn get_some_texture(material:vmt_parser::material::Material)->VMTContent{ //just grab some texture from somewhere for now - Ok(match material{ + match material{ vmt_parser::material::Material::LightMappedGeneric(mat)=>VMTContent::vtf(Some(mat.base_texture)), vmt_parser::material::Material::VertexLitGeneric(mat)=>VMTContent::vtf(mat.base_texture.or(mat.decal_texture)),//this just dies if there is none vmt_parser::material::Material::VertexLitGenericDx6(mat)=>VMTContent::vtf(mat.base_texture.or(mat.decal_texture)), @@ -84,175 +91,258 @@ fn get_some_texture(material:vmt_parser::material::Material)->AResultVMTContent::vtf(Some(mat.base_texture)), vmt_parser::material::Material::Replacements(_mat)=>VMTContent::Unsupported, vmt_parser::material::Material::Patch(mat)=>VMTContent::Patch(mat), - _=>return Err(anyhow::Error::msg("vmt failed to parse")), - }) -} - -fn get_vmtAResult>>>(find_stuff:&F,search_name:String)->AResult{ - if let Some(stuff)=find_stuff(search_name)?{ - //decode vmt and then write - let stuff=String::from_utf8(stuff)?; - let material=vmt_parser::from_str(stuff.as_str())?; - println!("vmt material={:?}",material); - return Ok(material); + _=>unreachable!(), } - Err(anyhow::Error::msg("vmt not found")) } -fn recursive_vmt_loaderAResult>>>(find_stuff:&F,material:vmt_parser::material::Material)->AResult>>{ - match get_some_texture(material)?{ - VMTContent::VMT(s)=>recursive_vmt_loader(find_stuff,get_vmt(find_stuff,s)?), +#[derive(Debug,thiserror::Error)] +enum GetVMTError{ + #[error("Bsp error {0:?}")] + Bsp(#[from]vbsp::BspError), + #[error("Utf8 error {0:?}")] + Utf8(#[from]std::str::Utf8Error), + #[error("Vdf error {0:?}")] + Vdf(#[from]vmt_parser::VdfError), + #[error("Vmt not found")] + NotFound, +} + +fn get_vmt(finder:BspFinder,search_name:&str)->Result{ + let vmt_data=finder.find(search_name)?.ok_or(GetVMTError::NotFound)?; + //decode vmt and then write + let vmt_str=core::str::from_utf8(&vmt_data)?; + let material=vmt_parser::from_str(vmt_str)?; + //println!("vmt material={:?}",material); + Ok(material) +} + +#[derive(Debug,thiserror::Error)] +enum LoadVMTError{ + #[error("Bsp error {0:?}")] + Bsp(#[from]vbsp::BspError), + #[error("GetVMT error {0:?}")] + GetVMT(#[from]GetVMTError), + #[error("FromUtf8 error {0:?}")] + FromUtf8(#[from]std::string::FromUtf8Error), + #[error("Vdf error {0:?}")] + Vdf(#[from]vmt_parser::VdfError), + #[error("Vmt unsupported")] + Unsupported, + #[error("Vmt unresolved")] + Unresolved, + #[error("Vmt not found")] + NotFound, +} +fn recursive_vmt_loader<'bsp,'vpk,'a>(finder:BspFinder<'bsp,'vpk>,material:vmt_parser::material::Material)->Result>,LoadVMTError> + where + 'bsp:'a, + 'vpk:'a, +{ + match get_some_texture(material){ + VMTContent::VMT(s)=>recursive_vmt_loader(finder,get_vmt(finder,s.as_str())?), VMTContent::VTF(s)=>{ let mut texture_file_name=PathBuf::from("materials"); texture_file_name.push(s); texture_file_name.set_extension("vtf"); - find_stuff(texture_file_name.into_os_string().into_string().unwrap()) + Ok(finder.find(texture_file_name.to_str().unwrap())?) }, - VMTContent::Patch(mat)=>recursive_vmt_loader(find_stuff, - mat.resolve(|search_name|{ - match find_stuff(search_name.to_string())?{ - Some(bytes)=>Ok(String::from_utf8(bytes)?), - None=>Err(anyhow::Error::msg("could not find vmt")), + VMTContent::Patch(mat)=>recursive_vmt_loader(finder, + mat.resolve(|search_name| + match finder.find(search_name)?{ + Some(bytes)=>Ok(String::from_utf8(bytes.into_owned())?), + None=>Err(LoadVMTError::NotFound), } - })? + )? ), - VMTContent::Unsupported=>{println!("Unsupported vmt");Ok(None)},//print and move on - VMTContent::Unresolved=>{println!("Unresolved vmt");Ok(None)}, + VMTContent::Unsupported=>Err(LoadVMTError::Unsupported), + VMTContent::Unresolved=>Err(LoadVMTError::Unresolved), } } - -fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ - std::fs::create_dir_all("textures")?; - let vpk_list:Vec=vpk_paths.into_iter().map(|vpk_path|vpk::VPK::read(&vpk_path).expect("vpk file does not exist")).collect(); - for path in paths{ - let mut deduplicate=std::collections::HashSet::new(); - let bsp=vbsp::Bsp::read(std::fs::read(path)?.as_ref())?; - for texture in bsp.textures(){ - deduplicate.insert(PathBuf::from(texture.name())); - } - //dedupe prop models - let mut model_dedupe=std::collections::HashSet::new(); - for prop in bsp.static_props(){ - model_dedupe.insert(prop.model()); - } - - //grab texture names from props - for model_name in model_dedupe{ - //.mdl, .vvd, .dx90.vtx - let mut path=PathBuf::from(model_name); - let file_name=PathBuf::from(path.file_stem().unwrap()); - path.pop(); - path.push(file_name); - let mut vvd_path=path.clone(); - let mut vtx_path=path.clone(); - vvd_path.set_extension("vvd"); - vtx_path.set_extension("dx90.vtx"); - match (bsp.pack.get(model_name),bsp.pack.get(vvd_path.as_os_str().to_str().unwrap()),bsp.pack.get(vtx_path.as_os_str().to_str().unwrap())){ - (Ok(Some(mdl_file)),Ok(Some(vvd_file)),Ok(Some(vtx_file)))=>{ - match (vmdl::mdl::Mdl::read(mdl_file.as_ref()),vmdl::vvd::Vvd::read(vvd_file.as_ref()),vmdl::vtx::Vtx::read(vtx_file.as_ref())){ - (Ok(mdl),Ok(vvd),Ok(vtx))=>{ - let model=vmdl::Model::from_parts(mdl,vtx,vvd); - for texture in model.textures(){ - for search_path in &texture.search_paths{ - let mut path=PathBuf::from(search_path.as_str()); - path.push(texture.name.as_str()); - deduplicate.insert(path); - } - } - }, - _=>println!("model_name={} error",model_name), - } - }, - _=>println!("no model name={}",model_name), - } - } - - let pack=&bsp.pack; - let vpk_list=&vpk_list; - std::thread::scope(move|s|{ - let mut thread_handles=Vec::new(); - for texture_name in deduplicate{ - let mut found_texture=false; - //LMAO imagine having to write type names - let write_image=|mut stuff,write_file_name|{ - let image=vtf::from_bytes(&mut stuff)?.highres_image.decode(0)?.to_rgba8(); - - let format=if image.width()%4!=0||image.height()%4!=0{ - image_dds::ImageFormat::Rgba8UnormSrgb - }else{ - image_dds::ImageFormat::BC7RgbaUnormSrgb - }; - //this fails if the image dimensions are not a multiple of 4 - let dds = image_dds::dds_from_image( - &image, - format, - image_dds::Quality::Slow, - image_dds::Mipmaps::GeneratedAutomatic, - )?; - - //write dds - let mut dest=PathBuf::from("textures"); - dest.push(write_file_name); - dest.set_extension("dds"); - std::fs::create_dir_all(dest.parent().unwrap())?; - let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?); - dds.write(&mut writer)?; - Ok::<(),anyhow::Error>(()) - }; - let find_stuff=|search_file_name:String|{ - println!("search_file_name={}",search_file_name); - match pack.get(search_file_name.as_str())?{ - Some(file)=>return Ok(Some(file)), - _=>(), - } - //search pak list - for vpk_index in vpk_list{ - if let Some(vpk_entry)=vpk_index.tree.get(search_file_name.as_str()){ - return Ok(Some(match vpk_entry.get()?{ - std::borrow::Cow::Borrowed(bytes)=>bytes.to_vec(), - std::borrow::Cow::Owned(bytes)=>bytes, - })); - } - } - Ok::>,anyhow::Error>(None) - }; - let loader=|texture_name:String|{ - let mut texture_file_name=PathBuf::from("materials"); - //lower case - let texture_file_name_lowercase=texture_name.to_lowercase(); - texture_file_name.push(texture_file_name_lowercase.clone()); - //remove stem and search for both vtf and vmt files - let stem=PathBuf::from(texture_file_name.file_stem().unwrap()); - texture_file_name.pop(); - texture_file_name.push(stem); - //somehow search for both files - let mut texture_file_name_vmt=texture_file_name.clone(); - texture_file_name.set_extension("vtf"); - texture_file_name_vmt.set_extension("vmt"); - if let Some(stuff)=find_stuff(texture_file_name.to_string_lossy().to_string())?{ - return Ok(Some(stuff)) - } - recursive_vmt_loader(&find_stuff,get_vmt(&find_stuff,texture_file_name_vmt.to_string_lossy().to_string())?) - }; - if let Some(stuff)=loader(texture_name.to_string_lossy().to_string())?{ - found_texture=true; - let texture_name=texture_name.clone(); - thread_handles.push(s.spawn(move||write_image(stuff,texture_name))); - } - if !found_texture{ - println!("no data"); - } - } - for thread in thread_handles{ - match thread.join(){ - Ok(Err(e))=>println!("write error: {:?}",e), - Err(e)=>println!("thread error: {:?}",e), - Ok(_)=>(), - } - } - Ok::<(),anyhow::Error>(()) - })? +fn load_texture<'bsp,'vpk,'a>(finder:BspFinder<'bsp,'vpk>,texture_name:&str)->Result>,LoadVMTError> + where + 'bsp:'a, + 'vpk:'a, +{ + let mut texture_file_name=PathBuf::from("materials"); + //lower case + let texture_file_name_lowercase=texture_name.to_lowercase(); + texture_file_name.push(texture_file_name_lowercase.clone()); + //remove stem and search for both vtf and vmt files + let stem=PathBuf::from(texture_file_name.file_stem().unwrap()); + texture_file_name.pop(); + texture_file_name.push(stem); + if let Some(stuff)=finder.find(texture_file_name.to_str().unwrap())?{ + return Ok(Some(stuff)) } + //somehow search for both files + let mut texture_file_name_vmt=texture_file_name.clone(); + texture_file_name.set_extension("vtf"); + texture_file_name_vmt.set_extension("vmt"); + recursive_vmt_loader(finder,get_vmt(finder,texture_file_name_vmt.to_str().unwrap())?) +} +#[derive(Debug,thiserror::Error)] +enum ExtractTextureError{ + #[error("Io error {0:?}")] + Io(#[from]std::io::Error), + #[error("Bsp error {0:?}")] + Bsp(#[from]vbsp::BspError), + #[error("MeshLoad error {0:?}")] + MeshLoad(#[from]strafesnet_bsp_loader::loader::MeshError), + #[error("Load VMT error {0:?}")] + LoadVMT(#[from]LoadVMTError), +} +async fn gimme_them_textures(path:&Path,vpk_list:&[vpk::VPK],send_texture:tokio::sync::mpsc::Sender<(Vec,String)>)->Result<(),ExtractTextureError>{ + let bsp=vbsp::Bsp::read(tokio::fs::read(path).await?.as_ref())?; + let loader_bsp=strafesnet_bsp_loader::Bsp::new(bsp); + let bsp=loader_bsp.as_ref(); + + let mut texture_deferred_loader=RenderConfigDeferredLoader::new(); + for texture in bsp.textures(){ + texture_deferred_loader.acquire_render_config_id(Some(Cow::Borrowed(texture.name()))); + } + + let mut mesh_deferred_loader=MeshDeferredLoader::new(); + for prop in bsp.static_props(){ + mesh_deferred_loader.acquire_mesh_id(prop.model()); + } + + let finder=BspFinder{ + bsp:&loader_bsp, + vpks:vpk_list + }; + + let mut mesh_loader=strafesnet_bsp_loader::loader::ModelLoader::new(finder); + // load models and collect requested textures + for model_path in mesh_deferred_loader.into_indices(){ + let model:vmdl::Model=match mesh_loader.load(model_path){ + Ok(model)=>model, + Err(e)=>{ + println!("Model={model_path} Load model error: {e}"); + continue; + }, + }; + for texture in model.textures(){ + for search_path in &texture.search_paths{ + let mut path=PathBuf::from(search_path.as_str()); + path.push(texture.name.as_str()); + let path=path.to_str().unwrap().to_owned(); + texture_deferred_loader.acquire_render_config_id(Some(Cow::Owned(path))); + } + } + } + + for texture_path in texture_deferred_loader.into_indices(){ + match load_texture(finder,&texture_path){ + Ok(Some(texture))=>send_texture.send( + (texture.into_owned(),texture_path.into_owned()) + ).await.unwrap(), + Ok(None)=>(), + Err(e)=>println!("Texture={texture_path} Load error: {e}"), + } + } + + Ok(()) +} + + +#[derive(Debug,thiserror::Error)] +enum ConvertTextureError{ + #[error("Bsp error {0:?}")] + Bsp(#[from]vbsp::BspError), + #[error("Vtf error {0:?}")] + Vtf(#[from]vtf::Error), + #[error("DDS create error {0:?}")] + DDS(#[from]image_dds::CreateDdsError), + #[error("DDS write error {0:?}")] + DDSWrite(#[from]image_dds::ddsfile::Error), + #[error("Io error {0:?}")] + Io(#[from]std::io::Error), +} + +async fn convert_texture(texture:Vec,write_file_name:impl AsRef)->Result<(),ConvertTextureError>{ + let image=vtf::from_bytes(&texture)?.highres_image.decode(0)?.to_rgba8(); + + let format=if image.width()%4!=0||image.height()%4!=0{ + image_dds::ImageFormat::Rgba8UnormSrgb + }else{ + image_dds::ImageFormat::BC7RgbaUnormSrgb + }; + //this fails if the image dimensions are not a multiple of 4 + let dds = image_dds::dds_from_image( + &image, + format, + image_dds::Quality::Slow, + image_dds::Mipmaps::GeneratedAutomatic, + )?; + + //write dds + let mut dest=PathBuf::from("textures"); + dest.push(write_file_name); + dest.set_extension("dds"); + std::fs::create_dir_all(dest.parent().unwrap())?; + let mut writer=std::io::BufWriter::new(std::fs::File::create(dest)?); + dds.write(&mut writer)?; + + Ok(()) +} + +async fn read_vpks(vpk_paths:Vec,thread_limit:usize)->Vec{ + futures::stream::iter(vpk_paths).map(|vpk_path|async{ + // idk why it doesn't want to pass out the errors but this is fatal anyways + tokio::task::spawn_blocking(move||vpk::VPK::read(&vpk_path)).await.unwrap().unwrap() + }) + .buffer_unordered(thread_limit) + .collect().await +} + +async fn extract_textures(paths:Vec,vpk_paths:Vec)->AResult<()>{ + tokio::try_join!( + tokio::fs::create_dir_all("extracted_textures"), + tokio::fs::create_dir_all("textures"), + tokio::fs::create_dir_all("meshes"), + )?; + let thread_limit=std::thread::available_parallelism()?.get(); + + // load vpk list + let vpk_list=read_vpks(vpk_paths,thread_limit).await; + + // leak vpk_list for static lifetime? + let vpk_list:&[vpk::VPK]=vpk_list.leak(); + + let (send_texture,mut recv_texture)=tokio::sync::mpsc::channel(thread_limit); + let mut it=paths.into_iter(); + let extract_thread=tokio::spawn(async move{ + static SEM:tokio::sync::Semaphore=tokio::sync::Semaphore::const_new(0); + SEM.add_permits(thread_limit); + while let (Ok(permit),Some(path))=(SEM.acquire().await,it.next()){ + let send=send_texture.clone(); + tokio::spawn(async move{ + let result=gimme_them_textures(&path,vpk_list,send).await; + drop(permit); + match result{ + Ok(())=>(), + Err(e)=>println!("Map={path:?} Decode error: {e:?}"), + } + }); + } + }); + + // convert images + static SEM:tokio::sync::Semaphore=tokio::sync::Semaphore::const_new(0); + SEM.add_permits(thread_limit); + while let (Ok(permit),Some((data,dest)))=(SEM.acquire().await,recv_texture.recv().await){ + // TODO: dedup dest? + tokio::spawn(async move{ + let result=convert_texture(data,dest).await; + drop(permit); + match result{ + Ok(())=>(), + Err(e)=>println!("Convert error: {e:?}"), + } + }); + } + extract_thread.await?; + _=SEM.acquire_many(thread_limit as u32).await?; Ok(()) } @@ -277,7 +367,8 @@ fn bsp_contents(path:PathBuf)->AResult<()>{ enum ConvertError{ IO(std::io::Error), SNFMap(strafesnet_snf::map::Error), - BspLoader(strafesnet_bsp_loader::ReadError), + BspRead(strafesnet_bsp_loader::ReadError), + BspLoad(strafesnet_bsp_loader::LoadError), } impl std::fmt::Display for ConvertError{ fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ @@ -286,79 +377,52 @@ impl std::fmt::Display for ConvertError{ } impl std::error::Error for ConvertError{} -type MapThread=std::thread::JoinHandle>; +async fn convert_to_snf(path:&Path,vpk_list:&[vpk::VPK],output_folder:PathBuf)->AResult<()>{ + let entire_file=tokio::fs::read(path).await?; -fn source_to_snf(pathlist:Vec,output_folder:PathBuf)->AResult<()>{ - let n_paths=pathlist.len(); - let start = std::time::Instant::now(); - let mut threads:std::collections::VecDeque=std::collections::VecDeque::new(); - let mut i=0; - let mut join_thread=|thread:MapThread|{ - i+=1; - if let Err(e)=thread.join(){ - println!("thread error: {:?}",e); - }else{ - println!("{}/{}",i,n_paths); - } - }; - for path in pathlist{ - if 32<=threads.len(){ - join_thread(threads.pop_front().unwrap()); - } - let output_folder=output_folder.clone(); - threads.push_back(std::thread::spawn(move ||{ - let bsp=strafesnet_bsp_loader::read( - std::fs::File::open(path.as_path()) - .map_err(ConvertError::IO)? - ).map_err(ConvertError::BspLoader)?; - let mut loader=strafesnet_deferred_loader::source_legacy(); + let bsp=strafesnet_bsp_loader::read( + std::io::Cursor::new(entire_file) + ).map_err(ConvertError::BspRead)?; - let (texture_loader,mesh_loader)=loader.get_inner_mut(); + let map=bsp.to_snf(LoadFailureMode::DefaultToNone,vpk_list).map_err(ConvertError::BspLoad)?; - let map_step1=strafesnet_bsp_loader::convert( - &bsp, - |name|texture_loader.acquire_render_config_id(name), - |name|mesh_loader.acquire_mesh_id(name), - ); + let mut dest=output_folder; + dest.push(path.file_stem().unwrap()); + dest.set_extension("snfm"); + let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; - let prop_meshes=mesh_loader.load_meshes(&bsp.as_ref()); + strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; - let map_step2=map_step1.add_prop_meshes( - //the type conflagulator 9000 - prop_meshes.into_iter().map(|(mesh_id,loader_model)| - (mesh_id,strafesnet_bsp_loader::data::ModelData{ - mdl:strafesnet_bsp_loader::data::MdlData::new(loader_model.mdl.get()), - vtx:strafesnet_bsp_loader::data::VtxData::new(loader_model.vtx.get()), - vvd:strafesnet_bsp_loader::data::VvdData::new(loader_model.vvd.get()), - }) - ), - |name|texture_loader.acquire_render_config_id(name), - ); - - let (textures,render_configs)=loader.into_render_configs().map_err(ConvertError::IO)?.consume(); - - let map=map_step2.add_render_configs_and_textures( - render_configs.into_iter(), - textures.into_iter().map(|(texture_id,texture)| - (texture_id,match texture{ - strafesnet_deferred_loader::texture::Texture::ImageDDS(data)=>data, - }) - ), - ); - - let mut dest=output_folder.clone(); - dest.push(path.file_stem().unwrap()); - dest.set_extension("snfm"); - let file=std::fs::File::create(dest).map_err(ConvertError::IO)?; - - strafesnet_snf::map::write_map(file,map).map_err(ConvertError::SNFMap)?; - Ok(()) - })); - } - - for thread in threads{ - join_thread(thread); - } - println!("{:?}", start.elapsed()); + Ok(()) +} +async fn source_to_snf(paths:Vec,output_folder:PathBuf,vpk_paths:Vec)->AResult<()>{ + let start=std::time::Instant::now(); + + let thread_limit=std::thread::available_parallelism()?.get(); + + // load vpk list + let vpk_list=read_vpks(vpk_paths,thread_limit).await; + + // leak vpk_list for static lifetime? + let vpk_list:&[vpk::VPK]=vpk_list.leak(); + + let mut it=paths.into_iter(); + static SEM:tokio::sync::Semaphore=tokio::sync::Semaphore::const_new(0); + SEM.add_permits(thread_limit); + + while let (Ok(permit),Some(path))=(SEM.acquire().await,it.next()){ + let output_folder=output_folder.clone(); + tokio::spawn(async move{ + let result=convert_to_snf(path.as_path(),vpk_list,output_folder).await; + drop(permit); + match result{ + Ok(())=>(), + Err(e)=>println!("Convert error: {e:?}"), + } + }); + } + _=SEM.acquire_many(thread_limit as u32).await.unwrap(); + + println!("elapsed={:?}", start.elapsed()); Ok(()) } From 205db9a0dbf9fda2c8dc607bbe0bc5176798282c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 4 Feb 2025 09:09:10 -0800 Subject: [PATCH 124/125] v0.7.0 loader rewrite --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57718387..797db5f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "map-tool" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index ac3282f8..0f541f5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "map-tool" -version = "1.6.0" +version = "1.7.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 2c1910bc24f0987d3750fe9dd951b6448bd458ff Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 4 Feb 2025 09:24:35 -0800 Subject: [PATCH 125/125] map-tool: move into folder --- Cargo.lock | 3787 ----------------------------- Cargo.toml => map-tool/Cargo.toml | 0 LICENSE => map-tool/LICENSE | 0 README.md => map-tool/README.md | 0 {src => map-tool/src}/main.rs | 0 {src => map-tool/src}/roblox.rs | 0 {src => map-tool/src}/source.rs | 0 7 files changed, 3787 deletions(-) delete mode 100644 Cargo.lock rename Cargo.toml => map-tool/Cargo.toml (100%) rename LICENSE => map-tool/LICENSE (100%) rename README.md => map-tool/README.md (100%) rename {src => map-tool/src}/main.rs (100%) rename {src => map-tool/src}/roblox.rs (100%) rename {src => map-tool/src}/source.rs (100%) diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 797db5f3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,3787 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom 0.2.15", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "aligned-vec" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anstream" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" -dependencies = [ - "anstyle", - "once_cell", - "windows-sys 0.59.0", -] - -[[package]] -name = "anyhow" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" - -[[package]] -name = "approx" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" -dependencies = [ - "num-traits", -] - -[[package]] -name = "arbitrary" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" - -[[package]] -name = "arg_enum_proc_macro" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "array-init" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" - -[[package]] -name = "arrayref" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "av1-grain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" -dependencies = [ - "anyhow", - "arrayvec", - "log", - "nom", - "num-rational", - "v_frame", -] - -[[package]] -name = "avif-serialize" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e335041290c43101ca215eed6f43ec437eb5a42125573f600fc3fa42b9bddd62" -dependencies = [ - "arrayvec", -] - -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bcdec_rs" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09c37bc0e9f0924b7dae9988265ef3c76c88538f41a3b06caf4bed07cee5226" - -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" - -[[package]] -name = "binrw" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173901312e9850391d4d7c1318c4e099fdc037d61870fca427429830efdb4e5f" -dependencies = [ - "array-init", - "binrw_derive 0.13.3", - "bytemuck", -] - -[[package]] -name = "binrw" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4bca59c20d6f40c2cc0802afbe1e788b89096f61bdf7aeea6bf00f10c2909b" -dependencies = [ - "array-init", - "binrw_derive 0.14.1", - "bytemuck", -] - -[[package]] -name = "binrw_derive" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb515fdd6f8d3a357c8e19b8ec59ef53880807864329b1cb1cba5c53bf76557e" -dependencies = [ - "either", - "owo-colors", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "binrw_derive" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8ba42866ce5bced2645bfa15e97eef2c62d2bdb530510538de8dd3d04efff3c" -dependencies = [ - "either", - "owo-colors", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "bit_field" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" - -[[package]] -name = "bitstream-io" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" - -[[package]] -name = "blake3" -version = "1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", -] - -[[package]] -name = "bnum" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f781dba93de3a5ef6dc5b17c9958b208f6f3f021623b360fb605ea51ce443f10" - -[[package]] -name = "bstr" -version = "1.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "built" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "bv" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" -dependencies = [ - "feature-probe", -] - -[[package]] -name = "bytemuck" -version = "1.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "byteorder" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "byteorder-lite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" - -[[package]] -name = "bytes" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" - -[[package]] -name = "cc" -version = "1.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" -dependencies = [ - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cgmath" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317" -dependencies = [ - "approx", - "num-traits", -] - -[[package]] -name = "chrono" -version = "0.4.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets", -] - -[[package]] -name = "clap" -version = "4.5.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "clap_lex" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" - -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - -[[package]] -name = "colorchoice" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - -[[package]] -name = "constant_time_eq" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "crc" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" - -[[package]] -name = "ddsfile" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479dfe1e6737aa9e96c6ac7b69689dc4c32da8383f2c12744739d76afa8b66c4" -dependencies = [ - "bitflags 2.8.0", - "byteorder 1.5.0", - "enum-primitive-derive", - "num-traits", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "enum-primitive-derive" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c375b9c5eadb68d0a6efee2999fef292f45854c3444c86f09d8ab086ba942b0e" -dependencies = [ - "num-traits", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "err-derive" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34a887c8df3ed90498c1c437ce21f211c8e27672921a8ffa293cb8d6d4caa9e" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", - "synstructure 0.12.6", -] - -[[package]] -name = "errno" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - -[[package]] -name = "exr" -version = "1.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" -dependencies = [ - "bit_field", - "half", - "lebe", - "miniz_oxide", - "rayon-core", - "smallvec", - "zune-inflate", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "fdeflate" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "feature-probe" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" - -[[package]] -name = "fixed_wide" -version = "0.1.2" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "a7e01a5b738e313c912fc41c425cf36e10c51647d3fd21d96db3d616344549fa" -dependencies = [ - "arrayvec", - "bnum", - "paste", - "ratio_ops", -] - -[[package]] -name = "flate2" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-executor" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets", -] - -[[package]] -name = "gif" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" -dependencies = [ - "color_quant", - "weezl", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "glam" -version = "0.29.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc46dd3ec48fdd8e693a98d2b8bafae273a2d54c1de02a2a7e3d57d501f39677" - -[[package]] -name = "h2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "bytemuck", - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "http" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" - -[[package]] -name = "hyper" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" -dependencies = [ - "futures-util", - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "id" -version = "0.1.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "2337e7a6c273082b672e377e159d7a168fb51438461b7c4033c79a515dd7a25a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "idna" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "image" -version = "0.25.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" -dependencies = [ - "bytemuck", - "byteorder-lite", - "color_quant", - "exr", - "gif", - "image-webp", - "num-traits", - "png", - "qoi", - "ravif", - "rayon", - "rgb", - "tiff", - "zune-core", - "zune-jpeg", -] - -[[package]] -name = "image-webp" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f" -dependencies = [ - "byteorder-lite", - "quick-error", -] - -[[package]] -name = "image_dds" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550c3f4c985c41d96aa133651aa1a3dbd54961c28a68aca574487fe8bbdda6fb" -dependencies = [ - "bcdec_rs", - "bytemuck", - "ddsfile", - "half", - "image", - "intel_tex_2", - "strum", - "thiserror 1.0.69", -] - -[[package]] -name = "imgref" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" - -[[package]] -name = "indexmap" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "intel_tex_2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd699c0e6adcac28c06db24a220c834c8ec811e0d2d80f0261bb14e01737b4dc" -dependencies = [ - "ispc_rt", -] - -[[package]] -name = "interpolate_name" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "ipnet" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "ispc_rt" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d30e08ddfd6fe26c3ee2e856dff022420cd0514ed16f5ccf2dc3e1d5cae578" -dependencies = [ - "libc", - "num_cpus", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" - -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - -[[package]] -name = "jpeg-decoder" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "lazy-regex" -version = "3.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126" -dependencies = [ - "lazy-regex-proc_macros", - "once_cell", - "regex", -] - -[[package]] -name = "lazy-regex-proc_macros" -version = "3.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba01db5ef81e17eb10a5e0f2109d1b3a3e29bac3070fdbd7d156bf7dbd206a1" -dependencies = [ - "proc-macro2", - "quote", - "regex", - "syn 2.0.96", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "lebe" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" - -[[package]] -name = "libc" -version = "0.2.169" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" - -[[package]] -name = "libfuzzer-sys" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf78f52d400cf2d84a3a973a78a592b4adc535739e0a5597a0da6f0c357adc75" -dependencies = [ - "arbitrary", - "cc", -] - -[[package]] -name = "libloading" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] - -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - -[[package]] -name = "linear_ops" -version = "0.1.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "b2e6977ac24f47086d8a7a2d4ae1c720e86dfdc8407cf5e34c18bfa01053c456" -dependencies = [ - "fixed_wide", - "paste", - "ratio_ops", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" - -[[package]] -name = "logos" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7251356ef8cb7aec833ddf598c6cb24d17b689d20b993f9d11a3d764e34e6458" -dependencies = [ - "logos-derive", -] - -[[package]] -name = "logos-codegen" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f80069600c0d66734f5ff52cc42f2dabd6b29d205f333d61fd7832e9e9963f" -dependencies = [ - "beef", - "fnv", - "lazy_static", - "proc-macro2", - "quote", - "regex-syntax", - "syn 2.0.96", -] - -[[package]] -name = "logos-derive" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24fb722b06a9dc12adb0963ed585f19fc61dc5413e6a9be9422ef92c091e731d" -dependencies = [ - "logos-codegen", -] - -[[package]] -name = "loop9" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" -dependencies = [ - "imgref", -] - -[[package]] -name = "luau0-src" -version = "0.12.0+luau657" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a4b4c16b82ddf60e0fa93ca5a6afc504a6db22310cc82ecec629cd2e405b2ca" -dependencies = [ - "cc", -] - -[[package]] -name = "lz4" -version = "1.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" -dependencies = [ - "lz4-sys", -] - -[[package]] -name = "lz4-sys" -version = "1.11.1+lz4-1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "lzma" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "782ba3f542e8bc1349386c15e9dc3119ae6da96479f96b3863cc7a88bbdfd4e4" -dependencies = [ - "byteorder 0.5.3", -] - -[[package]] -name = "lzma-rs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" -dependencies = [ - "byteorder 1.5.0", - "crc", -] - -[[package]] -name = "map-tool" -version = "1.7.0" -dependencies = [ - "anyhow", - "clap", - "flate2", - "futures", - "image", - "image_dds", - "lazy-regex", - "rbx_asset", - "rbx_binary", - "rbx_dom_weak", - "rbx_reflection_database", - "rbx_xml", - "rbxassetid", - "strafesnet_bsp_loader", - "strafesnet_deferred_loader", - "strafesnet_rbx_loader", - "strafesnet_snf", - "thiserror 2.0.11", - "tokio", - "vbsp", - "vmdl", - "vmt-parser", - "vpk", - "vtf", -] - -[[package]] -name = "maybe-rayon" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" -dependencies = [ - "cfg-if", - "rayon", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miette" -version = "7.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" -dependencies = [ - "cfg-if", - "miette-derive", - "thiserror 1.0.69", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "7.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "mio" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", -] - -[[package]] -name = "mlua" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3f763c1041eff92ffb5d7169968a327e1ed2ebfe425dac0ee5a35f29082534b" -dependencies = [ - "bstr", - "either", - "libloading", - "mlua-sys", - "num-traits", - "parking_lot", - "rustc-hash", -] - -[[package]] -name = "mlua-sys" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1901c1a635a22fe9250ffcc4fcc937c16b47c2e9e71adba8784af8bca1f69594" -dependencies = [ - "cc", - "cfg-if", - "luau0-src", - "pkg-config", -] - -[[package]] -name = "native-tls" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "noop_proc_macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "openssl" -version = "0.10.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" -dependencies = [ - "bitflags 2.8.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-sys" -version = "0.9.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - -[[package]] -name = "parse-display" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914a1c2265c98e2446911282c6ac86d8524f495792c38c5bd884f80499c7538a" -dependencies = [ - "parse-display-derive 0.9.1", - "regex", - "regex-syntax", -] - -[[package]] -name = "parse-display" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287d8d3ebdce117b8539f59411e4ed9ec226e0a4153c7f55495c6070d68e6f72" -dependencies = [ - "parse-display-derive 0.10.0", - "regex", - "regex-syntax", -] - -[[package]] -name = "parse-display-derive" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae7800a4c974efd12df917266338e79a7a74415173caf7e70aa0a0707345281" -dependencies = [ - "proc-macro2", - "quote", - "regex", - "regex-syntax", - "structmeta", - "syn 2.0.96", -] - -[[package]] -name = "parse-display-derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc048687be30d79502dea2f623d052f3a074012c6eac41726b7ab17213616b1" -dependencies = [ - "proc-macro2", - "quote", - "regex", - "regex-syntax", - "structmeta", - "syn 2.0.96", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_macros", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand", -] - -[[package]] -name = "phf_macros" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - -[[package]] -name = "png" -version = "0.17.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro-crate" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "profiling" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" -dependencies = [ - "profiling-procmacros", -] - -[[package]] -name = "profiling-procmacros" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" -dependencies = [ - "quote", - "syn 2.0.96", -] - -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "ratio_ops" -version = "0.1.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "01239195d6afe0509e7e3511b716c0540251dfe7ece0a9a5a27116afb766c42c" - -[[package]] -name = "rav1e" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" -dependencies = [ - "arbitrary", - "arg_enum_proc_macro", - "arrayvec", - "av1-grain", - "bitstream-io", - "built", - "cfg-if", - "interpolate_name", - "itertools 0.12.1", - "libc", - "libfuzzer-sys", - "log", - "maybe-rayon", - "new_debug_unreachable", - "noop_proc_macro", - "num-derive", - "num-traits", - "once_cell", - "paste", - "profiling", - "rand", - "rand_chacha", - "simd_helpers", - "system-deps", - "thiserror 1.0.69", - "v_frame", - "wasm-bindgen", -] - -[[package]] -name = "ravif" -version = "0.11.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2413fd96bd0ea5cdeeb37eaf446a22e6ed7b981d792828721e74ded1980a45c6" -dependencies = [ - "avif-serialize", - "imgref", - "loop9", - "quick-error", - "rav1e", - "rayon", - "rgb", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "rbx_asset" -version = "0.2.5" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "dcf243f46bd41b3880a27278177a3f9996f95ab231d9a04345ad9dd381c3a54a" -dependencies = [ - "chrono", - "flate2", - "reqwest", - "serde", - "serde_json", - "url", -] - -[[package]] -name = "rbx_binary" -version = "0.7.4" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "18b401155b93f7151217bf51e36bdfa7bddcaf5f0d26b563c9ac3b08a3701c27" -dependencies = [ - "log", - "lz4", - "profiling", - "rbx_dom_weak", - "rbx_reflection", - "rbx_reflection_database", - "thiserror 1.0.69", -] - -[[package]] -name = "rbx_dom_weak" -version = "2.9.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "2a6b916687c98aaea36f9c03e80906bfafab057bebee248628c8c04def807f43" -dependencies = [ - "rbx_types", - "serde", -] - -[[package]] -name = "rbx_mesh" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36372fd7feb6d3c5780d2ada39d1397be9e196ddfbb23ba1d84e7a75cf790adb" -dependencies = [ - "binrw 0.14.1", - "lazy-regex", -] - -[[package]] -name = "rbx_reflection" -version = "4.7.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "c1b43fe592a4ce6fe54eb215fb82735efbb516d2cc045a94e3dc0234ff293620" -dependencies = [ - "rbx_types", - "serde", - "thiserror 1.0.69", -] - -[[package]] -name = "rbx_reflection_database" -version = "0.2.12+roblox-638" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "2e772bb9e1bc0ebe65d338f876d1bb1ea22e15a8f9a82e8245028010c2fea3c9" -dependencies = [ - "lazy_static", - "rbx_reflection", - "rmp-serde", - "serde", -] - -[[package]] -name = "rbx_types" -version = "1.10.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "d7a390c44034fa448c53bd0983dfc2d70d8d6b2f65be4f164d4bec8b6a2a2d09" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "blake3", - "lazy_static", - "rand", - "serde", - "thiserror 1.0.69", -] - -[[package]] -name = "rbx_xml" -version = "0.13.3" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "d6d1a15f58a1e4b4f578abe6eb5e1461cb16eea82fb4a147d5995c9b79f08d1f" -dependencies = [ - "base64 0.13.1", - "log", - "rbx_dom_weak", - "rbx_reflection", - "rbx_reflection_database", - "xml-rs", -] - -[[package]] -name = "rbxassetid" -version = "0.1.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "e6821fe9eaff54cd142932cb04c612b7599d9b8586973145b7ec1230ae84d184" -dependencies = [ - "url", -] - -[[package]] -name = "redox_syscall" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" -dependencies = [ - "bitflags 2.8.0", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "reqwest" -version = "0.12.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" -dependencies = [ - "base64 0.22.1", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-tls", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "mime_guess", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-native-tls", - "tower", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-registry", -] - -[[package]] -name = "rgb" -version = "0.8.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.15", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rmp" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" -dependencies = [ - "byteorder 1.5.0", - "num-traits", - "paste", -] - -[[package]] -name = "rmp-serde" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" -dependencies = [ - "byteorder 1.5.0", - "rmp", - "serde", -] - -[[package]] -name = "roblox_emulator" -version = "0.4.7" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "7fc98335ce4b8548b725d727c5b32bd0b38274606c48fce6b6e7e5807d94db6b" -dependencies = [ - "glam", - "mlua", - "phf", - "rbx_dom_weak", - "rbx_reflection", - "rbx_reflection_database", - "rbx_types", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.8.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustls" -version = "0.23.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" -dependencies = [ - "once_cell", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" - -[[package]] -name = "rustls-webpki" -version = "0.102.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" - -[[package]] -name = "ryu" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" - -[[package]] -name = "schannel" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags 2.8.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "serde" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "serde_json" -version = "1.0.138" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_repr" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - -[[package]] -name = "simd_helpers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" -dependencies = [ - "quote", -] - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strafesnet_bsp_loader" -version = "0.3.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "3cc98773f2b98eb708b098946870b769975b63a396b84698b67e3d968029005d" -dependencies = [ - "glam", - "strafesnet_common", - "strafesnet_deferred_loader", - "vbsp", - "vmdl", - "vpk", -] - -[[package]] -name = "strafesnet_common" -version = "0.6.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "0c1d7a83e1f6b579c6a9b4dc70c92373ab53b938601cd75928dd6795b5ffef21" -dependencies = [ - "arrayvec", - "bitflags 2.8.0", - "fixed_wide", - "glam", - "id", - "linear_ops", - "ratio_ops", -] - -[[package]] -name = "strafesnet_deferred_loader" -version = "0.5.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "63d5d48e587d5f8bf5385bee3505ed790727fef68de855cf58247a08c5952bef" -dependencies = [ - "strafesnet_common", -] - -[[package]] -name = "strafesnet_rbx_loader" -version = "0.6.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "e4659a49128c8d12b9fbdb289969cae04bfc5c1750d4273897700c5c17730d8a" -dependencies = [ - "bytemuck", - "glam", - "lazy-regex", - "rbx_binary", - "rbx_dom_weak", - "rbx_mesh", - "rbx_reflection_database", - "rbx_xml", - "rbxassetid", - "roblox_emulator", - "strafesnet_common", - "strafesnet_deferred_loader", -] - -[[package]] -name = "strafesnet_snf" -version = "0.3.0" -source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "fd24a22c484ca04213fa44b1d34bfbec385f0d176a2b5829cfa59ba7987b80d5" -dependencies = [ - "binrw 0.14.1", - "id", - "strafesnet_common", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "structmeta" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e1575d8d40908d70f6fd05537266b90ae71b15dbbe7a8b7dffa2b759306d329" -dependencies = [ - "proc-macro2", - "quote", - "structmeta-derive", - "syn 2.0.96", -] - -[[package]] -name = "structmeta-derive" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.96", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.96" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags 2.8.0", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck", - "pkg-config", - "toml", - "version-compare", -] - -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - -[[package]] -name = "tempfile" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" -dependencies = [ - "cfg-if", - "fastrand", - "getrandom 0.3.1", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - -[[package]] -name = "texpresso" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8277e703c934b9693d0773d5749faacc6366b3d81d012da556a4cfd4ab87f336" -dependencies = [ - "libm", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" -dependencies = [ - "thiserror-impl 2.0.11", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "tiff" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" -dependencies = [ - "flate2", - "jpeg-decoder", - "weezl", -] - -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tokio" -version = "1.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "pin-project-lite", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tower" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "tracing-core" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "unicase" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" - -[[package]] -name = "unicode-ident" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "v_frame" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" -dependencies = [ - "aligned-vec", - "num-traits", - "wasm-bindgen", -] - -[[package]] -name = "vbsp" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f14a5685e0bb386aac9b9c6046a05152a46a0bc58d53afb3fbe577f1a1c2bb05" -dependencies = [ - "ahash", - "arrayvec", - "binrw 0.14.1", - "bitflags 2.8.0", - "bv", - "cgmath", - "itertools 0.13.0", - "lzma-rs", - "num_enum", - "serde", - "static_assertions", - "thiserror 1.0.69", - "vdf-reader", - "zip-lzma", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "vdf-reader" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "543945fdc3d51b20e3e0f5fd845ddeca4a270e56522035cf152105bc144ffd65" -dependencies = [ - "logos", - "miette", - "parse-display 0.9.1", - "serde", - "thiserror 1.0.69", -] - -[[package]] -name = "version-compare" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "vmdl" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2f6b8c22da8937403a5da864e7ea390f30cd40b7a077079e40279aa6a4f553" -dependencies = [ - "arrayvec", - "bitflags 2.8.0", - "bytemuck", - "cgmath", - "half", - "itertools 0.13.0", - "num_enum", - "static_assertions", - "thiserror 1.0.69", - "tracing", -] - -[[package]] -name = "vmt-parser" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c25c4e0ba68b6c74038e6c3c7b9bb16c01f01e25fe75c7db8f575a5a7c38cf" -dependencies = [ - "miette", - "serde", - "serde_repr", - "thiserror 1.0.69", - "vdf-reader", -] - -[[package]] -name = "vpk" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60ec10e731515f58d5494d472f027d9c6fc8500fcb790ff55751031bcad87b6b" -dependencies = [ - "ahash", - "binrw 0.13.3", - "thiserror 1.0.69", -] - -[[package]] -name = "vtf" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66720c07784e3b49062ea42cddef8df72291f7c5d0ea7dcb5882a0653b32a21b" -dependencies = [ - "byteorder 1.5.0", - "err-derive", - "image", - "num_enum", - "parse-display 0.10.0", - "texpresso", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasi" -version = "0.13.3+wasi-0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" -dependencies = [ - "wit-bindgen-rt", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.96", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" -dependencies = [ - "cfg-if", - "js-sys", - "once_cell", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "weezl" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-registry" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" -dependencies = [ - "windows-result", - "windows-strings", - "windows-targets", -] - -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result", - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419" -dependencies = [ - "memchr", -] - -[[package]] -name = "wit-bindgen-rt" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags 2.8.0", -] - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "xml-rs" -version = "0.8.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", - "synstructure 0.13.1", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder 1.5.0", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", - "synstructure 0.13.1", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "zip-lzma" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b480cb31fccfb2786565c0e0712865fd6f1ea0ea850c50316f643c3948196e63" -dependencies = [ - "byteorder 1.5.0", - "crc32fast", - "crossbeam-utils", - "lzma", -] - -[[package]] -name = "zune-core" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" - -[[package]] -name = "zune-inflate" -version = "0.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "zune-jpeg" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99a5bab8d7dedf81405c4bb1f2b83ea057643d9cb28778cea9eecddeedd2e028" -dependencies = [ - "zune-core", -] diff --git a/Cargo.toml b/map-tool/Cargo.toml similarity index 100% rename from Cargo.toml rename to map-tool/Cargo.toml diff --git a/LICENSE b/map-tool/LICENSE similarity index 100% rename from LICENSE rename to map-tool/LICENSE diff --git a/README.md b/map-tool/README.md similarity index 100% rename from README.md rename to map-tool/README.md diff --git a/src/main.rs b/map-tool/src/main.rs similarity index 100% rename from src/main.rs rename to map-tool/src/main.rs diff --git a/src/roblox.rs b/map-tool/src/roblox.rs similarity index 100% rename from src/roblox.rs rename to map-tool/src/roblox.rs diff --git a/src/source.rs b/map-tool/src/source.rs similarity index 100% rename from src/source.rs rename to map-tool/src/source.rs