Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
display what mods in particular fail to sync so that action can be taken
Browse files Browse the repository at this point in the history
  • Loading branch information
atenfyr committed Apr 21, 2021
1 parent e6d3454 commit 728cdd7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private void PeriodicCheckTimer_Tick(object sender, EventArgs e)
ModManager.UpdateReadOnlyStatus();
}

// Normally this wouldn't be necessary because of the fact that all index files are refreshed when the loader boots up, but for the folks that leave the mod loader open for days on end, we should refresh it all every once in a while
// Normally this wouldn't be necessary because of the fact that all index files are refreshed when the loader boots up, but for the folks that leave the mod loader open for days on end, we should refresh the global index file every once in a while
private void ForceAutoUpdateRefresh_Tick(object sender, EventArgs e)
{
ModManager.ResetGlobalIndexFile();
Expand Down Expand Up @@ -801,7 +801,7 @@ private void loadButton_Click(object sender, EventArgs e)
internal bool CurrentlySyncing = false;
internal bool syncErrored;
internal string syncErrorMessage;
internal int syncFailedDownloadCount;
internal string[] syncFailedDownloadMods = null;
internal string syncKosherProfileName;

private void syncButton_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -834,7 +834,7 @@ private void syncButton_Click(object sender, EventArgs e)

syncErrored = true;
syncErrorMessage = "The syncing process halted prematurely!";
syncFailedDownloadCount = 0;
syncFailedDownloadMods = null;
syncKosherProfileName = "";

waiting.ShowDialog(this);
Expand All @@ -849,7 +849,15 @@ private void syncButton_Click(object sender, EventArgs e)
}
else
{
this.ShowBasicButton("Added a new profile named \"" + syncKosherProfileName + "\".\n" + (syncFailedDownloadCount == 0 ? "No" : syncFailedDownloadCount.ToString()) + " mod" + (syncFailedDownloadCount == 1 ? "" : "s") + " failed to sync.", "OK", null, null);
int syncFailedDownloadCount = syncFailedDownloadMods.Length;
if (syncFailedDownloadCount == 0)
{
this.ShowBasicButton("Added a new profile named \"" + syncKosherProfileName + "\".\nNo mods failed to sync.", "OK", null, null);
}
else
{
this.ShowBasicButton("Added a new profile named \"" + syncKosherProfileName + "\".\n\n" + syncFailedDownloadCount.ToString() + " mod" + (syncFailedDownloadCount == 1 ? "" : "s") + " failed to sync:\n" + string.Join("\n", syncFailedDownloadMods).Trim(), "OK", null, null);
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions ServerSyncPopup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)

ModProfile creatingProfile = new ModProfile();
creatingProfile.ProfileData = new Dictionary<string, Mod>();
int failedDownloadCount = 0;
List<string> failedDownloadMods = new List<string>();

// Add our current mods into the brand new profile, and specify that they are disabled
ModProfile currentProf = BaseForm.ModManager.GenerateProfile();
Expand Down Expand Up @@ -146,7 +146,7 @@ private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
}
else
{
failedDownloadCount++;
failedDownloadMods.Add(debugModName);
}
}

Expand Down Expand Up @@ -179,7 +179,7 @@ private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
string kosherProfileName = kosherServerName + " Synced Mods";
BaseForm.ModManager.ProfileList[kosherProfileName] = creatingProfile;
BaseForm.syncKosherProfileName = kosherProfileName;
BaseForm.syncFailedDownloadCount = failedDownloadCount;
BaseForm.syncFailedDownloadMods = failedDownloadMods.ToArray();
SetDebugText("Done!");

BaseForm.syncErrored = false;
Expand Down

0 comments on commit 728cdd7

Please sign in to comment.