timeoutfix: original source and diff from reddit

from: https://www.reddit.com/r/spaceengineers/comments/f7ul3s/fix_for_server_is_not_responding_error/
by rexxar
This commit is contained in:
StalkR
2023-12-27 23:14:31 +01:00
parent ce435cdd87
commit 8493606298
2 changed files with 176 additions and 0 deletions

46
joinfix.diff Normal file
View File

@@ -0,0 +1,46 @@
Index: Sources/Sandbox.Game/Engine/Networking/MyWorkshop.cs
===================================================================
--- Sources/Sandbox.Game/Engine/Networking/MyWorkshop.cs (revision 124917)
+++ Sources/Sandbox.Game/Engine/Networking/MyWorkshop.cs (working copy)
@@ -196,6 +196,11 @@
}
}
+ public static bool DownloadScreenVisible
+ {
+ get { return m_downloadScreen?.Visible ?? false; }
+ }
+
private static MyGuiScreenMessageBox m_downloadScreen;
private static DownloadModsResult m_downloadResult;
Index: Sources/Sandbox.Game/Game/Screens/MyJoinGameHelper.cs
===================================================================
--- Sources/Sandbox.Game/Game/Screens/MyJoinGameHelper.cs (revision 124917)
+++ Sources/Sandbox.Game/Game/Screens/MyJoinGameHelper.cs (working copy)
@@ -247,16 +247,23 @@
}
bool isTop = MyScreenManager.IsScreenOnTop(progress);
- if (isTop && !worldRequestTime.IsRunning)
+ bool visible = MyWorkshop.DownloadScreenVisible;
+
+ if (!visible && isTop && !worldRequestTime.IsRunning)
{
worldRequestTime.Start();
}
- else if (!isTop && worldRequestTime.IsRunning)
+ else if (visible || !isTop && worldRequestTime.IsRunning)
{
worldRequestTime.Stop();
}
+ if (visible && progress.Visible)
+ progress.HideScreen();
+ else if (!visible && !progress.Visible)
+ progress.UnhideScreen();
+
if (worldRequestTime.IsRunning && worldRequestTime.Elapsed.TotalSeconds > worldRequestTimeout)
{
MyLog.Default.WriteLine("World requested - failed, server changed");