Skip to content

Commit

Permalink
Fix possible bug with LocalProgression
Browse files Browse the repository at this point in the history
whenever the host switches rundowns while in a lobby,
clients do not update the progression file on their end.
  • Loading branch information
AuriRex committed Feb 4, 2023
1 parent e1f559a commit c8e1440
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions TheArchive.IL2CPP/Managers/LocalProgressionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public LocalRundownProgression LoadOrGetAndSaveCurrentFile(string rundownKeyToLo
if (rundownKeyToLoad == _loadedRundownKey)
return CurrentLoadedLocalProgressionData;

Logger.Debug($"{nameof(LoadOrGetAndSaveCurrentFile)}() {nameof(rundownKeyToLoad)} changed. ({_loadedRundownKey} -> {rundownKeyToLoad})");

SaveToProgressionFile(CurrentLoadedLocalProgressionData);

CurrentLoadedLocalProgressionData = LoadFromProgressionFile(rundownKeyToLoad);
Expand Down Expand Up @@ -91,6 +93,8 @@ public void EndCurrentExpeditionSession(bool success)
{
CurrentActiveSession?.OnExpeditionCompleted(success);

LoadOrGetAndSaveCurrentFile(CurrentActiveSession.RundownId);

var hasCompletionData = CurrentLoadedLocalProgressionData.AddSessionResults(CurrentActiveSession, out var completionData);

CurrentActiveSession = null;
Expand Down

0 comments on commit c8e1440

Please sign in to comment.