bool fileCorrupt(ClientFile f) { //check if exists if (File.Exists(f.installpath)) { return(true); } return(true); }
void downloadFile(ClientFile f) { if (fileCorrupt(f)) { if (config.gameDirectory == @"\") { config.gameDirectory = Directory.GetCurrentDirectory(); } string installpath = config.gameDirectory + f.installpath.Replace("/", @"\"); string installdir = System.IO.Path.GetDirectoryName(installpath); //create dirs if they don't exist Directory.CreateDirectory(installdir); //wc.DownloadFile(f.dlpath, installpath ); wc.DownloadFile(f.dlpath, installpath); } // download }