Fix ~3500 analyser issues

See merge request ryubing/ryujinx!44
This commit is contained in:
MrKev
2025-05-30 17:08:34 -05:00
committed by LotP
parent 417df486b1
commit 361d0c5632
622 changed files with 3080 additions and 2652 deletions

View File

@@ -500,6 +500,7 @@ namespace Ryujinx.HLE.HOS
{
AddFiles(fs, mod.Name, mod.Path.FullName, fileSet, builder);
}
count++;
}
@@ -516,6 +517,7 @@ namespace Ryujinx.HLE.HOS
{
AddFiles(fs, mod.Name, mod.Path.FullName, fileSet, builder);
}
count++;
}
@@ -547,7 +549,7 @@ namespace Ryujinx.HLE.HOS
return newStorage;
}
private static void AddFiles(IFileSystem fs, string modName, string rootPath, ISet<string> fileSet, RomFsBuilder builder)
private static void AddFiles(IFileSystem fs, string modName, string rootPath, HashSet<string> fileSet, RomFsBuilder builder)
{
foreach (DirectoryEntryEx entry in fs.EnumerateEntries()
.AsParallel()
@@ -644,16 +646,11 @@ namespace Ryujinx.HLE.HOS
modLoadResult.Replaces[1 << i] = true;
using (FileStream stream = nsoFile.OpenRead())
{
nsos[i] = new NsoExecutable(stream.AsStorage(), nsoName);
Logger.Info?.Print(LogClass.ModLoader, $"NSO '{nsoName}' replaced");
using (MD5 md5 = MD5.Create())
{
stream.Seek(0, SeekOrigin.Begin);
tempHash += BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", "").ToLowerInvariant();
}
}
using FileStream stream = nsoFile.OpenRead();
nsos[i] = new NsoExecutable(stream.AsStorage(), nsoName);
Logger.Info?.Print(LogClass.ModLoader, $"NSO '{nsoName}' replaced");
stream.Seek(0, SeekOrigin.Begin);
tempHash += Convert.ToHexStringLower(MD5.HashData(stream));
}
modLoadResult.Stubs[1 << i] |= File.Exists(Path.Combine(mod.Path.FullName, nsoName + StubExtension));
@@ -687,10 +684,7 @@ namespace Ryujinx.HLE.HOS
if (!string.IsNullOrEmpty(tempHash))
{
using (MD5 md5 = MD5.Create())
{
modLoadResult.Hash += BitConverter.ToString(md5.ComputeHash(tempHash.ToBytes())).Replace("-", string.Empty).ToLowerInvariant();
}
modLoadResult.Hash += Convert.ToHexStringLower(MD5.HashData(tempHash.ToBytes()));
}
return modLoadResult;