Exemplo n.º 1
0
        private void GetTrackingData()
        {
            Console.WriteLine("Waiting for DCS connection...");
            TcpClient client = dcsConnection.AcceptTcpClient();

            Console.WriteLine("DCS connected :-)");

            StreamReader reader = new StreamReader(client.GetStream());

            while (continueTracking)
            {
                string s = reader.ReadLine();
                Console.WriteLine(s);

                if (s == "exit")
                {
                    break;
                }

                aircraftPosition = new AircraftPosition().DeserializeJSON(s);
                aircraftPosition.SerializeToJSON(@"c:\posData.json");

                UpdateAllLabels();
                Thread.Sleep(300);
            }

            reader.Close();
            client.Close();
        }
Exemplo n.º 2
0
 public MSFSForm(Game g)
 {
     InitializeComponent();
     aircraftPosition = new AircraftPosition();
     this.g           = g;
     Text             = "Flight Sim Tracker (" + g.ToString() + ")";
     serverOn         = false;
     webServerCircle  = onOffPanel.CreateGraphics();
     flightSimCircle  = flightSimConnectionCircle.CreateGraphics();
 }
Exemplo n.º 3
0
 public DCSForm(Game g)
 {
     InitializeComponent();
     aircraftPosition = new AircraftPosition();
     this.g           = g;
     Text             = "Flight Sim Tracker (" + g.ToString() + ")";
     dcsConnection    = new TcpListener(IPAddress.Parse("127.0.0.1"), 31950);
     webServerCircle  = onOffPanel.CreateGraphics();
     flightSimCircle  = flightSimConnectionCircle.CreateGraphics();
 }