Redial Button II - Now with magic! (#8237)

* Redial Button II - Now with magic!

* 15-second timer before redial is allowed
This commit is contained in:
20kdc
2022-05-22 02:56:18 +01:00
committed by GitHub
parent 959c9a9615
commit 98c2b34512
7 changed files with 121 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ using System;
using Robust.Client;
using Robust.Client.UserInterface;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Network;
namespace Content.Client.Launcher
@@ -70,6 +71,12 @@ namespace Content.Client.Launcher
private void OnConnectFailed(object? _, NetConnectFailArgs args)
{
if (args.RedialFlag)
{
// We've just *attempted* to connect and we've been told we need to redial, so do it.
// Result deliberately discarded.
Redial();
}
ConnectFailReason = args.Reason;
CurrentPage = Page.ConnectFailed;
}
@@ -88,6 +95,27 @@ namespace Content.Client.Launcher
}
}
public bool Redial()
{
try
{
if (_gameController.LaunchState.Ss14Address != null)
{
_gameController.Redial(_gameController.LaunchState.Ss14Address);
return true;
}
else
{
Logger.InfoS("launcher-ui", $"Redial not possible, no Ss14Address");
}
}
catch (Exception ex)
{
Logger.ErrorS("launcher-ui", $"Redial exception: {ex}");
}
return false;
}
public void Exit()
{
_gameController.Shutdown("Exit button pressed");