Skip to content

Commit

Permalink
Attempt to reconnect after a disconnect (OpenDreamProject#1523)
Browse files Browse the repository at this point in the history
* Attempt to reconnect after a timed out connection

* Update OpenDreamClient/States/DreamUserInterfaceStateManager.cs
  • Loading branch information
wixoaGit authored Dec 20, 2023
1 parent 99db639 commit b6375da
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions OpenDreamClient/States/DreamUserInterfaceStateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ public void Initialize() {
// When we disconnect from the server:
case ClientRunLevel.Error:
case ClientRunLevel.Initialize when args.OldLevel >= ClientRunLevel.Connected:
if (_gameController.LaunchState.FromLauncher) {
_stateManager.RequestStateChange<ConnectingState>();
// TODO: Reconnect without returning to the launcher
// The client currently believes its still connected at this point and will refuse
if (_gameController.LaunchState is {
FromLauncher: true,
Ss14Address: not null
}) {
_gameController.Redial(_gameController.LaunchState.Ss14Address, "Connection lost; attempting reconnect");

break;
}

Expand Down

0 comments on commit b6375da

Please sign in to comment.