mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Disabled manual game files
This commit is contained in:
parent
f60c1e3c8a
commit
dcf0113c17
@ -33,7 +33,7 @@ namespace Wabbajack.Common
|
||||
public static string WABBAJACK_INCLUDE = "WABBAJACK_INCLUDE";
|
||||
public static string WABBAJACK_ALWAYS_ENABLE = "WABBAJACK_ALWAYS_ENABLE";
|
||||
public static string WABBAJACK_NOMATCH_INCLUDE = "WABBAJACK_NOMATCH_INCLUDE";
|
||||
public static string WABBAJACK_VORTEX_MANUAL = "WABBAJACK_VORTEX_MANUAL";
|
||||
//public static string WABBAJACK_VORTEX_MANUAL = "WABBAJACK_VORTEX_MANUAL";
|
||||
|
||||
public static string GAME_PATH_MAGIC_BACK = "{--||GAME_PATH_MAGIC_BACK||--}";
|
||||
public static string GAME_PATH_MAGIC_DOUBLE_BACK = "{--||GAME_PATH_MAGIC_DOUBLE_BACK||--}";
|
||||
|
@ -24,7 +24,7 @@ namespace Wabbajack.Lib
|
||||
typeof(BSAStateObject), typeof(BSAFileStateObject), typeof(BA2StateObject), typeof(BA2DX10EntryState),
|
||||
typeof(BA2FileEntryState), typeof(MediaFireDownloader.State), typeof(ArchiveMeta),
|
||||
typeof(PropertyFile), typeof(SteamMeta), typeof(SteamWorkshopDownloader), typeof(SteamWorkshopDownloader.State),
|
||||
typeof(LoversLabDownloader.State), typeof(GameFileSourceDownloader.State)
|
||||
typeof(LoversLabDownloader.State), //typeof(GameFileSourceDownloader.State)
|
||||
|
||||
}
|
||||
};
|
||||
|
@ -10,7 +10,7 @@ namespace Wabbajack.Lib.Downloaders
|
||||
{
|
||||
public static readonly List<IDownloader> Downloaders = new List<IDownloader>()
|
||||
{
|
||||
new GameFileSourceDownloader(),
|
||||
//new GameFileSourceDownloader(),
|
||||
new MegaDownloader(),
|
||||
new DropboxDownloader(),
|
||||
new GoogleDriveDownloader(),
|
||||
|
@ -1,86 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Alphaleonis.Win32.Filesystem;
|
||||
using Wabbajack.Common;
|
||||
using Wabbajack.Lib.Validation;
|
||||
using File = Alphaleonis.Win32.Filesystem.File;
|
||||
using Game = Wabbajack.Common.Game;
|
||||
|
||||
namespace Wabbajack.Lib.Downloaders
|
||||
{
|
||||
public class GameFileSourceDownloader : IDownloader
|
||||
{
|
||||
public async Task<AbstractDownloadState> GetDownloaderState(dynamic archiveINI)
|
||||
{
|
||||
var gameName = (string)archiveINI?.General?.gameName;
|
||||
var gameFile = (string)archiveINI?.General?.gameFile;
|
||||
|
||||
if (gameFile == null || gameFile == null)
|
||||
return null;
|
||||
|
||||
var game = GameRegistry.GetByMO2ArchiveName(gameName);
|
||||
if (game == null) return null;
|
||||
|
||||
var path = game.GameLocation();
|
||||
var filePath = Path.Combine(path, gameFile);
|
||||
|
||||
if (!File.Exists(filePath))
|
||||
return null;
|
||||
|
||||
var hash = filePath.FileHashCached();
|
||||
|
||||
return new State
|
||||
{
|
||||
Game = GameRegistry.GetByMO2ArchiveName(gameName).Game,
|
||||
GameFile = gameFile,
|
||||
Hash = hash,
|
||||
};
|
||||
}
|
||||
|
||||
public async Task Prepare()
|
||||
{
|
||||
}
|
||||
|
||||
public class State : AbstractDownloadState
|
||||
{
|
||||
public Game Game { get; set; }
|
||||
public string GameFile { get; set; }
|
||||
public string Hash { get; set; }
|
||||
|
||||
internal string SourcePath => Path.Combine(Game.MetaData().GameLocation(), GameFile);
|
||||
|
||||
public override bool IsWhitelisted(ServerWhitelist whitelist)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override async Task Download(Archive a, string destination)
|
||||
{
|
||||
using(var src = File.OpenRead(SourcePath))
|
||||
using (var dest = File.OpenWrite(destination))
|
||||
{
|
||||
var size = new FileInfo(SourcePath).Length;
|
||||
src.CopyToWithStatus(size, dest, "Copying from Game folder");
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task<bool> Verify()
|
||||
{
|
||||
return File.Exists(SourcePath) && SourcePath.FileHashCached() == Hash;
|
||||
}
|
||||
|
||||
public override IDownloader GetDownloader()
|
||||
{
|
||||
return DownloadDispatcher.GetInstance<GameFileSourceDownloader>();
|
||||
}
|
||||
|
||||
public override string GetReportEntry(Archive a)
|
||||
{
|
||||
return $"* Game File {Game} - {GameFile}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Wabbajack.Common;
|
||||
|
@ -162,7 +162,7 @@ namespace Wabbajack.Lib
|
||||
Error($"Found {duplicates.Count} duplicates, exiting");
|
||||
}
|
||||
|
||||
for (var i = 0; i < AllFiles.Count; i++)
|
||||
/*for (var i = 0; i < AllFiles.Count; i++)
|
||||
{
|
||||
var f = AllFiles[i];
|
||||
if (!f.Path.StartsWith(Consts.GameFolderFilesDir) || !IndexedFiles.ContainsKey(f.Hash))
|
||||
@ -202,7 +202,7 @@ namespace Wabbajack.Lib
|
||||
AllFiles.RemoveAt(i);
|
||||
AllFiles.Insert(i, replace);
|
||||
//AllFiles.Replace(f, replace);
|
||||
}
|
||||
}*/
|
||||
|
||||
var stack = MakeStack();
|
||||
|
||||
@ -384,11 +384,11 @@ namespace Wabbajack.Lib
|
||||
if (line.Contains("tag="))
|
||||
tag = line.Substring("tag=".Length);
|
||||
|
||||
if (tag != Consts.WABBAJACK_VORTEX_MANUAL)
|
||||
//if (tag != Consts.WABBAJACK_VORTEX_MANUAL)
|
||||
return;
|
||||
|
||||
Utils.Log($"File {f} contains the {Consts.WABBAJACK_VORTEX_MANUAL} tag, adding to ActiveArchives");
|
||||
ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));
|
||||
//Utils.Log($"File {f} contains the {Consts.WABBAJACK_VORTEX_MANUAL} tag, adding to ActiveArchives");
|
||||
//ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -116,7 +116,6 @@
|
||||
<Compile Include="CompilationSteps\IStackStep.cs" />
|
||||
<Compile Include="CompilationSteps\PatchStockESMs.cs" />
|
||||
<Compile Include="CompilationSteps\Serialization.cs" />
|
||||
<Compile Include="Downloaders\GameFileSourceDownloader.cs" />
|
||||
<Compile Include="Downloaders\LoversLabDownloader.cs" />
|
||||
<Compile Include="Downloaders\SteamWorkshopDownloader.cs" />
|
||||
<Compile Include="LibCefHelpers\Init.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user