Skip to content

Commit

Permalink
refactor: try to fix error with Decompiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
ByMykel committed Feb 10, 2024
1 parent a6ff0b2 commit 74bff84
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-node@v3
- name: Download new game files
run: npm install && node index.js '${{ secrets.USERNAME }}' '${{ secrets.PASSWORD }}'
- name: Run Decompiler for pak01_dir.vpk
- name: Run Decompiler for pak01_dir.vpk with ValveResourceFormat 8.1
run: |
chmod +x ./Decompiler
./Decompiler -i "./temp/pak01_dir.vpk" -o "./static" -e "vtex_c" -d -f "panorama/images/econ"
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules/
temp/
exceptions.txt
temp/
29 changes: 24 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,25 @@
const SteamUser = require("steam-user");
const fs = require("fs");
const vpk = require("vpk");
const { exec } = require("child_process");
const appId = 730;
const depotId = 2347770;
const dir = `./static`;
const temp = "./temp";
const manifestIdFile = "manifestId.txt";

const vpkFolders = ["panorama/images/econ"];
const vpkFolders = [
"panorama/images/econ/characters",
"panorama/images/econ/default_generated",
"panorama/images/econ/music_kits",
"panorama/images/econ/patches",
"panorama/images/econ/season_icons",
"panorama/images/econ/set_icons",
"panorama/images/econ/status_icons",
"panorama/images/econ/stickers",
"panorama/images/econ/tools",
"panorama/images/econ/weapons",
"panorama/images/econ/weapon_cases",
];

async function downloadVPKDir(user, manifest) {
const dirFile = manifest.manifest.files.find((file) =>
Expand All @@ -33,10 +44,18 @@ function getRequiredVPKFiles(vpkDir) {
const requiredIndices = [];

for (const fileName of vpkDir.files) {
const archiveIndex = vpkDir.tree[fileName].archiveIndex;
for (const f of vpkFolders) {
if (fileName.startsWith(f)) {
console.log(`Found vpk for ${f}: ${fileName}`);

if (!requiredIndices.includes(archiveIndex)) {
requiredIndices.push(archiveIndex);
const archiveIndex = vpkDir.tree[fileName].archiveIndex;

if (!requiredIndices.includes(archiveIndex)) {
requiredIndices.push(archiveIndex);
}

break;
}
}
}

Expand Down
1 change: 0 additions & 1 deletion static/manifestId.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
578205631086

0 comments on commit 74bff84

Please sign in to comment.