예제 #1
0
        static void Main(string[] args)
        {
            StartIfNotRunning();

            OnSaveDelegate onSave = Save;

            cs = new ControllerSettings(onSave);

            //while (cs == null)
            //{
            //  Thread.Sleep(10);
            //}

            //WebSocketController wsc = new WebSocketController(cs.GetAuthCode);
            WebSocketController wsc = new WebSocketController(GetAuthCode);

            xc = new XboxControls(wsc, cs);

            wsc.Connect();

            //Thread t3 = new Thread(new ThreadStart(() =>
            //{
            //  while (cs.isRunning)
            //  {
            //    xc.CheckInput();
            //    Thread.Sleep(1);
            //  }
            //}));
            //t3.Start();

            //t3.Join();
            xc.ThreadStart();
        }
예제 #2
0
 public GameController(WebSocketController wsc, ControllerUserInterface ui)
 {
     this.wsc = wsc;
     LoadMappings();
     t = new Thread(new ThreadStart(() =>
     {
         while (ui.isRunning)
         {
             CheckInput();
             Thread.Sleep(1);
         }
     }
                                    ));
 }
예제 #3
0
 /// <summary>
 /// Instantiator method. The UI is being passed so we can see when it exits, and also so we can pass it to the WebSocketController
 /// which will use it to request input when GPMDP asks for the user's code. There is probably a better way to do this.
 /// </summary>
 /// <param name="ui">the UI that is being used</param>
 public XboxControls(WebSocketController wsc, ControllerUserInterface ui) : base(wsc, ui)
 {
 }