Skip to content

Commit

Permalink
Migrate to System.CommandLine
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed Jul 16, 2021
1 parent afab5e4 commit 22674a5
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 305 deletions.
11 changes: 7 additions & 4 deletions DepotDownloader/ContentDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ static string GetAppOrDepotName(uint depotId, uint appId)

public static bool InitializeSteam3(string username, string password)
{
// capture the supplied password in case we need to re-use it after checking the login key
Config.SuppliedPassword = password;

string loginKey = null;

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

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)
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)
{
cdnPool = new CDNClientPool(steam3, appId);

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

if (depotConfig["osarch"] != KeyValue.Invalid &&
!string.IsNullOrWhiteSpace(depotConfig["osarch"].Value))
{
var depotArch = depotConfig["osarch"].Value;
if (depotArch != (arch ?? Util.GetSteamArch()))
if (!arch.Contains(depotArch))
continue;
}

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

Expand Down
1 change: 1 addition & 0 deletions DepotDownloader/DepotDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<ItemGroup>
<PackageReference Include="protobuf-net" Version="3.0.101" />
<PackageReference Include="SteamKit2" Version="2.4.0-Alpha.2" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
</ItemGroup>
</Project>
Loading

0 comments on commit 22674a5

Please sign in to comment.