public string DbgString() { StringBuilder s = new StringBuilder(); s.AppendFormat("Title: {0}\n", Title); if (!string.IsNullOrEmpty(Platform.PlatformName)) { s.AppendFormat("Platform:\n{0}", Platform); } if ((Publishers != null) && Publishers.Any()) { for (int x = 0; x < Publishers.Count; x++) { s.AppendFormat("Publisher{0}:\n{1}\n", x + 1, Publishers.ElementAt(x)); } } if ((Developers != null) && Developers.Any()) { for (int x = 0; x < Developers.Count; x++) { s.AppendFormat("Developer{0}:\n{1}\n", x + 1, Developers.ElementAt(x)); } } if ((AltTitles != null) && AltTitles.Any()) { for (int x = 0; x < AltTitles.Count; x++) { s.AppendFormat("AltTitle{0}:\n{1}\n", x + 1, AltTitles.ElementAt(x)); } } if ((Accessories != null) && Accessories.Any()) { for (int x = 0; x < Accessories.Count; x++) { s.AppendFormat("Accessory{0}:\n{1}\n", x + 1, Accessories.ElementAt(x).AccessoryName); } } if ((DLCs != null) && DLCs.Any()) { for (int x = 0; x < DLCs.Count; x++) { s.AppendFormat("DLC{0}: {1}\n", x + 1, DLCs.ElementAt(x)); } } if ((Genres != null) && Genres.Any()) { for (int x = 0; x < Genres.Count; x++) { s.AppendFormat("Genre{0}: {1}\n", x + 1, Genres.ElementAt(x)); } } s.AppendFormat("Release Decade: {0}\n", ReleaseDecade); s.AppendFormat("Release Year: {0}\n", ReleaseYear); s.AppendFormat("Release Date: {0}\n", ReleaseDate); return(s.ToString()); }
public string DbgString() { StringBuilder s = new StringBuilder(); s.AppendFormat("Title: {0}\n", Title); if ((AltTitles != null) && AltTitles.Any()) { for (int x = 0; x < AltTitles.Count; x++) { s.AppendFormat("AltTitle{0}:\n{1}\n", x + 1, AltTitles.ElementAt(x)); } } if ((Accessories != null) && Accessories.Any()) { for (int x = 0; x < Accessories.Count; x++) { s.AppendFormat("Accessory{0}:\n{1}\n", x + 1, Accessories.ElementAt(x).AccessoryName); } } if ((DLCs != null) && DLCs.Any()) { for (int x = 0; x < DLCs.Count; x++) { s.AppendFormat("DLC{0}: {1}\n", x + 1, DLCs.ElementAt(x)); } } if ((Genres != null) && Genres.Any()) { for (int x = 0; x < Genres.Count; x++) { s.AppendFormat("Genre{0}: {1}\n", x + 1, Genres.ElementAt(x)); } } s.AppendFormat("Release Decade: {0}\n", ReleaseDecade); s.AppendFormat("Release Year: {0}\n", ReleaseYear); s.AppendFormat("Release Date: {0}\n", ReleaseDate); return(s.ToString()); }
private async void CheckForGameAndDLCsUpdates() { string Executable = ExecutablePath; if (Settings.DisableUpdChecks) { foreach (DLC DLC in DLCs) { DLC.SetStatus(DLC.IsInstalled ? Status.Installed : Status.NotInstalled); } SetCurrentVersion(FileExists(Executable) ? Game.Version ?? LocString(LocCode.NA) : LocString(LocCode.None), (SolidColorBrush)FindResource("BrightestBrightBrush")); } bool QuerySucceeded = false; Hashes InitialQuery = new Hashes(); if (IsConnectionAvailable()) { for (int AttemptsCounter = 0; !QuerySucceeded && AttemptsCounter < 5; AttemptsCounter++) { if (await InitialQuery.RequestAsync()) { QuerySucceeded = true; } } } else { Message.Show("Warning", LocString(LocCode.NoInternet)); } if (Settings.DisableUpdChecks) { return; } if (QuerySucceeded && InitialQuery.Checksums.ContainsKey(MapCode.TheIsland)) { if (FileExists(Executable)) { using (SHA1 SHA = Create()) using (FileStream ChecksumStream = OpenRead(Executable)) { if (SHA.ComputeHash(ChecksumStream).SequenceEqual(InitialQuery.Checksums[MapCode.TheIsland])) { SetCurrentVersion(Game.Version ?? LocString(LocCode.Latest), DarkGreen); } else { UpdateAvailable = true; SetCurrentVersion(Game.Version ?? LocString(LocCode.Outdated), YellowBrush); Add(LocString(LocCode.ARKUpdateAvailable), LocString(LocCode.Update), RunGameUpdate); } } } else { SetCurrentVersion(LocString(LocCode.None), DarkRed); } if (DLCs.Any(DLC => DLC.IsInstalled)) { Notification DLCNotification = AddLoading($"{LocString(LocCode.CheckingForDLCUpds)} ", LocString(LocCode.Update), RunDLCUpdater); await CheckForUpdatesAsync(InitialQuery.Checksums); bool DLCUpdatesAvailable = false; foreach (DLC DLC in DLCs) { DLCUpdatesAvailable |= DLC.Status == Status.UpdateAvailable; } if (DLCUpdatesAvailable) { DLCNotification.FinishLoading(LocString(LocCode.DLCUpdsAvailable), true); } else { DLCNotification.FinishLoading(LocString(LocCode.DLCUpToDate), false); await Delay(1500); DLCNotification.Hide(); } } } else { foreach (DLC DLC in DLCs) { DLC.SetStatus(DLC.IsInstalled ? Status.Installed : Status.NotInstalled); } SetCurrentVersion(FileExists(Executable) ? Game.Version ?? LocString(LocCode.NA) : LocString(LocCode.None), (SolidColorBrush)FindResource("GrayBrush")); } }