From df3d6b4179e2f73e88d0beb20ec26008dd5f0fa5 Mon Sep 17 00:00:00 2001 From: erri120 Date: Sun, 27 Oct 2019 13:12:35 +0100 Subject: [PATCH] Created CerasConfig with KnownTypes --- Wabbajack.Lib/CerasConfig.cs | 27 +++++++++++++++++++++++++++ Wabbajack.Lib/Compiler.cs | 2 +- Wabbajack.Lib/Installer.cs | 2 +- Wabbajack.Lib/Wabbajack.Lib.csproj | 1 + 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Wabbajack.Lib/CerasConfig.cs diff --git a/Wabbajack.Lib/CerasConfig.cs b/Wabbajack.Lib/CerasConfig.cs new file mode 100644 index 00000000..1c2d8b6d --- /dev/null +++ b/Wabbajack.Lib/CerasConfig.cs @@ -0,0 +1,27 @@ +using Ceras; +using Compression.BSA; +using VFS; +using Wabbajack.Common; +using Wabbajack.Lib.Downloaders; + +namespace Wabbajack.Lib +{ + public class CerasConfig + { + public static SerializerConfig Config = new SerializerConfig() + { + KnownTypes = + { + typeof(ModList), typeof(Game), typeof(Directive), typeof(IgnoredDirectly), + typeof(NoMatch), typeof(InlineFile), typeof(PropertyType), typeof(CleanedESM), + typeof(RemappedInlineFile), typeof(FromArchive), typeof(CreateBSA), typeof(PatchedFromArchive), + typeof(SourcePatch), typeof(MergedPatch), typeof(Archive), typeof(IndexedArchive), typeof(IndexedEntry), + typeof(IndexedArchiveEntry), typeof(BSAIndexedEntry), typeof(VirtualFile), + typeof(ArchiveStateObject), typeof(FileStateObject), typeof(IDownloader), + typeof(IUrlDownloader), typeof(AbstractDownloadState), typeof(ManualDownloader), + typeof(DropboxDownloader), typeof(GoogleDriveDownloader), typeof(HTTPDownloader), + typeof(MegaDownloader), typeof(ModDBDownloader), typeof(NexusDownloader) + } + }; + } +} diff --git a/Wabbajack.Lib/Compiler.cs b/Wabbajack.Lib/Compiler.cs index e0de333f..98aeced9 100644 --- a/Wabbajack.Lib/Compiler.cs +++ b/Wabbajack.Lib/Compiler.cs @@ -305,7 +305,7 @@ namespace Wabbajack.Lib Utils.Log($"Exporting Modlist to : {ModListOutputFile}"); //ModList.ToJSON(Path.Combine(ModListOutputFolder, "modlist.json")); - ModList.ToCERAS(Path.Combine(ModListOutputFolder, "modlist")); + ModList.ToCERAS(Path.Combine(ModListOutputFolder, "modlist"), ref CerasConfig.Config); if (File.Exists(ModListOutputFile)) File.Delete(ModListOutputFile); diff --git a/Wabbajack.Lib/Installer.cs b/Wabbajack.Lib/Installer.cs index f9fe1825..f91bb699 100644 --- a/Wabbajack.Lib/Installer.cs +++ b/Wabbajack.Lib/Installer.cs @@ -87,7 +87,7 @@ namespace Wabbajack.Lib var entry = ar.GetEntry("modlist"); using (var e = entry.Open()) //return e.FromJSON(); - return e.FromCERAS(); + return e.FromCERAS(ref CerasConfig.Config); } } diff --git a/Wabbajack.Lib/Wabbajack.Lib.csproj b/Wabbajack.Lib/Wabbajack.Lib.csproj index e2e1d780..8f1e52bc 100644 --- a/Wabbajack.Lib/Wabbajack.Lib.csproj +++ b/Wabbajack.Lib/Wabbajack.Lib.csproj @@ -118,6 +118,7 @@ +