Added fallback for loadSession in case someone might have disconnected. #191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After investigating an issue from Discord (https://discord.com/channels/826809653181808651/1077036810082979974), the following behavior is observed:
This last one is a problem. The original version would only ever look for persisted sessions on the filesystem, however, this is not the case when you just lost connection for whatever reason (and restored it without restarting Peacock). This kind of leads into #165, but is for another day.
This fix will make sure it will always fallback to the contractSessions that may still be in memory.
This can have an unintended side effect when you try to load a save that is not persisted on the filesystem, but happens to be the exact one you are currently playing. This however is a highly unlikely scenario to occur and doesn't outweigh the benefits of this fix. Disconnecting and losing progress is annoying.