From e1d6450b9a1153dccbee8415c26ca7913c4a0f27 Mon Sep 17 00:00:00 2001 From: zingballyhoo Date: Sat, 16 Nov 2024 12:04:07 +0000 Subject: [PATCH] convert ClientCreateArgs to a record --- TACTLib/Client/ClientCreateArgs.cs | 5 ++++- TACTLib/Client/ClientHandler.cs | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/TACTLib/Client/ClientCreateArgs.cs b/TACTLib/Client/ClientCreateArgs.cs index e0a5d78..d4313d0 100644 --- a/TACTLib/Client/ClientCreateArgs.cs +++ b/TACTLib/Client/ClientCreateArgs.cs @@ -7,7 +7,7 @@ namespace TACTLib.Client { /// /// Client runtime args /// - public class ClientCreateArgs { + public record ClientCreateArgs { public enum InstallMode { Local, Remote @@ -116,5 +116,8 @@ public bool Online { public bool LoadCDNIndices { get; set; } = true; public ClientHandler? TryShareCDNIndexWithHandler { get; set; } = null; + + public bool LoadRoot { get; set; } = true; + public bool LoadVFS { get; set; } = true; } } \ No newline at end of file diff --git a/TACTLib/Client/ClientHandler.cs b/TACTLib/Client/ClientHandler.cs index 61f6ab1..fde06f0 100644 --- a/TACTLib/Client/ClientHandler.cs +++ b/TACTLib/Client/ClientHandler.cs @@ -220,13 +220,16 @@ public ClientHandler(string? basePath, ClientCreateArgs createArgs) { using (var _ = new PerfCounter("EncodingHandler::ctor`ClientHandler")) EncodingHandler = new EncodingHandler(this); - if (ConfigHandler.BuildConfig.VFSRoot != null) { + if (ConfigHandler.BuildConfig.VFSRoot != null && CreateArgs.LoadVFS) { using var _ = new PerfCounter("VFSFileTree::ctor`ClientHandler"); using var vfsStream = OpenCKey(ConfigHandler.BuildConfig.VFSRoot!.ContentKey)!; VFS = new VFSFileTree(this, vfsStream); } - ProductHandler = CreateProductHandler(); + if (CreateArgs.LoadRoot) + { + ProductHandler = CreateProductHandler(); + } Logger.Info("CASC", "Ready"); }