Skip to content

Commit

Permalink
Fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
kinsi55 committed May 26, 2023
1 parent 6338725 commit abfd8c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions AppInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,15 @@ private void OnProductInfo(SteamApps.PICSProductInfoCallback callback) {
return;

// not sure if this is game specific or applies to other games
var manifest = callback?.Apps[APPID]?.KeyValues.Children
var _manifest = callback?.Apps[APPID]?.KeyValues.Children
.FirstOrDefault(x => x.Name == "depots")?.Children
.FirstOrDefault(x => x.Name == DEPOT_ID.ToString())?.Children
.FirstOrDefault(x => x.Name == "manifests")?.Children
.FirstOrDefault(x => x.Name == "public")?.Value;
.FirstOrDefault(x => x.Name == "public");

var manifest = _manifest?.Value != null ?
_manifest?.Value :
_manifest.Children.FirstOrDefault(x => x.Name == "gid")?.Value;

if(manifest?.Length >= 16)
manifestId = manifest;
Expand Down
2 changes: 1 addition & 1 deletion BeatSaberNoUpdate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>bsskip.ico</ApplicationIcon>
<Authors>Kinsi55</Authors>
<Version>1.1.4</Version>
<Version>1.1.5</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
6 changes: 4 additions & 2 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ private void applyButton_Click(object sender, EventArgs e) {
}

if(!Regex.IsMatch(textbox_manifest.Text, "[0-9]{16,19}")) {
Bad("The Manifest ID you entered is incorrect. It should be a 19 digit number. Make sure to not accidently enter any spaces");
Bad("The Manifest ID you entered is incorrect. It should be a 16-19 digit number. Make sure to not accidently enter any spaces");
return;
}

#if !DEBUG
if(Process.GetProcesses().Any(x => x.ProcessName.ToLower() == "steam")) {
Bad("Steam seems to be running, please exit it to apply the patch");
return;
}
#endif

var p = Path.Combine(textbox_path.Text, "..", "..", "appmanifest_620980.acf");

Expand All @@ -146,7 +148,7 @@ private void applyButton_Click(object sender, EventArgs e) {
if(checkBox1.Checked)
SetKv(ref acf, "AutoUpdateBehavior", "1");

acf = Regex.Replace(acf, "(\"" + AppInfo.DEPOT_ID + "\".*?\"manifest\"\\s*?)\"[0-9]{16,19}\"", $"$1\"{textbox_manifest.Text}\"", RegexOptions.Singleline | RegexOptions.IgnoreCase);
acf = Regex.Replace(acf, "(\"InstalledDepots\".*?\"" + AppInfo.DEPOT_ID + "\".*?\"manifest\"\\s*?)\"[0-9]{16,19}\"", $"$1\"{textbox_manifest.Text}\"", RegexOptions.Singleline | RegexOptions.IgnoreCase);

File.WriteAllText(p, acf);

Expand Down

0 comments on commit abfd8c9

Please sign in to comment.