Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fallback for loadSession in case someone might have disconnected. #191

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

LennardF1989
Copy link
Member

After investigating an issue from Discord (https://discord.com/channels/826809653181808651/1077036810082979974), the following behavior is observed:

  • When a token expires, the game will request a new one (see hotfix Fixed an issue where refresh_token was not properly served #190).
  • When this request fails, or something else entirely causes the game to think you are offline, the game will show the "reconnect popup" (and sometimes it will automatically do so!).
  • If you click reconnect, you go through a full login flow (/config, /token, /GetProfile, etc).
  • If you are in an active mission, the game will also called /Load.

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.

components/profileHandler.ts Outdated Show resolved Hide resolved
@AnthonyFuller AnthonyFuller merged commit b8a6882 into v6 Apr 6, 2023
@AnthonyFuller AnthonyFuller deleted the hotfix-loadSession branch April 6, 2023 20:46
@moonysolari
Copy link
Member

when you try to load a save that is not persisted on the filesystem

I kinda don't see how that could happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants