diff options
author | Xpl0itR <xpl0itr@outlook.com> | 2020-06-23 01:32:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 10:32:07 +1000 |
commit | 2ed9db1fcdc679aab552dc1ddeaf1e80e05ee65c (patch) | |
tree | 22b77ae34a57960527e70ca5dc932856a297ac5d /Ryujinx.HLE/HOS/ApplicationLoader.cs | |
parent | fcd187ce42b11dc0e0a6bc93c227c79772a3496a (diff) |
Implement dlc management window (#1313)
* Implement dlc management window
* reduce repetition
* Implement per NCA toggling of DLC rather than per container
Diffstat (limited to 'Ryujinx.HLE/HOS/ApplicationLoader.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/ApplicationLoader.cs | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/Ryujinx.HLE/HOS/ApplicationLoader.cs b/Ryujinx.HLE/HOS/ApplicationLoader.cs index 5ca67445..f6ab5ba9 100644 --- a/Ryujinx.HLE/HOS/ApplicationLoader.cs +++ b/Ryujinx.HLE/HOS/ApplicationLoader.cs @@ -149,17 +149,6 @@ namespace Ryujinx.HLE.HOS _contentManager.ClearAocData(); _contentManager.AddAocData(securePartition, xciFile, mainNca.Header.TitleId); - // Check all nsp's in the base directory for AOC - foreach (var fn in new FileInfo(xciFile).Directory.EnumerateFiles("*.nsp")) - { - using (FileStream fs = fn.OpenRead()) - using (IStorage storage = fs.AsStorage()) - using (PartitionFileSystem pfs = new PartitionFileSystem(storage)) - { - _contentManager.AddAocData(pfs, fn.FullName, mainNca.Header.TitleId); - } - } - LoadNca(mainNca, patchNca, controlNca); } @@ -196,18 +185,6 @@ namespace Ryujinx.HLE.HOS _contentManager.ClearAocData(); _contentManager.AddAocData(nsp, nspFile, mainNca.Header.TitleId); - // Check all nsp's in the base directory for AOC - foreach (var fn in new FileInfo(nspFile).Directory.EnumerateFiles("*.nsp")) - { - if (fn.FullName == nspFile) continue; - using (FileStream fs = fn.OpenRead()) - using (IStorage storage = fs.AsStorage()) - using (PartitionFileSystem pfs = new PartitionFileSystem(storage)) - { - _contentManager.AddAocData(pfs, fn.FullName, mainNca.Header.TitleId); - } - } - LoadNca(mainNca, patchNca, controlNca); return; @@ -238,7 +215,8 @@ namespace Ryujinx.HLE.HOS IStorage dataStorage = null; IFileSystem codeFs = null; - string titleUpdateMetadataPath = System.IO.Path.Combine(_fileSystem.GetBasePath(), "games", mainNca.Header.TitleId.ToString("x16"), "updates.json"); + // Load Update + string titleUpdateMetadataPath = Path.Combine(_fileSystem.GetBasePath(), "games", mainNca.Header.TitleId.ToString("x16"), "updates.json"); if (File.Exists(titleUpdateMetadataPath)) { @@ -274,6 +252,22 @@ namespace Ryujinx.HLE.HOS } } + // Load Aoc + string titleAocMetadataPath = Path.Combine(_fileSystem.GetBasePath(), "games", mainNca.Header.TitleId.ToString("x16"), "dlc.json"); + + if (File.Exists(titleAocMetadataPath)) + { + List<DlcContainer> dlcContainerList = JsonHelper.DeserializeFromFile<List<DlcContainer>>(titleAocMetadataPath); + + foreach (DlcContainer dlcContainer in dlcContainerList) + { + foreach (DlcNca dlcNca in dlcContainer.DlcNcaList) + { + _contentManager.AddAocItem(dlcNca.TitleId, dlcContainer.Path, dlcNca.Path, dlcNca.Enabled); + } + } + } + if (patchNca == null) { if (mainNca.CanOpenSection(NcaSectionType.Data)) |