From b6375daabca253d1290581a70cf4178072215e5f Mon Sep 17 00:00:00 2001 From: wixoa Date: Wed, 20 Dec 2023 17:50:04 -0500 Subject: [PATCH] Attempt to reconnect after a disconnect (#1523) * Attempt to reconnect after a timed out connection * Update OpenDreamClient/States/DreamUserInterfaceStateManager.cs --- .../States/DreamUserInterfaceStateManager.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenDreamClient/States/DreamUserInterfaceStateManager.cs b/OpenDreamClient/States/DreamUserInterfaceStateManager.cs index 609e7b29c6..47b2e7343d 100644 --- a/OpenDreamClient/States/DreamUserInterfaceStateManager.cs +++ b/OpenDreamClient/States/DreamUserInterfaceStateManager.cs @@ -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(); + // 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; }