mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +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
@@ -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,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();
|
||||
|
||||
Reference in new issue
Block a user