From 92f88efd4e3653ebce3e40ad6ae4ccaf6d1d446f Mon Sep 17 00:00:00 2001 From: TheRogueArchivist Date: Wed, 28 Dec 2022 00:13:47 -0700 Subject: [PATCH] Fix false positives in Bitpool and LaserLok (#218) * Fix false positives in Bitpool and LaserLok. --- BurnOutSharp/ProtectionType/Bitpool.cs | 13 +++++++------ BurnOutSharp/ProtectionType/LaserLok.cs | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/BurnOutSharp/ProtectionType/Bitpool.cs b/BurnOutSharp/ProtectionType/Bitpool.cs index 93479335..71e67ae7 100644 --- a/BurnOutSharp/ProtectionType/Bitpool.cs +++ b/BurnOutSharp/ProtectionType/Bitpool.cs @@ -1,5 +1,6 @@ using System.Collections.Concurrent; using System.Collections.Generic; +using System.IO; using BurnOutSharp.Interfaces; using BurnOutSharp.Matching; @@ -18,7 +19,7 @@ namespace BurnOutSharp.ProtectionType var matchers = new List { new PathMatchSet(new PathMatch("bitpool.rsc", useEndsWith: true), "Bitpool"), - new PathMatchSet(new PathMatch("CD.IDX", useEndsWith: true), "Bitpool"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}CD.IDX", useEndsWith: true), "Bitpool"), // Completely empty file present on multiple discs with Bitpool (Redump entries 52626 and 50229). new PathMatchSet(new PathMatch("LEADOUT.OFS", useEndsWith: true), "Bitpool"), @@ -27,10 +28,10 @@ namespace BurnOutSharp.ProtectionType // Both examples with only having the first letter uppercase and as the whole file name being uppercase have been seen. new PathMatchSet(new List { - new PathMatch("Crc_a", useEndsWith: true), - new PathMatch("Crc_b", useEndsWith: true), - new PathMatch("Crc_c", useEndsWith: true), - new PathMatch("Crc_d", useEndsWith: true), + new PathMatch($"{Path.DirectorySeparatorChar}Crc_a", useEndsWith: true), + new PathMatch($"{Path.DirectorySeparatorChar}Crc_b", useEndsWith: true), + new PathMatch($"{Path.DirectorySeparatorChar}Crc_c", useEndsWith: true), + new PathMatch($"{Path.DirectorySeparatorChar}Crc_d", useEndsWith: true), }, "Bitpool"), }; @@ -43,7 +44,7 @@ namespace BurnOutSharp.ProtectionType var matchers = new List { new PathMatchSet(new PathMatch("bitpool.rsc", useEndsWith: true), "Bitpool"), - new PathMatchSet(new PathMatch("CD.IDX", useEndsWith: true), "Bitpool"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}CD.IDX", useEndsWith: true), "Bitpool"), // Completely empty file present on multiple discs with Bitpool (Redump entries 52626 and 50229). new PathMatchSet(new PathMatch("LEADOUT.OFS", useEndsWith: true), "Bitpool"), diff --git a/BurnOutSharp/ProtectionType/LaserLok.cs b/BurnOutSharp/ProtectionType/LaserLok.cs index db29a776..1ddd64f8 100644 --- a/BurnOutSharp/ProtectionType/LaserLok.cs +++ b/BurnOutSharp/ProtectionType/LaserLok.cs @@ -112,8 +112,8 @@ namespace BurnOutSharp.ProtectionType new PathMatchSet($"LASERLOK{Path.DirectorySeparatorChar}", "LaserLok [Check disc for physical ring]"), // TODO: Verify if these are OR or AND - new PathMatchSet(new PathMatch("NOMOUSE.SP", useEndsWith: true), GetVersion16Bit, "LaserLok [Check disc for physical ring]"), - new PathMatchSet(new PathMatch("NOMOUSE.COM", useEndsWith: true), "LaserLok [Check disc for physical ring]"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}NOMOUSE.SP", useEndsWith: true), GetVersion16Bit, "LaserLok [Check disc for physical ring]"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}NOMOUSE.COM", useEndsWith: true), "LaserLok [Check disc for physical ring]"), new PathMatchSet(new PathMatch("l16dll.dll", useEndsWith: true), "LaserLok [Check disc for physical ring]"), new PathMatchSet(new PathMatch("laserlok.in", useEndsWith: true), "LaserLok [Check disc for physical ring]"), new PathMatchSet(new PathMatch("laserlok.o10", useEndsWith: true), "LaserLok [Check disc for physical ring]"), @@ -130,10 +130,10 @@ namespace BurnOutSharp.ProtectionType { var matchers = new List { - new PathMatchSet(new PathMatch("NOMOUSE.SP", useEndsWith: true), GetVersion16Bit, "LaserLok [Check disc for physical ring]"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}NOMOUSE.SP", useEndsWith: true), GetVersion16Bit, "LaserLok [Check disc for physical ring]"), // TODO: Verify if these are OR or AND - new PathMatchSet(new PathMatch("NOMOUSE.COM", useEndsWith: true), "LaserLok [Check disc for physical ring]"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}NOMOUSE.COM", useEndsWith: true), "LaserLok [Check disc for physical ring]"), new PathMatchSet(new PathMatch("l16dll.dll", useEndsWith: true), "LaserLok [Check disc for physical ring]"), new PathMatchSet(new PathMatch("laserlok.in", useEndsWith: true), "LaserLok [Check disc for physical ring]"), new PathMatchSet(new PathMatch("laserlok.o10", useEndsWith: true), "LaserLok [Check disc for physical ring]"),