Skip to content

Commit 6680b0a

Browse files
committed
Fix services?
1 parent 997a3ca commit 6680b0a

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎Torch.Server/Program.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static void Main(string[] args)
6363
// Breaks on Windows Server 2019
6464
if (!new ComputerInfo().OSFullName.Contains("Server 2019") && !Environment.UserInteractive)
6565
{
66-
using (var service = new TorchService())
66+
using (var service = new TorchService(args))
6767
ServiceBase.Run(service);
6868
return;
6969
}

‎Torch.Server/TorchService.cs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ class TorchService : ServiceBase
1515
public const string Name = "Torch (SEDS)";
1616
private TorchServer _server;
1717
private Initializer _initializer;
18+
private string[] _args;
1819

19-
public TorchService()
20+
public TorchService(string[] args)
2021
{
22+
_args = args;
2123
var workingDir = new FileInfo(typeof(TorchService).Assembly.Location).Directory.ToString();
2224
Directory.SetCurrentDirectory(workingDir);
2325
_initializer = new Initializer(workingDir);
@@ -29,11 +31,11 @@ public TorchService()
2931
}
3032

3133
/// <inheritdoc />
32-
protected override void OnStart(string[] args)
34+
protected override void OnStart(string[] _)
3335
{
34-
base.OnStart(args);
36+
base.OnStart(_args);
3537

36-
_initializer.Initialize(args);
38+
_initializer.Initialize(_args);
3739
_initializer.Run();
3840
}
3941

‎Torch/VRageGame.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ private void Create()
199199
}
200200
MyRenderProxy.Initialize(renderer);
201201
MyRenderProfiler.SetAutocommit(false);
202-
MyRenderProfiler.InitMemoryHack("MainEntryPoint");
202+
//This broke services?
203+
//MyRenderProfiler.InitMemoryHack("MainEntryPoint");
203204
}
204205

205206
// Loads object builder serializers. Intuitive, right?

0 commit comments

Comments
 (0)