removed symlink creation
This commit is contained in:
@@ -29,21 +29,25 @@ public class MyModpackV1
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public bool CheckFiles(IOPath basedir, bool checkHashes, bool downloadOptionalFiles, HashSet<IOPath> unmatchedFilesLocalPaths)
|
||||
/// <param name="unmatchedFilesLocalPaths">relative, absolute</param>
|
||||
public Dictionary<IOPath, IOPath> CheckFiles(IOPath basedir, bool checkHashes, bool downloadOptionalFiles)
|
||||
{
|
||||
Dictionary<IOPath, IOPath> unmatchedFiles = new();
|
||||
IOPath launcherRoot = PathHelper.GetRootFullPath();
|
||||
foreach (var p in files)
|
||||
{
|
||||
if(!downloadOptionalFiles && p.Value.optional)
|
||||
continue;
|
||||
|
||||
var localPath = new IOPath(p.Key);
|
||||
var realPath = Path.Concat(basedir, localPath);
|
||||
if (!HashHelper.CheckFileSHA1(realPath, p.Value.sha1, checkHashes && !p.Value.allow_edit))
|
||||
IOPath relativePath = new IOPath(p.Key);
|
||||
var absolutePath = Path.Concat(relativePath.StartsWith("libraries")
|
||||
? launcherRoot : basedir, relativePath);
|
||||
if (!HashHelper.CheckFileSHA1(absolutePath, p.Value.sha1, checkHashes && !p.Value.allow_edit))
|
||||
{
|
||||
unmatchedFilesLocalPaths.Add(localPath);
|
||||
unmatchedFiles.Add(relativePath, absolutePath);
|
||||
}
|
||||
}
|
||||
|
||||
return unmatchedFilesLocalPaths.Count == 0;
|
||||
|
||||
return unmatchedFiles;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user