diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 080e7f21a..961e7d46a 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -899,7 +899,25 @@ namespace Barotrauma.Networking teamCount = 2; } - GameMain.GameSession.StartShift(GameMain.NetLobbyScreen.LevelSeed, teamCount > 1); + bool couldNotStart = false; + try + { + GameMain.GameSession.StartShift(GameMain.NetLobbyScreen.LevelSeed, teamCount > 1); + } + + catch (Exception e) + { + DebugConsole.ThrowError("Failed to start a new round", e); + + //try again in >5 seconds + if (autoRestart) AutoRestartTimer = Math.Max(AutoRestartInterval, 5.0f); + GameMain.NetLobbyScreen.StartButton.Enabled = true; + + couldNotStart = true; + + } + + if (couldNotStart) yield return CoroutineStatus.Failure; GameServer.Log("Starting a new round...", Color.Cyan); GameServer.Log("Submarine: " + selectedSub.Name, Color.Cyan); diff --git a/Subsurface/Source/Program.cs b/Subsurface/Source/Program.cs index 9988b0045..38a6bdb2b 100644 --- a/Subsurface/Source/Program.cs +++ b/Subsurface/Source/Program.cs @@ -63,9 +63,10 @@ namespace Barotrauma sb.AppendLine("If you'd like to help fix the bug that caused the crash, please send this file to the developers on the Undertow Games forums."); sb.AppendLine("\n"); sb.AppendLine("Game version " + GameMain.Version); + sb.AppendLine("Graphics mode: " + GameMain.Config.WindowMode + "x" + GameMain.Config.GraphicsHeight + " (" + GameMain.Config.WindowMode.ToString() + ")"); sb.AppendLine("Selected content package: " + GameMain.SelectedPackage.Name); - sb.AppendLine("Level seed: "+ ((Level.Loaded == null) ? "no level loaded" : Level.Loaded.Seed)); - sb.AppendLine("Loaded submarine: " + ((Submarine.MainSub == null) ? "none" : Submarine.MainSub.Name +" ("+Submarine.MainSub.MD5Hash+")")); + sb.AppendLine("Level seed: " + ((Level.Loaded == null) ? "no level loaded" : Level.Loaded.Seed)); + sb.AppendLine("Loaded submarine: " + ((Submarine.MainSub == null) ? "None" : Submarine.MainSub.Name + " (" + Submarine.MainSub.MD5Hash + ")")); sb.AppendLine("Selected screen: " + (Screen.Selected == null ? "None" : Screen.Selected.ToString())); if (GameMain.Server != null) diff --git a/Subsurface/Source/Screens/NetLobbyScreen.cs b/Subsurface/Source/Screens/NetLobbyScreen.cs index d57d1bd9c..074a20ec1 100644 --- a/Subsurface/Source/Screens/NetLobbyScreen.cs +++ b/Subsurface/Source/Screens/NetLobbyScreen.cs @@ -149,10 +149,11 @@ namespace Barotrauma if (GameMain.Server != null) { if (!GameMain.Server.AutoRestart) return ""; - return "Restarting in " + ToolBox.SecondsToReadableTime(GameMain.Server.AutoRestartTimer); + return "Restarting in " + ToolBox.SecondsToReadableTime(Math.Max(GameMain.Server.AutoRestartTimer, 0)); } + if (autoRestartTimer == 0.0f) return ""; - return "Restarting in " + ToolBox.SecondsToReadableTime(autoRestartTimer); + return "Restarting in " + ToolBox.SecondsToReadableTime(Math.Max(autoRestartTimer, 0)); } public NetLobbyScreen()