EntityControlManager partial rewrite to do lazy updating

Auto commit patches once SE instance has been created
This commit is contained in:
Westin Miller
2017-11-01 05:08:17 -07:00
parent 6814a833be
commit c8377b318e
5 changed files with 117 additions and 40 deletions

View File

@@ -103,9 +103,19 @@ namespace Torch.Server
MyPlugins.Load();
MyGlobalTypeMetadata.Static.Init();
Managers.GetManager<ITorchSessionManager>().SessionStateChanged += OnSessionStateChanged;
GetManager<InstanceManager>().LoadInstance(Config.InstancePath);
}
private void OnSessionStateChanged(ITorchSession session, TorchSessionState newState)
{
if (newState == TorchSessionState.Unloading || newState == TorchSessionState.Unloaded)
{
_watchdog?.Dispose();
_watchdog = null;
}
}
private void InvokeBeforeRun()
{
MySandboxGame.Log.Init("SpaceEngineers-Dedicated.log", MyFinalBuildConstants.APP_VERSION_STRING);