public static List <PublishedFileId> GetBrokenDownloads() { List <PublishedFileId> ids = new List <PublishedFileId>(); foreach (var item in ContentManagerUtil.ModEntries) { var det = item.workshopDetails; var id = det.publishedFileId; if (id == PublishedFileId.invalid || id.AsUInt64 == 0) { continue; } if (id.AsUInt64 == PatchLoaderStatus.PatchLoaderWorkshopId || id.AsUInt64 == LoadOrderUtil.WSId) { continue; // cannot resub to patch loader or LOM. } var status = SteamUtilities.IsUGCUpToDate(det, out _); if (status != DownloadStatus.DownloadOK) { Log.Debug($"redownloading {item.entryName} with status:{status}", false); ids.Add(id); } } var missing = SteamUtilities.GetMissingItems().ToArray(); Log.Debug("missing items = " + missing.ToSTR(), false); ids.AddRange(missing); return(ids); }
private static void OnUGCRequestUGCDetailsCompleted(UGCDetails ugc, bool ioError) { ThreadPool.QueueUserWorkItem((_) => { try { var status = SteamUtilities.IsUGCUpToDate(ugc, out string reason); if (status != DownloadStatus.DownloadOK) { string m = $"'{ugc.publishedFileId} {ugc.title}' is not installed properly. Please try reinstalling it!" + $"\n\t(reason={reason})"; ThreadHelper.dispatcher.Dispatch(() => Log.DisplayWarning(m)); } } catch (Exception ex) { ex.Log(); } }); }
public IEnumerator EnsureIncludedOrExcludedCoroutine() { Log.Called(); var items = PlatformService.workshop.GetSubscribedItems(); int counter = 0; foreach (var id in items) { SteamUtilities.EnsureIncludedOrExcluded(id); if (counter >= 100) { counter = 0; yield return(0); } } }