1 Commits

Author SHA1 Message Date
Exterrata a10888a2cc Use the real Steam build id for private branches
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 00:18:18 -05:00
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
<AssemblyName>CVRManager</AssemblyName> <AssemblyName>CVRManager</AssemblyName>
<ApplicationIcon>Assets/app.ico</ApplicationIcon> <ApplicationIcon>Assets/app.ico</ApplicationIcon>
<NoWarn>$(NoWarn);CA1416</NoWarn> <NoWarn>$(NoWarn);CA1416</NoWarn>
<Version>1.0.1</Version> <Version>1.0.2</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
+8 -2
View File
@@ -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; } 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); var selection = SelectDepots(depots, priv.DepotSection, pb.Name);
if (selection.Count == 0) continue; 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(); 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) static string PrivateMarker(IEnumerable<(uint DepotId, ulong ManifestId)> depots)
{ {
var text = string.Join(";", depots.OrderBy(d => d.DepotId).Select(d => $"{d.DepotId}:{d.ManifestId}")); 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)); plans.Add(new DepotPlan(depotId, manifestId, keyReply.DepotKey));
} }
if (plans.Count == 0) throw new InvalidOperationException("Steam listed no downloadable files for this branch."); 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 statePath = Path.Combine(stateDir, "state.json");
var state = new InstallState(); var state = new InstallState();