diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 729f5783..122face2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -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" diff --git a/.gitignore b/.gitignore index 0f09875f..5e446150 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ node_modules/ -temp/ -exceptions.txt \ No newline at end of file +temp/ \ No newline at end of file diff --git a/index.js b/index.js index d7261ab6..d9a31e53 100644 --- a/index.js +++ b/index.js @@ -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) => @@ -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; + } } } diff --git a/static/manifestId.txt b/static/manifestId.txt index 349c8a43..e69de29b 100644 --- a/static/manifestId.txt +++ b/static/manifestId.txt @@ -1 +0,0 @@ -578205631086 \ No newline at end of file