public Launcher(params string[] args) { mConfig = new LauncherConfig(args); if (!GlobalConditions.Init()) { Logger.Fatal("Unable to initialise Kinect. Exiting."); return; } var settings = new NinjectSettings { LoadExtensions = false }; IKernel k = new StandardKernel(settings, new XmlExtensionModule()); if (mConfig.BindingsFile == null) { Logger.Warn("Unable to launch. No bindings file specified."); return; } try { k.Load(mConfig.BindingsFile); } catch (Exception e) { Logger.Warn("Unable to launch. Problem loading bindings. " + e.Message); } if (k.TryGet<IMediaPlayer>() == null) k.Bind<IMediaPlayer>().To<DummyPlayer>().InSingletonScope(); try { mCore = k.Get<Core>(); } catch (Exception e) { Logger.Warn("Unable to launch. Problem instantiating coordinator. " + (e.InnerException != null ? e.InnerException.Message :e.Message)); Logger.Debug("", e); } }
static void Main(string[] args) { LauncherConfig cfg = new LauncherConfig(); if (cfg.LaunchServer) { sServerExe = cfg.ServerExe; sServerProcess = ProcessWrangler.InitProcess(sServerExe); //if (cfg.AutoRestart) //sServerProcess.Exited += sServerProcess_Exited; sServerProcess.Start(); Console.WriteLine("Server started."); Thread.Sleep(35 * 1000); } //sProxyExe = typeof(ChimeraLauncher).Assembly.Location; sProxyExe = cfg.ProxyExe; sProxyProcess = ProcessWrangler.InitProcess(sProxyExe); //if (cfg.AutoRestart) //sProxyProcess.Exited += sProxyProcess_Exited; sProxyProcess.Start(); Console.WriteLine("Chimera started."); Thread input = new Thread(() => { Console.WriteLine("Type Exit to quit."); string line = Console.ReadLine(); while (!line.ToUpper().Equals("EXIT")) { line = Console.ReadLine(); if (line.ToUpper().Equals("CLOSE PROXY")) { ProcessWrangler.PressKey(sProxyProcess, "{F4}", false, true, false); } } mShutdown = true; ProcessWrangler.PressKey(sProxyProcess, "{F4}", false, true, false); if (sServerProcess != null) { ProcessWrangler.PressKey(sServerProcess, "q{ENTER}"); } }); input.Name = "Launcher input thread."; //input.Start(); }
static void Main(string[] args) { LauncherConfig cfg = new LauncherConfig(); if (cfg.LaunchServer) { sServerExe = cfg.ServerExe; sServerProcess = ProcessWrangler.InitProcess(sServerExe); //if (cfg.AutoRestart) //sServerProcess.Exited += sServerProcess_Exited; sServerProcess.Start(); Console.WriteLine("Server started."); Thread.Sleep(35 * 1000); } //sProxyExe = typeof(ChimeraLauncher).Assembly.Location; sProxyExe = cfg.ProxyExe; sProxyProcess = ProcessWrangler.InitProcess(sProxyExe); //if (cfg.AutoRestart) //sProxyProcess.Exited += sProxyProcess_Exited; sProxyProcess.Start(); Console.WriteLine("Chimera started."); Thread input = new Thread(() => { Console.WriteLine("Type Exit to quit."); string line = Console.ReadLine(); while (!line.ToUpper().Equals("EXIT")) { line = Console.ReadLine(); if (line.ToUpper().Equals("CLOSE PROXY")) ProcessWrangler.PressKey(sProxyProcess, "{F4}", false, true, false); } mShutdown = true; ProcessWrangler.PressKey(sProxyProcess, "{F4}", false, true, false); if (sServerProcess != null) ProcessWrangler.PressKey(sServerProcess, "q{ENTER}"); }); input.Name = "Launcher input thread."; //input.Start(); }
public Launcher(params string[] args) { mConfig = new LauncherConfig(args); if (mConfig.InitKinect && !GlobalConditions.Init()) { Logger.Fatal("Unable to initialise Kinect. Exiting."); return; } var settings = new NinjectSettings { LoadExtensions = false }; IKernel k = new StandardKernel(settings, new XmlExtensionModule()); if (mConfig.BindingsFile == null) { Logger.Warn("Unable to launch. No bindings file specified."); return; } try { k.Load(mConfig.BindingsFile); } catch (Exception e) { Logger.Warn("Unable to launch. Problem loading bindings. " + e.Message); } if (k.TryGet <IMediaPlayer>() == null) { k.Bind <IMediaPlayer>().To <DummyPlayer>().InSingletonScope(); } try { mCore = k.Get <Core>(); } catch (Exception e) { Logger.Warn("Unable to launch. Problem instantiating coordinator. " + (e.InnerException != null ? e.InnerException.Message :e.Message)); //Logger.Debug("", e); } }