From 33c3d611fdfea271fee9a5fb419a665109c947ad Mon Sep 17 00:00:00 2001 From: HeroponRikiBestest Date: Wed, 7 Jan 2026 17:35:00 -0700 Subject: [PATCH 1/6] Initial commit --- MPF.Frontend/Tools/PhysicalTool.cs | 278 ++++++++++++++++++++++ MPF.Frontend/Tools/SubmissionGenerator.cs | 8 + 2 files changed, 286 insertions(+) diff --git a/MPF.Frontend/Tools/PhysicalTool.cs b/MPF.Frontend/Tools/PhysicalTool.cs index 89a11ae8e..88f9f0c53 100644 --- a/MPF.Frontend/Tools/PhysicalTool.cs +++ b/MPF.Frontend/Tools/PhysicalTool.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using System.Text.RegularExpressions; using Newtonsoft.Json; @@ -155,6 +156,283 @@ public static bool GetBusEncryptionEnabled(Drive? drive) } } + #endregion + + // TODO: This could technically be PC or Mac, unsure what to call it + #region Computer + + // TODO: All 3 steam methods contain a lot of duplicated code. Is it possible to merge them? + /// + /// Get info for discs containing Steam2 (sis/sim/sid) depots + /// + /// Drive to extract information from + /// Steam2 information on success, null otherwise + public static string? GetSteam2Info(Drive? drive) + { + // If there's no drive path, we can't get exe name + if (string.IsNullOrEmpty(drive?.Name)) + return null; + + // If the folder no longer exists, we can't get any information + if (!Directory.Exists(drive!.Name)) + return null; + + try + { + string? steamInfo = ""; + var steamDepotIdList = new List(); + + // TODO: is this case-sensitive? + string[] sisPaths = Directory.GetFiles(drive.Name, "*.sis"); + + foreach (string sis in sisPaths) + { + if (!File.Exists(sis)) + continue; + + string filename = Path.GetFileName(sis); + + // Skips steam3 sku sis files + // TODO: is this always the correct assumption? + if (filename.ToLower() == "sku.sis") + continue; + + long sisSize = new FileInfo(sis).Length; + + // Arbitrary filesize + // TODO: check all sis sizes to make sure this is good + if (sisSize < 1000000) + continue; + + // Read the sku sis file + using var fileStream = new FileStream(sis, FileMode.Open, FileAccess.Read); + var skuSisDeserializer = new SabreTools.Serialization.Readers.SkuSis(); + var skuSis = skuSisDeserializer.Deserialize(fileStream); + + if (skuSis != null && skuSis.VDFObject != null) + { + JToken? upper = null; + + //TODO: use ST.Serialization constants? + if (skuSis.VDFObject.TryGetValue("SKU", out var steam2Value)) + upper = steam2Value; + + if (upper == null) + continue; + + if (upper["depots"] == null) + continue; + + // TODO: why do I need to use conditional access still + var depotArr = upper["depots"]?.ToObject>(); + + if (depotArr == null) + continue; + + steamDepotIdList.AddRange(depotArr.Values.ToList()); + } + } + + var sortedArray = steamDepotIdList.Select(long.Parse).ToArray(); + + // TODO: do I need to get the environment newline here + // TODO: compatibility with pre dotnet 4.0 + steamInfo = string.Join("\n", sortedArray); + + if (steamInfo == "") + return null; + else + return steamInfo; + } + catch + { + // Absorb the exception + return null; + } + } + + /// + /// Get info for discs containing Steam2 (sis/csm/csd) depots + /// + /// Drive to extract information from + /// Steam3 information on success, null otherwise + public static string? GetSteam3Info(Drive? drive) + { + // If there's no drive path, we can't get exe name + if (string.IsNullOrEmpty(drive?.Name)) + return null; + + // If the folder no longer exists, we can't get any information + if (!Directory.Exists(drive!.Name)) + return null; + + try + { + string? steamInfo = ""; + var steamDepotIdDict = new SortedDictionary(); + + // TODO: is this case-sensitive? + string[] sisPaths = Directory.GetFiles(drive.Name, "*.sis"); + + foreach (string sis in sisPaths) + { + if (!File.Exists(sis)) + continue; + + string filename = Path.GetFileName(sis); + + // Skips steam2 sku sis files + // TODO: is this always the correct assumption? + if (filename.ToLower() != "sku.sis") + continue; + + long sisSize = new FileInfo(sis).Length; + + // Arbitrary filesize + // TODO: check all sis sizes to make sure this is good + if (sisSize < 1000000) + continue; + + // Read the sku sis file + using var fileStream = new FileStream(sis, FileMode.Open, FileAccess.Read); + var skuSisDeserializer = new SabreTools.Serialization.Readers.SkuSis(); + var skuSis = skuSisDeserializer.Deserialize(fileStream); + + if (skuSis != null && skuSis.VDFObject != null) + { + JToken? upper = null; + + //TODO: use ST.Serialization constants? + if (skuSis.VDFObject.TryGetValue("sku", out var steam3Value)) + upper = steam3Value; + + if (upper == null) + continue; + + if (upper["manifests"] == null) + continue; + + // TODO: why do I need to use conditional access still + // TODO: i dont think parsing them directly to long, long works. Fix this later, or rectify the + // TODO: others if it actually does + var depotArr = upper["manifests"]?.ToObject>(); + + if (depotArr == null) + continue; + + foreach (var depot in depotArr) + steamDepotIdDict.Add(depot.Key, depot.Value); + } + } + + // TODO: do I need to get the environment newline here + foreach (var depot in steamDepotIdDict) + { + steamInfo += $"{depot.Key} ({depot.Value})\n"; + } + + if (steamInfo == "") + return null; + else + return steamInfo; + } + catch + { + // Absorb the exception + return null; + } + } + + /// + /// Get info for discs containing Steam2 (sis/sim/sid) depots + /// + /// Drive to extract information from + /// Steam2 information on success, null otherwise + public static string? GetSteamAppInfo(Drive? drive) + { + // If there's no drive path, we can't get exe name + if (string.IsNullOrEmpty(drive?.Name)) + return null; + + // If the folder no longer exists, we can't get any information + if (!Directory.Exists(drive!.Name)) + return null; + + try + { + string? steamInfo = ""; + var steamAppIdList = new List(); + + // TODO: is this case-sensitive? + string[] sisPaths = Directory.GetFiles(drive.Name, "*.sis"); + + // Looping needed in case i.e. this is a coverdisc with multiple steam game installers on it. + foreach (string sis in sisPaths) + { + if (!File.Exists(sis)) + continue; + + string filename = Path.GetFileName(sis); + + // Skips steam3 sku sis files + // TODO: is this always the correct assumption? + if (filename.ToLower() == "sku.sis") + continue; + + long sisSize = new FileInfo(sis).Length; + + // Arbitrary filesize + // TODO: check all sis sizes to make sure this is good + if (sisSize < 1000000) + continue; + + // Read the sku sis file + using var fileStream = new FileStream(sis, FileMode.Open, FileAccess.Read); + var skuSisDeserializer = new SabreTools.Serialization.Readers.SkuSis(); + var skuSis = skuSisDeserializer.Deserialize(fileStream); + + if (skuSis != null && skuSis.VDFObject != null) + { + JToken? upper = null; + + //TODO: use ST.Serialization constants? + if (skuSis.VDFObject.TryGetValue("SKU", out var steam2Value)) + upper = steam2Value; + else if (skuSis.VDFObject.TryGetValue("sku", out var steam3Value)) + upper = steam3Value; + + if (upper == null) + continue; + + if (upper["apps"] == null) + continue; + + // TODO: why do I need to use conditional access still + var appArr = upper["apps"]?.ToObject>(); + + if (appArr == null) + continue; + + steamAppIdList.AddRange(appArr.Values.ToList()); + } + } + + var sortedArray = steamAppIdList.Select(long.Parse).ToArray(); + // TODO: compatibility with pre dotnet 4.0 + steamInfo = string.Join(", ", sortedArray); + + if (steamInfo == "") + return null; + else + return steamInfo; + } + catch + { + // Absorb the exception + return null; + } + } + #endregion #region PlayStation diff --git a/MPF.Frontend/Tools/SubmissionGenerator.cs b/MPF.Frontend/Tools/SubmissionGenerator.cs index b601adc0b..e4ad6e5c8 100644 --- a/MPF.Frontend/Tools/SubmissionGenerator.cs +++ b/MPF.Frontend/Tools/SubmissionGenerator.cs @@ -817,6 +817,14 @@ private static bool ProcessSystem(SubmissionInfo info, RedumpSystem? system, Dri case RedumpSystem.SonyElectronicBook: info.CommonDiscInfo.Category ??= DiscCategory.Multimedia; break; + + // TODO: check if this actually works after you hook up redumplib too + case RedumpSystem.IBMPCcompatible: + case RedumpSystem.AppleMacintosh: + info.CommonDiscInfo.CommentsSpecialFields[SiteCode.SteamAppID] = PhysicalTool.GetSteamAppInfo(drive) ?? string.Empty; + info.CommonDiscInfo.ContentsSpecialFields[SiteCode.Steam2DepotID] = PhysicalTool.GetSteam2Info(drive) ?? string.Empty; + info.CommonDiscInfo.ContentsSpecialFields[SiteCode.Steam3DepotID] = PhysicalTool.GetSteam3Info(drive) ?? string.Empty; + break; case RedumpSystem.IncredibleTechnologiesEagle: info.CommonDiscInfo.EXEDateBuildDate ??= addPlaceholders ? RequiredValue : string.Empty; From 115a18dcadaca767ec89c4786e51345aace0d0e8 Mon Sep 17 00:00:00 2001 From: HeroponRikiBestest Date: Sun, 18 Jan 2026 16:46:28 -0500 Subject: [PATCH 2/6] Final aside from comments --- MPF.Frontend/Tools/PhysicalTool.cs | 97 +++++++++++++++++++----------- 1 file changed, 61 insertions(+), 36 deletions(-) diff --git a/MPF.Frontend/Tools/PhysicalTool.cs b/MPF.Frontend/Tools/PhysicalTool.cs index 88f9f0c53..5a490f0dc 100644 --- a/MPF.Frontend/Tools/PhysicalTool.cs +++ b/MPF.Frontend/Tools/PhysicalTool.cs @@ -169,7 +169,7 @@ public static bool GetBusEncryptionEnabled(Drive? drive) /// Steam2 information on success, null otherwise public static string? GetSteam2Info(Drive? drive) { - // If there's no drive path, we can't get exe name + // If there's no drive path, we can't get any sis files if (string.IsNullOrEmpty(drive?.Name)) return null; @@ -182,8 +182,14 @@ public static bool GetBusEncryptionEnabled(Drive? drive) string? steamInfo = ""; var steamDepotIdList = new List(); - // TODO: is this case-sensitive? - string[] sisPaths = Directory.GetFiles(drive.Name, "*.sis"); + // ? needed due to note in note in https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles +#if NETFRAMEWORK + // TODO: it does not seem like there's a non-annoying way to recurse in netframework? + string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", SearchOption.AllDirectories); +#else + var options = new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive, RecurseSubdirectories = true }; + string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", options); +#endif foreach (string sis in sisPaths) { @@ -199,9 +205,8 @@ public static bool GetBusEncryptionEnabled(Drive? drive) long sisSize = new FileInfo(sis).Length; - // Arbitrary filesize - // TODO: check all sis sizes to make sure this is good - if (sisSize < 1000000) + // Arbitrary filesize cap, a disc would need over 100x the normal amount of depots to go over this. + if (sisSize > 10000) continue; // Read the sku sis file @@ -212,8 +217,12 @@ public static bool GetBusEncryptionEnabled(Drive? drive) if (skuSis != null && skuSis.VDFObject != null) { JToken? upper = null; - - //TODO: use ST.Serialization constants? + + // One single case is known where this isn't true, RID 70147. As of writing, the page claims + // it's .sis/.csm/.csd, this isn't true, it's .sis/.sim/.sid. It's one of the latest + // .sis/.sim/.sim discs, if not the latest, and the only one currently known to use "sku" instead + // of "SKU". It's most likely safe to remove this, but to err on the side of caution, this should + // remain to avoid any risk of double-filling info until a much larger amount of testing is done. if (skuSis.VDFObject.TryGetValue("SKU", out var steam2Value)) upper = steam2Value; @@ -235,10 +244,13 @@ public static bool GetBusEncryptionEnabled(Drive? drive) var sortedArray = steamDepotIdList.Select(long.Parse).ToArray(); - // TODO: do I need to get the environment newline here - // TODO: compatibility with pre dotnet 4.0 +#if NET20 || NET35 + var compatibilitySortedArray = sortedArray.Select(x => x.ToString()).ToArray(); + steamInfo = string.Join("\n", compatibilitySortedArray); +#else steamInfo = string.Join("\n", sortedArray); - +#endif + if (steamInfo == "") return null; else @@ -271,8 +283,14 @@ public static bool GetBusEncryptionEnabled(Drive? drive) string? steamInfo = ""; var steamDepotIdDict = new SortedDictionary(); - // TODO: is this case-sensitive? - string[] sisPaths = Directory.GetFiles(drive.Name, "*.sis"); + // ? needed due to note in note in https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles +#if NETFRAMEWORK + // TODO: it does not seem like there's a non-annoying way to recurse in netframework? + string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", SearchOption.AllDirectories); +#else + var options = new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive, RecurseSubdirectories = true }; + string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", options); +#endif foreach (string sis in sisPaths) { @@ -282,15 +300,13 @@ public static bool GetBusEncryptionEnabled(Drive? drive) string filename = Path.GetFileName(sis); // Skips steam2 sku sis files - // TODO: is this always the correct assumption? if (filename.ToLower() != "sku.sis") continue; long sisSize = new FileInfo(sis).Length; - // Arbitrary filesize - // TODO: check all sis sizes to make sure this is good - if (sisSize < 1000000) + // Arbitrary filesize cap, a disc would need over 100x the normal amount of depots to go over this. + if (sisSize > 10000) continue; // Read the sku sis file @@ -302,7 +318,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) { JToken? upper = null; - //TODO: use ST.Serialization constants? if (skuSis.VDFObject.TryGetValue("sku", out var steam3Value)) upper = steam3Value; @@ -325,7 +340,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) } } - // TODO: do I need to get the environment newline here foreach (var depot in steamDepotIdDict) { steamInfo += $"{depot.Key} ({depot.Value})\n"; @@ -363,8 +377,14 @@ public static bool GetBusEncryptionEnabled(Drive? drive) string? steamInfo = ""; var steamAppIdList = new List(); - // TODO: is this case-sensitive? - string[] sisPaths = Directory.GetFiles(drive.Name, "*.sis"); + // ? needed due to note in note in https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles +#if NETFRAMEWORK + // TODO: it does not seem like there's a non-annoying way to recurse in netframework? + string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", SearchOption.AllDirectories); +#else + var options = new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive, RecurseSubdirectories = true }; + string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", options); +#endif // Looping needed in case i.e. this is a coverdisc with multiple steam game installers on it. foreach (string sis in sisPaths) @@ -374,16 +394,10 @@ public static bool GetBusEncryptionEnabled(Drive? drive) string filename = Path.GetFileName(sis); - // Skips steam3 sku sis files - // TODO: is this always the correct assumption? - if (filename.ToLower() == "sku.sis") - continue; - long sisSize = new FileInfo(sis).Length; - // Arbitrary filesize - // TODO: check all sis sizes to make sure this is good - if (sisSize < 1000000) + // Arbitrary filesize cap, a disc would need over 100x the normal amount of depots to go over this. + if (sisSize > 10000) continue; // Read the sku sis file @@ -395,7 +409,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) { JToken? upper = null; - //TODO: use ST.Serialization constants? if (skuSis.VDFObject.TryGetValue("SKU", out var steam2Value)) upper = steam2Value; else if (skuSis.VDFObject.TryGetValue("sku", out var steam3Value)) @@ -404,23 +417,35 @@ public static bool GetBusEncryptionEnabled(Drive? drive) if (upper == null) continue; - if (upper["apps"] == null) + string? appsString = null; + + // Some newer Steam3 discs (RID 114373 & 114374, 126740) use Apps instead of apps. + if (upper["apps"] != null) + appsString = "apps"; + else if (upper["Apps"] != null) + appsString = "Apps"; + else continue; // TODO: why do I need to use conditional access still - var appArr = upper["apps"]?.ToObject>(); - + var appArr = upper[appsString]?.ToObject>(); + if (appArr == null) - continue; + continue; steamAppIdList.AddRange(appArr.Values.ToList()); } } var sortedArray = steamAppIdList.Select(long.Parse).ToArray(); - // TODO: compatibility with pre dotnet 4.0 + +#if NET20 || NET35 + var compatibilitySortedArray = sortedArray.Select(x => x.ToString()).ToArray(); + steamInfo = string.Join(", ", compatibilitySortedArray); +#else steamInfo = string.Join(", ", sortedArray); - +#endif + if (steamInfo == "") return null; else From 07a0b526e7e98df633a48ea03303ec19771bfd19 Mon Sep 17 00:00:00 2001 From: HeroponRikiBestest Date: Sun, 18 Jan 2026 16:49:14 -0500 Subject: [PATCH 3/6] Remove TODOs --- MPF.Frontend/Tools/PhysicalTool.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/MPF.Frontend/Tools/PhysicalTool.cs b/MPF.Frontend/Tools/PhysicalTool.cs index 5a490f0dc..425cef132 100644 --- a/MPF.Frontend/Tools/PhysicalTool.cs +++ b/MPF.Frontend/Tools/PhysicalTool.cs @@ -158,10 +158,8 @@ public static bool GetBusEncryptionEnabled(Drive? drive) #endregion - // TODO: This could technically be PC or Mac, unsure what to call it #region Computer - // TODO: All 3 steam methods contain a lot of duplicated code. Is it possible to merge them? /// /// Get info for discs containing Steam2 (sis/sim/sid) depots /// @@ -184,7 +182,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) // ? needed due to note in note in https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles #if NETFRAMEWORK - // TODO: it does not seem like there's a non-annoying way to recurse in netframework? string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", SearchOption.AllDirectories); #else var options = new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive, RecurseSubdirectories = true }; @@ -199,7 +196,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) string filename = Path.GetFileName(sis); // Skips steam3 sku sis files - // TODO: is this always the correct assumption? if (filename.ToLower() == "sku.sis") continue; @@ -232,7 +228,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) if (upper["depots"] == null) continue; - // TODO: why do I need to use conditional access still var depotArr = upper["depots"]?.ToObject>(); if (depotArr == null) @@ -285,7 +280,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) // ? needed due to note in note in https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles #if NETFRAMEWORK - // TODO: it does not seem like there's a non-annoying way to recurse in netframework? string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", SearchOption.AllDirectories); #else var options = new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive, RecurseSubdirectories = true }; @@ -326,10 +320,7 @@ public static bool GetBusEncryptionEnabled(Drive? drive) if (upper["manifests"] == null) continue; - - // TODO: why do I need to use conditional access still - // TODO: i dont think parsing them directly to long, long works. Fix this later, or rectify the - // TODO: others if it actually does + var depotArr = upper["manifests"]?.ToObject>(); if (depotArr == null) @@ -379,7 +370,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) // ? needed due to note in note in https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles #if NETFRAMEWORK - // TODO: it does not seem like there's a non-annoying way to recurse in netframework? string[] sisPaths = Directory.GetFiles(drive.Name, "?*.sis", SearchOption.AllDirectories); #else var options = new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive, RecurseSubdirectories = true }; @@ -427,7 +417,6 @@ public static bool GetBusEncryptionEnabled(Drive? drive) else continue; - // TODO: why do I need to use conditional access still var appArr = upper[appsString]?.ToObject>(); if (appArr == null) From 6bd4db59a2f8597398e639ac7b4015c02a874029 Mon Sep 17 00:00:00 2001 From: HeroponRikiBestest Date: Sun, 18 Jan 2026 16:49:48 -0500 Subject: [PATCH 4/6] Missed one --- MPF.Frontend/Tools/SubmissionGenerator.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/MPF.Frontend/Tools/SubmissionGenerator.cs b/MPF.Frontend/Tools/SubmissionGenerator.cs index e4ad6e5c8..699755c95 100644 --- a/MPF.Frontend/Tools/SubmissionGenerator.cs +++ b/MPF.Frontend/Tools/SubmissionGenerator.cs @@ -818,7 +818,6 @@ private static bool ProcessSystem(SubmissionInfo info, RedumpSystem? system, Dri info.CommonDiscInfo.Category ??= DiscCategory.Multimedia; break; - // TODO: check if this actually works after you hook up redumplib too case RedumpSystem.IBMPCcompatible: case RedumpSystem.AppleMacintosh: info.CommonDiscInfo.CommentsSpecialFields[SiteCode.SteamAppID] = PhysicalTool.GetSteamAppInfo(drive) ?? string.Empty; From 8c431f3a6f7b6b22cbf2bac8de6976c4ef0008cc Mon Sep 17 00:00:00 2001 From: HeroponRikiBestest Date: Sun, 18 Jan 2026 17:21:23 -0500 Subject: [PATCH 5/6] Forgot natural sorting was needed. --- MPF.Frontend/Tools/PhysicalTool.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MPF.Frontend/Tools/PhysicalTool.cs b/MPF.Frontend/Tools/PhysicalTool.cs index 425cef132..0b383ab76 100644 --- a/MPF.Frontend/Tools/PhysicalTool.cs +++ b/MPF.Frontend/Tools/PhysicalTool.cs @@ -238,6 +238,7 @@ public static bool GetBusEncryptionEnabled(Drive? drive) } var sortedArray = steamDepotIdList.Select(long.Parse).ToArray(); + Array.Sort(sortedArray); #if NET20 || NET35 var compatibilitySortedArray = sortedArray.Select(x => x.ToString()).ToArray(); @@ -327,7 +328,11 @@ public static bool GetBusEncryptionEnabled(Drive? drive) continue; foreach (var depot in depotArr) - steamDepotIdDict.Add(depot.Key, depot.Value); +#if NETFRAMEWORK + steamDepotIdDict.Add(depot.Key, depot.Value); // Always fine in practice. +#else + steamDepotIdDict.TryAdd(depot.Key, depot.Value); // Mainly here to allow easier bulk testing. +#endif } } @@ -427,6 +432,7 @@ public static bool GetBusEncryptionEnabled(Drive? drive) } var sortedArray = steamAppIdList.Select(long.Parse).ToArray(); + Array.Sort(sortedArray); #if NET20 || NET35 var compatibilitySortedArray = sortedArray.Select(x => x.ToString()).ToArray(); From f9976b910b33d28a0bff8f2e791f51d02f74860d Mon Sep 17 00:00:00 2001 From: HeroponRikiBestest Date: Thu, 22 Jan 2026 21:30:09 -0500 Subject: [PATCH 6/6] Fix naming --- MPF.Frontend/Tools/PhysicalTool.cs | 28 +++++++++++------------ MPF.Frontend/Tools/SubmissionGenerator.cs | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/MPF.Frontend/Tools/PhysicalTool.cs b/MPF.Frontend/Tools/PhysicalTool.cs index 0b383ab76..a1b985e0d 100644 --- a/MPF.Frontend/Tools/PhysicalTool.cs +++ b/MPF.Frontend/Tools/PhysicalTool.cs @@ -165,7 +165,7 @@ public static bool GetBusEncryptionEnabled(Drive? drive) /// /// Drive to extract information from /// Steam2 information on success, null otherwise - public static string? GetSteam2Info(Drive? drive) + public static string? GetSteamSimSidInfo(Drive? drive) { // If there's no drive path, we can't get any sis files if (string.IsNullOrEmpty(drive?.Name)) @@ -195,7 +195,7 @@ public static bool GetBusEncryptionEnabled(Drive? drive) string filename = Path.GetFileName(sis); - // Skips steam3 sku sis files + // Skips csm/csd sku sis files if (filename.ToLower() == "sku.sis") continue; @@ -219,8 +219,8 @@ public static bool GetBusEncryptionEnabled(Drive? drive) // .sis/.sim/.sim discs, if not the latest, and the only one currently known to use "sku" instead // of "SKU". It's most likely safe to remove this, but to err on the side of caution, this should // remain to avoid any risk of double-filling info until a much larger amount of testing is done. - if (skuSis.VDFObject.TryGetValue("SKU", out var steam2Value)) - upper = steam2Value; + if (skuSis.VDFObject.TryGetValue("SKU", out var steamSimSidValue)) + upper = steamSimSidValue; if (upper == null) continue; @@ -259,12 +259,12 @@ public static bool GetBusEncryptionEnabled(Drive? drive) } } - /// - /// Get info for discs containing Steam2 (sis/csm/csd) depots + /// + /// Get info for discs containing Steam3 (sis/csm/csd) depots /// /// Drive to extract information from - /// Steam3 information on success, null otherwise - public static string? GetSteam3Info(Drive? drive) + /// Steam Csm/Csd information on success, null otherwise + public static string? GetSteamCsmCsdInfo(Drive? drive) { // If there's no drive path, we can't get exe name if (string.IsNullOrEmpty(drive?.Name)) @@ -313,8 +313,8 @@ public static bool GetBusEncryptionEnabled(Drive? drive) { JToken? upper = null; - if (skuSis.VDFObject.TryGetValue("sku", out var steam3Value)) - upper = steam3Value; + if (skuSis.VDFObject.TryGetValue("sku", out var steamCsmCsdValue)) + upper = steamCsmCsdValue; if (upper == null) continue; @@ -404,10 +404,10 @@ public static bool GetBusEncryptionEnabled(Drive? drive) { JToken? upper = null; - if (skuSis.VDFObject.TryGetValue("SKU", out var steam2Value)) - upper = steam2Value; - else if (skuSis.VDFObject.TryGetValue("sku", out var steam3Value)) - upper = steam3Value; + if (skuSis.VDFObject.TryGetValue("SKU", out var steamSimSidValue)) + upper = steamSimSidValue; + else if (skuSis.VDFObject.TryGetValue("sku", out var steamCsmCsdValue)) + upper = steamCsmCsdValue; if (upper == null) continue; diff --git a/MPF.Frontend/Tools/SubmissionGenerator.cs b/MPF.Frontend/Tools/SubmissionGenerator.cs index 699755c95..64b3e354b 100644 --- a/MPF.Frontend/Tools/SubmissionGenerator.cs +++ b/MPF.Frontend/Tools/SubmissionGenerator.cs @@ -821,8 +821,8 @@ private static bool ProcessSystem(SubmissionInfo info, RedumpSystem? system, Dri case RedumpSystem.IBMPCcompatible: case RedumpSystem.AppleMacintosh: info.CommonDiscInfo.CommentsSpecialFields[SiteCode.SteamAppID] = PhysicalTool.GetSteamAppInfo(drive) ?? string.Empty; - info.CommonDiscInfo.ContentsSpecialFields[SiteCode.Steam2DepotID] = PhysicalTool.GetSteam2Info(drive) ?? string.Empty; - info.CommonDiscInfo.ContentsSpecialFields[SiteCode.Steam3DepotID] = PhysicalTool.GetSteam3Info(drive) ?? string.Empty; + info.CommonDiscInfo.ContentsSpecialFields[SiteCode.SteamSimSidDepotID] = PhysicalTool.GetSteamSimSidInfo(drive) ?? string.Empty; + info.CommonDiscInfo.ContentsSpecialFields[SiteCode.SteamCsmCsdDepotID] = PhysicalTool.GetSteamCsmCsdInfo(drive) ?? string.Empty; break; case RedumpSystem.IncredibleTechnologiesEagle: