diff --git a/CVRManager.csproj b/CVRManager.csproj index 96d7b5f..47af0b6 100644 --- a/CVRManager.csproj +++ b/CVRManager.csproj @@ -9,7 +9,7 @@ CVRManager Assets/app.ico $(NoWarn);CA1416 - 1.0.1 + 1.0.2 diff --git a/Services/SteamDownloader.cs b/Services/SteamDownloader.cs index 53d3fce..883e068 100644 --- a/Services/SteamDownloader.cs +++ b/Services/SteamDownloader.cs @@ -68,12 +68,18 @@ public static class SteamDownloader if (priv.Result != EResult.OK) { log($"Steam would not list the files of '{pb.Name}' ({priv.Result})."); continue; } var selection = SelectDepots(depots, priv.DepotSection, pb.Name); if (selection.Count == 0) continue; - list.Add(new BranchInfo(pb.Name, PrivateMarker(selection), true, "")); + list.Add(new BranchInfo(pb.Name, PrivateBuildId(priv.DepotSection, pb.Name) ?? PrivateMarker(selection), true, "")); } return list.OrderBy(b => b.Name == "public" ? 0 : 1).ThenBy(b => b.Name).ToList(); } + static string? PrivateBuildId(KeyValue? section, string branch) + { + var id = section?["branches"][branch]["buildid"].Value; + return string.IsNullOrEmpty(id) ? null : id; + } + static string PrivateMarker(IEnumerable<(uint DepotId, ulong ManifestId)> depots) { var text = string.Join(";", depots.OrderBy(d => d.DepotId).Select(d => $"{d.DepotId}:{d.ManifestId}")); @@ -168,7 +174,7 @@ public static class SteamDownloader plans.Add(new DepotPlan(depotId, manifestId, keyReply.DepotKey)); } if (plans.Count == 0) throw new InvalidOperationException("Steam listed no downloadable files for this branch."); - if (buildId.Length == 0) buildId = PrivateMarker(plans.Select(p => (p.DepotId, p.ManifestId))); + if (buildId.Length == 0) buildId = PrivateBuildId(privateDepots, branch) ?? PrivateMarker(plans.Select(p => (p.DepotId, p.ManifestId))); var statePath = Path.Combine(stateDir, "state.json"); var state = new InstallState();