Add support for multiple ids.

pull/583/head
Alstruit 1 year ago
parent 341b8b05e1
commit e600f92182
No known key found for this signature in database
GPG Key ID: 4F57E6793C946CEC

@ -47,7 +47,7 @@ namespace DepotDownloader
public byte[] DepotKey { get; } = depotKey; public byte[] DepotKey { get; } = depotKey;
} }
static bool CreateDirectories(uint appId, uint depotId, uint depotVersion, out string installDir) static bool CreateDirectories(uint appId, uint depotId, ulong manifestId, out string installDir)
{ {
installDir = null; installDir = null;
try try
@ -56,14 +56,28 @@ namespace DepotDownloader
{ {
Directory.CreateDirectory(DEFAULT_DOWNLOAD_DIR); Directory.CreateDirectory(DEFAULT_DOWNLOAD_DIR);
var appPath = Path.Combine(DEFAULT_DOWNLOAD_DIR, appId.ToString()); var baseDir = DEFAULT_DOWNLOAD_DIR;
// Create appId directory
var appPath = Path.Combine(baseDir, appId.ToString());
Directory.CreateDirectory(appPath); Directory.CreateDirectory(appPath);
var depotPath = Path.Combine(DEFAULT_DOWNLOAD_DIR, depotId.ToString()); if (depotId != ContentDownloader.INVALID_DEPOT_ID)
Directory.CreateDirectory(depotPath); {
// Create depotId directory under appId
var depotPath = Path.Combine(appPath, depotId.ToString());
Directory.CreateDirectory(depotPath);
installDir = Path.Combine(depotPath, depotVersion.ToString()); // Create manifestId directory under depotId
Directory.CreateDirectory(installDir); installDir = Path.Combine(depotPath, manifestId.ToString());
Directory.CreateDirectory(installDir);
}
else
{
// For cases where depotId is not applicable (e.g., DownloadWebFile), use appId directory directly
installDir = appPath;
Directory.CreateDirectory(installDir);
}
Directory.CreateDirectory(Path.Combine(installDir, CONFIG_DIR)); Directory.CreateDirectory(Path.Combine(installDir, CONFIG_DIR));
Directory.CreateDirectory(Path.Combine(installDir, STAGING_DIR)); Directory.CreateDirectory(Path.Combine(installDir, STAGING_DIR));
@ -86,6 +100,7 @@ namespace DepotDownloader
return true; return true;
} }
static bool TestIsFileIncluded(string filename) static bool TestIsFileIncluded(string filename)
{ {
if (!Config.UsingFileList) if (!Config.UsingFileList)
@ -604,9 +619,7 @@ namespace DepotDownloader
return null; return null;
} }
var uVersion = GetSteam3AppBuildNumber(appId, branch); if (!CreateDirectories(appId, depotId, manifestId, out var installDir))
if (!CreateDirectories(appId, depotId, uVersion, out var installDir))
{ {
Console.WriteLine("Error: Unable to create install directories!"); Console.WriteLine("Error: Unable to create install directories!");
return null; return null;

Loading…
Cancel
Save