From b652181dda5bfebdb77ad3f9cfa4654564d435f1 Mon Sep 17 00:00:00 2001 From: John Gross Date: Wed, 24 Jan 2018 16:32:11 -0800 Subject: [PATCH] Remove timeouts when waiting for game state changes --- Torch/TorchBase.cs | 8 ++++---- Torch/VRageGame.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Torch/TorchBase.cs b/Torch/TorchBase.cs index c549925..7676e89 100644 --- a/Torch/TorchBase.cs +++ b/Torch/TorchBase.cs @@ -334,7 +334,7 @@ namespace Torch Managers.GetManager().LoadPlugins(); Game = new VRageGame(this, TweakGameSettings, SteamAppName, SteamAppId, Config.InstancePath, RunArgs); - if (!Game.WaitFor(VRageGame.GameState.Stopped, TimeSpan.FromMinutes(5))) + if (!Game.WaitFor(VRageGame.GameState.Stopped)) Log.Warn("Failed to wait for game to be initialized"); Managers.Attach(); _init = true; @@ -357,7 +357,7 @@ namespace Torch { Managers.Detach(); Game.SignalDestroy(); - if (!Game.WaitFor(VRageGame.GameState.Destroyed, _gameStateChangeTimeout)) + if (!Game.WaitFor(VRageGame.GameState.Destroyed)) Log.Warn("Failed to wait for the game to be destroyed"); Game = null; } @@ -407,7 +407,7 @@ namespace Torch public virtual void Start() { Game.SignalStart(); - if (!Game.WaitFor(VRageGame.GameState.Running, _gameStateChangeTimeout)) + if (!Game.WaitFor(VRageGame.GameState.Running)) Log.Warn("Failed to wait for the game to be started"); } @@ -416,7 +416,7 @@ namespace Torch { LogManager.Flush(); Game.SignalStop(); - if (!Game.WaitFor(VRageGame.GameState.Stopped, _gameStateChangeTimeout)) + if (!Game.WaitFor(VRageGame.GameState.Stopped)) Log.Warn("Failed to wait for the game to be stopped"); } diff --git a/Torch/VRageGame.cs b/Torch/VRageGame.cs index fa9dd73..d6071af 100644 --- a/Torch/VRageGame.cs +++ b/Torch/VRageGame.cs @@ -382,7 +382,7 @@ namespace Torch /// State to transition to /// Timeout /// - public bool WaitFor(GameState state, TimeSpan? timeout) + public bool WaitFor(GameState state, TimeSpan? timeout = null) { // Kinda icky, but we can't block the update and expect the state to change. if (Thread.CurrentThread == _updateThread)