From 70fe9bfae8c78a7d0bf0a0a556176942c763dad1 Mon Sep 17 00:00:00 2001 From: pointfeev Date: Sat, 6 Nov 2021 06:07:27 -0400 Subject: [PATCH] fix? --- CreamInstaller/SelectForm.cs | 8 ++++---- CreamInstaller/SteamCMD.cs | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/CreamInstaller/SelectForm.cs b/CreamInstaller/SelectForm.cs index 4d619e2..9bc35db 100644 --- a/CreamInstaller/SelectForm.cs +++ b/CreamInstaller/SelectForm.cs @@ -138,17 +138,17 @@ namespace CreamInstaller if (Program.Canceled) return; List dlcTasks = new(); List dlcIds = new(); - if (!(appInfo is null) && !(appInfo.Value is VValue)) + if (!(appInfo is null)) { - if (!(appInfo.Value["extended"] is null) && !(appInfo.Value["extended"] is VValue)) + if (!(appInfo.Value["extended"] is null)) foreach (VProperty property in appInfo.Value["extended"]) if (property.Key.ToString() == "listofdlc") foreach (string id in property.Value.ToString().Split(",")) if (!dlcIds.Contains(int.Parse(id))) dlcIds.Add(int.Parse(id)); - if (!(appInfo.Value["depots"] is null) && !(appInfo.Value["depots"] is VValue)) + if (!(appInfo.Value["depots"] is null)) foreach (VProperty _property in appInfo.Value["depots"]) - if (int.TryParse(_property.Key.ToString(), out int _) && !(_property.Value is VValue)) + if (int.TryParse(_property.Key.ToString(), out int _)) if (int.TryParse(_property.Value?["dlcappid"]?.ToString(), out int appid) && !dlcIds.Contains(appid)) dlcIds.Add(appid); } diff --git a/CreamInstaller/SteamCMD.cs b/CreamInstaller/SteamCMD.cs index 61b4ee9..721ed51 100644 --- a/CreamInstaller/SteamCMD.cs +++ b/CreamInstaller/SteamCMD.cs @@ -77,15 +77,14 @@ namespace CreamInstaller } if (Program.Canceled || output is null) return false; appInfo = VdfConvert.Deserialize(output); - if (appInfo?.Value is VValue || appInfo?.Value?["common"] is VValue) return true; - VToken type = appInfo?.Value?["common"]?["type"]; + if (appInfo?.Value?.Children()?.ToList()?.Count > 0) return true; + VToken type = null; + try { type = appInfo?.Value?["common"]?["type"]; } catch { } if (type is null || type.ToString() == "Game") { - if (appInfo?.Value?["depots"] is VValue) return true; - if (appInfo?.Value?["depots"]?["public"] is VValue) return true; - string buildid = appInfo?.Value?["depots"]?["public"]?["buildid"]?.ToString(); + string buildid = null; + try { buildid = appInfo.Value["depots"]["public"]["buildid"].ToString(); } catch { } if (buildid is null && !(type is null)) return true; - if (appInfo?.Value?.Children()?.ToList()?.Count > 0) return true; if (type is null || int.Parse(buildid?.ToString()) < buildId || appInfo.Value["extended"] is null || appInfo.Value["depots"] is null) { File.Delete(appUpdateFile);