Merge pull request #67 from Mavy87/master

Fix to allow Torch to run as a service.
This commit is contained in:
John Michael Gross
2017-08-17 09:29:04 -07:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ namespace Torch.Server
{
base.OnStart(args);
string configName = args.Length > 0 ? args[0] : "TorchConfig.xml";
string configName = args.Length > 0 ? args[0] : "Torch.cfg";
var options = new TorchConfig("Torch");
if (File.Exists(configName))
options = TorchConfig.LoadFrom(configName);

View File

@@ -229,7 +229,11 @@ namespace Torch
TorchVersion = Assembly.GetEntryAssembly().GetName().Version;
GameVersion = new Version(new MyVersion(MyPerGameSettings.BasicGameInfo.GameVersion.Value).FormattedText.ToString().Replace("_", "."));
var verInfo = $"{Config.InstanceName} - Torch {TorchVersion}, SE {GameVersion}";
Console.Title = verInfo;
try { Console.Title = verInfo; }
catch {
///Running as service
}
#if DEBUG
Log.Info("DEBUG");
#else