Skip to content

Commit

Permalink
convert ClientCreateArgs to a record
Browse files Browse the repository at this point in the history
  • Loading branch information
ZingBallyhoo committed Nov 16, 2024
1 parent def7d29 commit e1d6450
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion TACTLib/Client/ClientCreateArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace TACTLib.Client {
/// <summary>
/// Client runtime args
/// </summary>
public class ClientCreateArgs {
public record ClientCreateArgs {
public enum InstallMode {
Local,
Remote
Expand Down Expand Up @@ -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;
}
}
7 changes: 5 additions & 2 deletions TACTLib/Client/ClientHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit e1d6450

Please sign in to comment.