First test build

This commit is contained in:
John Gross
2017-03-30 15:24:39 -07:00
parent 650ab05d74
commit 5c1a9a5e35
47 changed files with 1610 additions and 498 deletions

View File

@@ -28,6 +28,7 @@ namespace Torch.Server
private static ITorchServer _server;
private static Logger _log = LogManager.GetLogger("Torch");
[STAThread]
public static void Main(string[] args)
{
if (!Environment.UserInteractive)
@@ -41,16 +42,16 @@ namespace Torch.Server
var configName = args.FirstOrDefault() ?? "TorchConfig.xml";
var configPath = Path.Combine(Directory.GetCurrentDirectory(), configName);
ServerConfig options;
TorchConfig options;
if (File.Exists(configName))
{
_log.Info($"Loading config {configPath}");
options = ServerConfig.LoadFrom(configPath);
options = TorchConfig.LoadFrom(configPath);
}
else
{
_log.Info($"Generating default config at {configPath}");
options = new ServerConfig();
options = new TorchConfig();
options.SaveTo(configPath);
}
@@ -117,7 +118,9 @@ namespace Torch.Server
_server = new TorchServer(options);
_server.Init();
_server.Start();
var ui = new TorchUI((TorchServer)_server);
ui.LoadConfig(options);
ui.ShowDialog();
}
}
}