Scan whole folder for MPQ

This commit is contained in:
Matt Nadareski
2020-10-28 12:20:36 -07:00
parent 4a6e2fd62d
commit 9802840309

View File

@@ -48,24 +48,14 @@ namespace BurnOutSharp.FileType
string tempFile = Path.Combine(tempPath, sub);
Directory.CreateDirectory(Path.GetDirectoryName(tempFile));
mpqArchive.ExtractFile(sub, tempFile);
// Collect and format all found protections
var fileProtections = ProtectionFind.Scan(tempFile, includePosition);
string protection = string.Join("\r\n", fileProtections.Select(kvp => kvp.Key + ": " + kvp.Value.TrimEnd()));
// If tempfile cleanup fails
try
{
File.Delete(tempFile);
}
catch { }
if (!string.IsNullOrEmpty(protection))
protections.Add($"\r\n{sub} - {protection}");
}
catch { }
}
// Collect and format all found protections
var fileProtections = ProtectionFind.Scan(tempPath, includePosition);
protections = fileProtections.Select(kvp => kvp.Key + ": " + kvp.Value.TrimEnd()).ToList();
// If temp directory cleanup fails
try
{