diff --git a/Cargo.lock b/Cargo.lock index b6a40c2..aec0153 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,6 +114,12 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.21.0" @@ -897,6 +903,19 @@ dependencies = [ "byteorder", ] +[[package]] +name = "gd_plist" +version = "1.4.1" +source = "git+https://github.com/Syudagye/gd-plist.git#577da4c07496e72cd897db4bab7f45b601b0a45d" +dependencies = [ + "base64 0.13.1", + "indexmap", + "line-wrap", + "quick-xml", + "serde", + "time", +] + [[package]] name = "gethostname" version = "0.2.3" @@ -1020,18 +1039,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "guider" -version = "0.1.0" -dependencies = [ - "base64", - "flate2", - "home", - "iced", - "quick-xml", - "rodio", -] - [[package]] name = "guillotiere" version = "0.6.2" @@ -1320,6 +1327,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1902,6 +1918,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pipedash" +version = "0.1.0" +dependencies = [ + "base64 0.21.0", + "flate2", + "gd_plist", + "home", + "iced", + "rodio", +] + [[package]] name = "pkg-config" version = "0.3.26" @@ -1954,9 +1982,9 @@ checksum = "74605f360ce573babfe43964cbe520294dcb081afbf8c108fc6e23036b4da2df" [[package]] name = "quick-xml" -version = "0.27.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc053f057dd768a56f62cd7e434c42c831d296968997e9ac1f76ea7c2d14c41" +checksum = "7f50b1c63b38611e7d4d7f68b82d3ad0cc71a2ad2e7f61fc10f1328d917c93cd" dependencies = [ "memchr", ] @@ -2129,6 +2157,12 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + [[package]] name = "same-file" version = "1.0.6" @@ -2440,6 +2474,33 @@ dependencies = [ "syn", ] +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + [[package]] name = "tiny-skia" version = "0.7.0" diff --git a/Cargo.toml b/Cargo.toml index 89631bd..f414c12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,4 +11,4 @@ rodio = {version = "0.16.0"} home = {version = "0.5.4"} base64 = {version = "0.21.0"} flate2 = {version = "1.0.25"} -quick-xml = {version = "0.27.1"} +gd_plist = {git = "https://github.com/Syudagye/gd-plist.git", version = "1.4.0"} diff --git a/src/gd.rs b/src/gd.rs index bc98c25..6d47328 100644 --- a/src/gd.rs +++ b/src/gd.rs @@ -3,7 +3,6 @@ use std::fs::File; use std::io::Read; use base64::engine::{general_purpose::URL_SAFE, Engine}; use flate2::read::GzDecoder; -use quick_xml::{Reader, events::Event}; struct User { name: String, @@ -88,6 +87,40 @@ impl LevelBuilder { } } +fn verbosify_plist(plist: &str) -> String { + plist + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") +} + +fn concisify_plist(plist: &str) -> String { + plist + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") + .replace("","") +} + fn get_local_level_plist() -> String { let raw_save_data = { let mut save_file = File::open(gd_path().join("CCLocalLevels.dat")).expect("No save file found!"); @@ -102,19 +135,9 @@ fn get_local_level_plist() -> String { if let Err(_) = decoder.read_to_string(&mut plist) { println!("Warning: Game save likely corrupted (gzip decode failed)"); } - plist + verbosify_plist(&plist) } fn get_outer_levels() -> Vec { let plist = get_local_level_plist(); - let mut reader = Reader::from_str(plist.as_ref()); - let mut out = vec![]; - let builder = LevelBuilder::default(); - loop { - let token = reader.read_event().unwrap(); - match token { - _ => {} - } - break out; - } }