Skip to content

Commit

Permalink
feat: more
Browse files Browse the repository at this point in the history
  • Loading branch information
tresabhi committed Jan 26, 2025
1 parent 693c3f4 commit b70d65f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 34 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}

- name: Setup .NET
uses: actions/setup-dotnet@v4

- name: Restore
run: dotnet restore

- name: Setup DepotDownloader
run: |
mkdir -p temp
Expand All @@ -43,7 +50,7 @@ jobs:
echo "Download complete; files:"
ls temp/depotDownloader
- name: (Steam) Download client
- name: Download client
run: |
chmod +x temp/depotDownloader/DepotDownloader
temp/depotDownloader/DepotDownloader \
Expand All @@ -52,4 +59,21 @@ jobs:
-os ${{ env.STEAM_OS }} \
-app ${{ env.STEAM_APP }} \
-depot ${{ env.STEAM_DEPOT }} \
-filelist regex:.+/Blitz/Content/Paks/.+\.pak
-dir temp/depots
- name: Unpack
run: |
cd temp/depots/${{ env.STEAM_APP }}
SUBDIR_COUNT=$(ls | wc -l)
if [ "$SUBDIR_COUNT" -ne 1 ]; then
echo "Error: Expected exactly 1 subdirectory, found $SUBDIR_COUNT"
exit 1
fi
DEPOT_BRANCH_BUILD_ID=$(ls)
echo "Found build ID: $DEPOT_BRANCH_BUILD_ID"
cd ../../../src/CLI
dotnet run unpack ../../temp/depots/${{ env.STEAM_APP }}/$DEPOT_BRANCH_BUILD_ID/
25 changes: 18 additions & 7 deletions src/CLI/Functions/DLC.cs → src/CLI/Functions/Unpacker.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
using CLI.Models;
using CLI.Utils;

namespace CLI.Functions
{
class DLC
class Unpacker
{
public static void Run(Arguments args)
public static void Unpack(string[] args)
{
BlitzVfs vfs = new();
if (args.Length < 2)
{
throw new ArgumentException("Missing required working directory argument");
}

string workingDirectory = args[1];
string paksDirectory = Path.Combine(workingDirectory, "Blitz/Content/Paks");
string[] files = Directory.GetFiles(paksDirectory, "*.pak");

foreach (string file in files)
{
Console.WriteLine($"Reading \"{file}\"");
}

// BlitzVfs vfs = new();

vfs.Initialize();
// vfs.Initialize();

// DefaultFileProvider provider = new(
// directory: new(
Expand Down
19 changes: 0 additions & 19 deletions src/CLI/Models/Arguments.cs

This file was deleted.

12 changes: 7 additions & 5 deletions src/CLI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
using CLI.Functions;
using CLI.Models;

namespace CLI
{
class Program
{
static void Main(string[] args)
{
Arguments arguments = new(args);

switch (args[0])
{
case "dlc":
case "unpack":
{
DLC.Run(arguments);
Unpacker.Unpack(args);
break;
}

default:
{
throw new ArgumentException("Invalid command");
}
}
}
}
Expand Down

0 comments on commit b70d65f

Please sign in to comment.