Merge pull request #67 from Mavy87/master
Fix to allow Torch to run as a service.
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Torch.Server
|
|||||||
{
|
{
|
||||||
base.OnStart(args);
|
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");
|
var options = new TorchConfig("Torch");
|
||||||
if (File.Exists(configName))
|
if (File.Exists(configName))
|
||||||
options = TorchConfig.LoadFrom(configName);
|
options = TorchConfig.LoadFrom(configName);
|
||||||
|
@@ -229,7 +229,11 @@ namespace Torch
|
|||||||
TorchVersion = Assembly.GetEntryAssembly().GetName().Version;
|
TorchVersion = Assembly.GetEntryAssembly().GetName().Version;
|
||||||
GameVersion = new Version(new MyVersion(MyPerGameSettings.BasicGameInfo.GameVersion.Value).FormattedText.ToString().Replace("_", "."));
|
GameVersion = new Version(new MyVersion(MyPerGameSettings.BasicGameInfo.GameVersion.Value).FormattedText.ToString().Replace("_", "."));
|
||||||
var verInfo = $"{Config.InstanceName} - Torch {TorchVersion}, SE {GameVersion}";
|
var verInfo = $"{Config.InstanceName} - Torch {TorchVersion}, SE {GameVersion}";
|
||||||
Console.Title = verInfo;
|
try { Console.Title = verInfo; }
|
||||||
|
catch {
|
||||||
|
///Running as service
|
||||||
|
}
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Log.Info("DEBUG");
|
Log.Info("DEBUG");
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user