feat: some unpacking

This commit is contained in:
tresabhi committed 2025-02-25 17:55:05 -06:00
1 parent 8c7f851692
commit af0b430927
6 files changed
+28 -18

No files matched your search

+3 -2
View File
@@ -11,10 +11,10 @@ using Newtonsoft.Json.Linq;
namespace BlitzKit.CLI.Functions
{
public class Mangler
public class Mangler(string[] args)
{
readonly Tanks tanks = new();
readonly BlitzProvider provider = new();
readonly BlitzProvider provider = new(args.Contains("--depot"));
readonly List<FileChange> changes = [];
public async Task Mangle()
@@ -54,6 +54,7 @@ namespace BlitzKit.CLI.Functions
var pda = provider.LoadObject($"{tankDir.Path}/{pdaName}.{pdaName}");
var tankId = PropertyUtil.Get<FName>(pda, "TankId").Text;
Console.WriteLine($"Mangling {tankId}...");
var hulls = PropertyUtil.Get<UDataTable>(pda, "DT_Hulls");
UDataTableUtility.TryGetDataTableRow(hulls, "hull", StringComparison.Ordinal, out var hull);
+1 -1
View File
@@ -12,7 +12,7 @@ namespace BlitzKit.CLI.Functions
public static class Unpacker
{
private const string CONTENT_GROUP = "p14y73c7_p5e_b10gg3RS_big_play";
private const string VFS_PATH = "../../temp/vfs/";
private const string VFS_PATH = "../../temp/containers/";
// this may be different from the one provided in args so check this and not args[1]
// we don't wanna delete my local installation of the game when debugging haha!
+7 -3
View File
@@ -1,3 +1,4 @@
using System.Diagnostics;
using System.Net;
using BlitzKit.CLI.Utils;
using DotNetEnv;
@@ -7,8 +8,8 @@ namespace BlitzKit.CLI.Models
{
public static class BlitzKitAssets
{
public static int TIME_PER_BLOB = (int)Math.Pow(2, 4) * 10000;
public static int TIME_BETWEEN_BLOBS = (int)(60 * 60 * 1000 / 5000 / 0.9);
private static int TIME_PER_BLOB = (int)Math.Pow(2, 4) * 10000;
private static int TIME_BETWEEN_BLOBS = (int)(60 * 60 * 1000 / 5000 / 0.9);
public static async Task CommitAssets(string message, List<FileChange> changes)
{
@@ -98,10 +99,13 @@ namespace BlitzKit.CLI.Models
foreach (var change in changes)
{
Console.WriteLine($"blobbing {change.Path}");
while (true)
{
try
{
var stopwatch = Stopwatch.StartNew();
var blobSha = octokit
.Git.Blob.Create(
owner,
@@ -114,7 +118,7 @@ namespace BlitzKit.CLI.Models
)
.Result.Sha;
await Task.Delay(TIME_BETWEEN_BLOBS);
await Task.Delay((int)Math.Max(0, TIME_BETWEEN_BLOBS - stopwatch.ElapsedMilliseconds));
newTree.Tree.Add(
new()
+7 -8
View File
@@ -7,20 +7,19 @@ namespace BlitzKit.CLI.Models
{
public class BlitzProvider : DefaultFileProvider
{
private static readonly string LOCAL_USER = "coola";
private static readonly string LOCAL_DLC_CONTAINERS_PATH =
$"C:/Users/{LOCAL_USER}/AppData/Local/Blitz/Saved/PersistentDownloadDir/Dlc/PakCache";
$"C:/Users/coola/AppData/Local/Blitz/Saved/PersistentDownloadDir/Dlc/PakCache";
private static readonly string LOCAL_BUNDLED_CONTAINERS_PATH =
"C:/Program Files (x86)/Steam/steamapps/common/World of Tanks Blitz Playtest/Blitz/Content/Paks";
private static readonly string LOCAL_MAPPINGS_PATH =
"../../submodules/blitzkit-closed/blitz.usmap";
private static readonly string DEPOT_CONTAINERS_PATH = "../../temp/containers";
private static readonly string MAPPINGS_PATH = "../../submodules/blitzkit-closed/blitz.usmap";
public readonly VFS RootDirectory;
public BlitzProvider()
public BlitzProvider(bool depot)
: base(
directory: new DirectoryInfo(LOCAL_BUNDLED_CONTAINERS_PATH),
extraDirectories: [new(LOCAL_DLC_CONTAINERS_PATH)],
directory: new DirectoryInfo(depot ? DEPOT_CONTAINERS_PATH : LOCAL_BUNDLED_CONTAINERS_PATH),
extraDirectories: depot ? [] : [new(LOCAL_DLC_CONTAINERS_PATH)],
searchOption: SearchOption.TopDirectoryOnly,
versions: new(EGame.GAME_UE5_3)
)
@@ -32,7 +31,7 @@ namespace BlitzKit.CLI.Models
Name = "",
provider = this,
};
MappingsContainer = new FileUsmapTypeMappingsProvider(LOCAL_MAPPINGS_PATH);
MappingsContainer = new FileUsmapTypeMappingsProvider(MAPPINGS_PATH);
Initialize();
Mount();
+1 -3
View File
@@ -24,10 +24,8 @@ namespace BlitzKit.CLI
case "mangle":
{
Mangler mangler = new();
Mangler mangler = new(args);
await mangler.Mangle();
break;
}