Skip to content

Commit

Permalink
fix: Correct the editor reconnect attempt timer in the most hideous o…
Browse files Browse the repository at this point in the history
…f ways (#1943)
  • Loading branch information
Cheshire92 authored Oct 13, 2023
1 parent 2019765 commit 6a9f5f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Intersect.Editor/Forms/frmLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void tmrSocket_Tick(object sender, EventArgs e)
NetworkStatus.Unknown => Strings.Login.Denied,
NetworkStatus.Connecting => Strings.Login.connecting,
NetworkStatus.Online => Strings.Login.connected,
NetworkStatus.Offline => Strings.Login.failedtoconnect.ToString(((Globals.ReconnectTime - Timing.Global.MillisecondsUtc) / 1000).ToString("0")),
NetworkStatus.Offline => Strings.Login.failedtoconnect.ToString(((Globals.NextServerStatusPing - Timing.Global.MillisecondsUtc) / 1000).ToString("0")),
NetworkStatus.Failed => Strings.Login.Denied,
NetworkStatus.VersionMismatch => Strings.Login.Denied,
NetworkStatus.ServerFull => Strings.Login.Denied,
Expand Down
2 changes: 2 additions & 0 deletions Intersect.Editor/General/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public static partial class Globals
//Network Variables
public static int ReconnectTime = 3000;

public static long NextServerStatusPing;

//Game Object Editors
public static FrmResource ResourceEditor;

Expand Down
1 change: 1 addition & 0 deletions Intersect.Editor/Networking/Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public static void Update()
}

_nextServerStatusPing = now + ServerStatusPingInterval;
Globals.NextServerStatusPing = _nextServerStatusPing;
}
}

Expand Down

0 comments on commit 6a9f5f3

Please sign in to comment.