CheckPath should not call CheckContents

This commit is contained in:
Matt Nadareski
2020-02-20 14:28:26 -08:00
parent c78229c3cd
commit 0bc1d1efa6
3 changed files with 3 additions and 36 deletions

View File

@@ -249,11 +249,6 @@ namespace BurnOutSharp
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// PSX Anti-modchip
protection = PSXAntiModchip.CheckPath(path, files, isDirectory);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SafeCast
protection = SafeCast.CheckPath(path, files, isDirectory);
if (!string.IsNullOrWhiteSpace(protection))

View File

@@ -8,6 +8,7 @@ namespace BurnOutSharp.ProtectionType
{
public class CactusDataShield
{
// TODO: Get header info for CDSPlayer.app so it can be integrated better into the rest of the content checks
public static string CheckContents(string file)
{
if (Path.GetFileName(file) == "CDSPlayer.app")

View File

@@ -1,12 +1,8 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace BurnOutSharp.ProtectionType
namespace BurnOutSharp.ProtectionType
{
public class PSXAntiModchip
{
// TODO: Figure out PSX binary header so this can be checked explicitly
public static string CheckContents(string file, string fileContent)
{
// TODO: Detect Red Hand protection
@@ -18,30 +14,5 @@ namespace BurnOutSharp.ProtectionType
return null;
}
public static string CheckPath(string path, IEnumerable<string> files, bool isDirectory)
{
if (isDirectory)
{
if (files.Where(s => s.ToLowerInvariant().EndsWith(".cnf")).Count() > 0)
{
foreach (string file in files)
{
// Load the current file content
string fileContent = null;
using (StreamReader sr = new StreamReader(file, Encoding.Default))
{
fileContent = sr.ReadToEnd();
}
string protection = CheckContents(path, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
return protection;
}
}
}
return null;
}
}
}