Skip to content

Commit 22674a5

Browse files
committed
Migrate to System.CommandLine
1 parent afab5e4 commit 22674a5

File tree

3 files changed

+214
-305
lines changed

3 files changed

+214
-305
lines changed

DepotDownloader/ContentDownloader.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ static string GetAppOrDepotName(uint depotId, uint appId)
331331

332332
public static bool InitializeSteam3(string username, string password)
333333
{
334+
// capture the supplied password in case we need to re-use it after checking the login key
335+
Config.SuppliedPassword = password;
336+
334337
string loginKey = null;
335338

336339
if (username != null && Config.RememberPassword)
@@ -448,7 +451,7 @@ private static async Task DownloadWebFile(uint appId, string fileName, string ur
448451
File.Move(fileStagingPath, fileFinalPath);
449452
}
450453

451-
public static async Task DownloadAppAsync(uint appId, List<(uint depotId, ulong manifestId)> depotManifestIds, string branch, string os, string arch, string language, bool lv, bool isUgc)
454+
public static async Task DownloadAppAsync(uint appId, List<(uint depotId, ulong manifestId)> depotManifestIds, string branch, string[] os, string[] arch, string[] language, bool lv, bool isUgc)
452455
{
453456
cdnPool = new CDNClientPool(steam3, appId);
454457

@@ -525,15 +528,15 @@ public static async Task DownloadAppAsync(uint appId, List<(uint depotId, ulong
525528
!string.IsNullOrWhiteSpace(depotConfig["oslist"].Value))
526529
{
527530
var oslist = depotConfig["oslist"].Value.Split(',');
528-
if (Array.IndexOf(oslist, os ?? Util.GetSteamOS()) == -1)
531+
if (!os.Any(x => oslist.Contains(x)))
529532
continue;
530533
}
531534

532535
if (depotConfig["osarch"] != KeyValue.Invalid &&
533536
!string.IsNullOrWhiteSpace(depotConfig["osarch"].Value))
534537
{
535538
var depotArch = depotConfig["osarch"].Value;
536-
if (depotArch != (arch ?? Util.GetSteamArch()))
539+
if (!arch.Contains(depotArch))
537540
continue;
538541
}
539542

@@ -542,7 +545,7 @@ public static async Task DownloadAppAsync(uint appId, List<(uint depotId, ulong
542545
!string.IsNullOrWhiteSpace(depotConfig["language"].Value))
543546
{
544547
var depotLang = depotConfig["language"].Value;
545-
if (depotLang != (language ?? "english"))
548+
if (!language.Contains(depotLang))
546549
continue;
547550
}
548551

DepotDownloader/DepotDownloader.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<ItemGroup>
1414
<PackageReference Include="protobuf-net" Version="3.0.101" />
1515
<PackageReference Include="SteamKit2" Version="2.4.0-Alpha.2" />
16+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
1617
</ItemGroup>
1718
</Project>

0 commit comments

Comments
 (0)