Confirm SoftLock path checks

This commit is contained in:
Matt Nadareski
2022-12-19 20:49:10 -08:00
parent b2ed69ab78
commit 28391de50c
2 changed files with 9 additions and 7 deletions

View File

@@ -10,14 +10,16 @@ namespace BurnOutSharp.ProtectionType
/// <inheritdoc/>
public ConcurrentQueue<string> CheckDirectoryPath(string path, IEnumerable<string> files)
{
// TODO: Verify if these are OR or AND
var matchers = new List<PathMatchSet>
{
new PathMatchSet(new PathMatch("SOFTLOCKI.dat", useEndsWith: true), "SoftLock (Unconfirmed - Please report to us on Github)"),
new PathMatchSet(new PathMatch("SOFTLOCKC.dat", useEndsWith: true), "SoftLock (Unconfirmed - Please report to us on Github)"),
new PathMatchSet(new List<PathMatch>
{
new PathMatch(needle: "SOFTLOCKC.dat", useEndsWith: true),
new PathMatch("SOFTLOCKI.dat", useEndsWith: true),
}, "SoftLock"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
return MatchUtil.GetAllMatches(files, matchers, any: false);
}
/// <inheritdoc/>
@@ -25,8 +27,8 @@ namespace BurnOutSharp.ProtectionType
{
var matchers = new List<PathMatchSet>
{
new PathMatchSet(new PathMatch("SOFTLOCKI.dat", useEndsWith: true), "SoftLock (Unconfirmed - Please report to us on Github)"),
new PathMatchSet(new PathMatch("SOFTLOCKC.dat", useEndsWith: true), "SoftLock (Unconfirmed - Please report to us on Github)"),
new PathMatchSet(new PathMatch("SOFTLOCKC.dat", useEndsWith: true), "SoftLock"),
new PathMatchSet(new PathMatch("SOFTLOCKI.dat", useEndsWith: true), "SoftLock"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);