mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: some unpacking
This commit is contained in:
1 parent
8c7f851692
commit
af0b430927
6 files changed
+28
-18
No files matched your search
@@ -14,6 +14,9 @@ env:
|
|||||||
STEAM_OS: windows
|
STEAM_OS: windows
|
||||||
STEAM_APP: 3341250
|
STEAM_APP: 3341250
|
||||||
STEAM_DEPOT: 3341251
|
STEAM_DEPOT: 3341251
|
||||||
|
PUBLIC_ASSET_REPO: tresabhi/blitzkit-assets
|
||||||
|
PUBLIC_ASSET_BRANCH: ue
|
||||||
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
download_client:
|
download_client:
|
||||||
@@ -68,7 +71,12 @@ jobs:
|
|||||||
- name: Unpack
|
- name: Unpack
|
||||||
run: |
|
run: |
|
||||||
cd src/BlitzKit.CLI
|
cd src/BlitzKit.CLI
|
||||||
dotnet run unpack ../../temp/depot/
|
dotnet run unpack
|
||||||
|
|
||||||
|
- name: Mangle
|
||||||
|
run: |
|
||||||
|
cd src/BlitzKit.CLI
|
||||||
|
dotnet run mangle --depot
|
||||||
|
|
||||||
- name: Archive VFS
|
- name: Archive VFS
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ using Newtonsoft.Json.Linq;
|
|||||||
|
|
||||||
namespace BlitzKit.CLI.Functions
|
namespace BlitzKit.CLI.Functions
|
||||||
{
|
{
|
||||||
public class Mangler
|
public class Mangler(string[] args)
|
||||||
{
|
{
|
||||||
readonly Tanks tanks = new();
|
readonly Tanks tanks = new();
|
||||||
readonly BlitzProvider provider = new();
|
readonly BlitzProvider provider = new(args.Contains("--depot"));
|
||||||
readonly List<FileChange> changes = [];
|
readonly List<FileChange> changes = [];
|
||||||
|
|
||||||
public async Task Mangle()
|
public async Task Mangle()
|
||||||
@@ -54,6 +54,7 @@ namespace BlitzKit.CLI.Functions
|
|||||||
var pda = provider.LoadObject($"{tankDir.Path}/{pdaName}.{pdaName}");
|
var pda = provider.LoadObject($"{tankDir.Path}/{pdaName}.{pdaName}");
|
||||||
|
|
||||||
var tankId = PropertyUtil.Get<FName>(pda, "TankId").Text;
|
var tankId = PropertyUtil.Get<FName>(pda, "TankId").Text;
|
||||||
|
Console.WriteLine($"Mangling {tankId}...");
|
||||||
|
|
||||||
var hulls = PropertyUtil.Get<UDataTable>(pda, "DT_Hulls");
|
var hulls = PropertyUtil.Get<UDataTable>(pda, "DT_Hulls");
|
||||||
UDataTableUtility.TryGetDataTableRow(hulls, "hull", StringComparison.Ordinal, out var hull);
|
UDataTableUtility.TryGetDataTableRow(hulls, "hull", StringComparison.Ordinal, out var hull);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace BlitzKit.CLI.Functions
|
|||||||
public static class Unpacker
|
public static class Unpacker
|
||||||
{
|
{
|
||||||
private const string CONTENT_GROUP = "p14y73c7_p5e_b10gg3RS_big_play";
|
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]
|
// 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!
|
// we don't wanna delete my local installation of the game when debugging haha!
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using BlitzKit.CLI.Utils;
|
using BlitzKit.CLI.Utils;
|
||||||
using DotNetEnv;
|
using DotNetEnv;
|
||||||
@@ -7,8 +8,8 @@ namespace BlitzKit.CLI.Models
|
|||||||
{
|
{
|
||||||
public static class BlitzKitAssets
|
public static class BlitzKitAssets
|
||||||
{
|
{
|
||||||
public static int TIME_PER_BLOB = (int)Math.Pow(2, 4) * 10000;
|
private 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_BETWEEN_BLOBS = (int)(60 * 60 * 1000 / 5000 / 0.9);
|
||||||
|
|
||||||
public static async Task CommitAssets(string message, List<FileChange> changes)
|
public static async Task CommitAssets(string message, List<FileChange> changes)
|
||||||
{
|
{
|
||||||
@@ -98,10 +99,13 @@ namespace BlitzKit.CLI.Models
|
|||||||
|
|
||||||
foreach (var change in changes)
|
foreach (var change in changes)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"blobbing {change.Path}");
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var stopwatch = Stopwatch.StartNew();
|
||||||
var blobSha = octokit
|
var blobSha = octokit
|
||||||
.Git.Blob.Create(
|
.Git.Blob.Create(
|
||||||
owner,
|
owner,
|
||||||
@@ -114,7 +118,7 @@ namespace BlitzKit.CLI.Models
|
|||||||
)
|
)
|
||||||
.Result.Sha;
|
.Result.Sha;
|
||||||
|
|
||||||
await Task.Delay(TIME_BETWEEN_BLOBS);
|
await Task.Delay((int)Math.Max(0, TIME_BETWEEN_BLOBS - stopwatch.ElapsedMilliseconds));
|
||||||
|
|
||||||
newTree.Tree.Add(
|
newTree.Tree.Add(
|
||||||
new()
|
new()
|
||||||
|
|||||||
@@ -7,20 +7,19 @@ namespace BlitzKit.CLI.Models
|
|||||||
{
|
{
|
||||||
public class BlitzProvider : DefaultFileProvider
|
public class BlitzProvider : DefaultFileProvider
|
||||||
{
|
{
|
||||||
private static readonly string LOCAL_USER = "coola";
|
|
||||||
private static readonly string LOCAL_DLC_CONTAINERS_PATH =
|
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 =
|
private static readonly string LOCAL_BUNDLED_CONTAINERS_PATH =
|
||||||
"C:/Program Files (x86)/Steam/steamapps/common/World of Tanks Blitz Playtest/Blitz/Content/Paks";
|
"C:/Program Files (x86)/Steam/steamapps/common/World of Tanks Blitz Playtest/Blitz/Content/Paks";
|
||||||
private static readonly string LOCAL_MAPPINGS_PATH =
|
private static readonly string DEPOT_CONTAINERS_PATH = "../../temp/containers";
|
||||||
"../../submodules/blitzkit-closed/blitz.usmap";
|
private static readonly string MAPPINGS_PATH = "../../submodules/blitzkit-closed/blitz.usmap";
|
||||||
|
|
||||||
public readonly VFS RootDirectory;
|
public readonly VFS RootDirectory;
|
||||||
|
|
||||||
public BlitzProvider()
|
public BlitzProvider(bool depot)
|
||||||
: base(
|
: base(
|
||||||
directory: new DirectoryInfo(LOCAL_BUNDLED_CONTAINERS_PATH),
|
directory: new DirectoryInfo(depot ? DEPOT_CONTAINERS_PATH : LOCAL_BUNDLED_CONTAINERS_PATH),
|
||||||
extraDirectories: [new(LOCAL_DLC_CONTAINERS_PATH)],
|
extraDirectories: depot ? [] : [new(LOCAL_DLC_CONTAINERS_PATH)],
|
||||||
searchOption: SearchOption.TopDirectoryOnly,
|
searchOption: SearchOption.TopDirectoryOnly,
|
||||||
versions: new(EGame.GAME_UE5_3)
|
versions: new(EGame.GAME_UE5_3)
|
||||||
)
|
)
|
||||||
@@ -32,7 +31,7 @@ namespace BlitzKit.CLI.Models
|
|||||||
Name = "",
|
Name = "",
|
||||||
provider = this,
|
provider = this,
|
||||||
};
|
};
|
||||||
MappingsContainer = new FileUsmapTypeMappingsProvider(LOCAL_MAPPINGS_PATH);
|
MappingsContainer = new FileUsmapTypeMappingsProvider(MAPPINGS_PATH);
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
Mount();
|
Mount();
|
||||||
|
|||||||
@@ -24,10 +24,8 @@ namespace BlitzKit.CLI
|
|||||||
|
|
||||||
case "mangle":
|
case "mangle":
|
||||||
{
|
{
|
||||||
Mangler mangler = new();
|
Mangler mangler = new(args);
|
||||||
|
|
||||||
await mangler.Mangle();
|
await mangler.Mangle();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user