|
@ -389,7 +389,26 @@ fn main() { |
|
|
let listener = TcpListener::bind(&SocketAddr::from((Ipv4Addr::new(0,0,0,0), PATCH_PORT))).unwrap();
|
|
|
let listener = TcpListener::bind(&SocketAddr::from((Ipv4Addr::new(0,0,0,0), PATCH_PORT))).unwrap();
|
|
|
|
|
|
|
|
|
let (patch_file_tree, patch_file_lookup) = generate_patch_tree("patchfiles/");
|
|
|
let (patch_file_tree, patch_file_lookup) = generate_patch_tree("patchfiles/");
|
|
|
|
|
|
println!("[patch] files to patch:");
|
|
|
|
|
|
let mut indent = 0;
|
|
|
|
|
|
for item in patch_file_tree.flatten() {
|
|
|
|
|
|
match item {
|
|
|
|
|
|
PatchTreeIterItem::Directory(path) => {
|
|
|
|
|
|
let s = path.to_str().unwrap();
|
|
|
|
|
|
println!("{: >2$}\u{2517}\u{2500}\u{2500} {}", "", s, indent * 4);
|
|
|
|
|
|
indent += 1;
|
|
|
|
|
|
},
|
|
|
|
|
|
PatchTreeIterItem::File(path, id) => {
|
|
|
|
|
|
let s = path.to_str().unwrap();
|
|
|
|
|
|
println!("{: >3$}\u{2520}\u{2500}\u{2500} {} ({})", "", s, id, indent * 4);
|
|
|
|
|
|
},
|
|
|
|
|
|
PatchTreeIterItem::UpDirectory => {
|
|
|
|
|
|
indent -= 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
println!("[patch] waiting for connections");
|
|
|
while let Ok((socket, addr)) = listener.accept() {
|
|
|
while let Ok((socket, addr)) = listener.accept() {
|
|
|
let local_patch_file_tree = patch_file_tree.clone();
|
|
|
let local_patch_file_tree = patch_file_tree.clone();
|
|
|
let local_patch_file_lookup = patch_file_lookup.clone();
|
|
|
let local_patch_file_lookup = patch_file_lookup.clone();
|
|
|