diff --git a/src/main.rs b/src/main.rs index d44a2ab..3860f26 100644 --- a/src/main.rs +++ b/src/main.rs @@ -202,6 +202,7 @@ async fn main() { let among_us_version = determine_among_us_version(String::from(among_us_folder.to_str().unwrap())).unwrap(); + println!("AmongUsVersion: {}", among_us_version); let ver_url: (String, String, bool) = determine_town_of_us_url(among_us_version.to_string().clone()) .await @@ -394,23 +395,6 @@ async fn determine_town_of_us_url(among_us_version: String) -> Option<(String, S println!("Sanctioned version cannot be determined, installing experimental latest..."); line = markdown.find("[Download]"); line_offset = 15; - // println!("At this point, there are two options:"); - // println!(" [1] Revert Among Us to public-previous in Steam THEN select this option."); - // println!(" [2] Attempt to use the latest version of Town of Us anyway"); - // let mut input = String::new(); - // io::stdin().read_line(&mut input).unwrap(); - // match input.trim() { - // "1" => { - // println!("Re-attempting..."); - // return None; - // } - // "2" => { - // println!("Continuing..."); - // line = markdown.find("[Download]"); - // line_offset = 15; - // } - // _ => return None, - // }; } // 100% scientific "-15" here to get the correct version since we find to [Download] above which is after the version number for that line let splits = markdown.split_at(line.unwrap() - line_offset); @@ -461,27 +445,9 @@ fn determine_among_us_version(folder_root: String) -> Option { let offset: usize = usize::from(file_bytes[file_index]); file_index += 4; - // let mut offset = 10; - - // if file_bytes[file_index + 9] == 0 { - // offset -= 1; - // } - // if file_bytes[file_index + 8] == 0 { - // offset -= 1; - // } - - // println!( - // "|{}|", - // str::from_utf8(file_bytes.get(file_index..file_index + offset).unwrap()).unwrap() - // ); - let ver = AmongUsVersion::from( + Some(AmongUsVersion::from( str::from_utf8(file_bytes.get(file_index..file_index + offset).unwrap()).unwrap(), - ); - println!("AmongUsVersion: {}", ver); - Some(ver) - // Some(String::from( - // str::from_utf8(file_bytes.get(file_index..file_index + offset).unwrap()).unwrap(), - // )) + )) } fn copy_folder_to_target>(source: T, dest: T) {