Beispiel #1
0
        public void TestShipMonitorDeserialization()
        {
            // Read from our test item "shipMonitor.json"
            ShipMonitorConfiguration configuration = new ShipMonitorConfiguration();

            try
            {
                string data = System.IO.File.ReadAllText("shipMonitor.json");
                if (data != null)
                {
                    configuration = JsonConvert.DeserializeObject <ShipMonitorConfiguration>(data);
                }
            }
            catch (Exception)
            {
                Assert.Fail("Failed to read ship configuration");
            }

            // Start a ship monitor
            ShipMonitor shipMonitor   = new ShipMonitor();
            var         privateObject = new PrivateObject(shipMonitor);

            // Build a new shipyard
            List <Ship> newShiplist = configuration.shipyard.OrderBy(s => s.model).ToList();

            // Update the shipyard
            privateObject.SetFieldOrProperty("shipyard", new ObservableCollection <Ship>(newShiplist));
            privateObject.SetFieldOrProperty("updateDat", DateTime.MinValue);

            shipMonitor.SetCurrentShip(configuration.currentshipid);
            Assert.AreEqual(81, shipMonitor.GetCurrentShip().LocalId);

            Ship ship1 = shipMonitor.GetShip(0);
            Ship ship2 = shipMonitor.GetShip(81);

            Assert.IsNotNull(ship1);
            Assert.AreEqual("Cobra Mk. III", ship1.model);
            Assert.AreEqual(0, ship1.LocalId);
            Assert.AreEqual("The Dynamo", ship1.name);
            Assert.AreEqual("Laksak", ship1.starsystem);
            Assert.AreEqual("Stjepan Seljan Hub", ship1.station);
            Assert.AreEqual(8605684, ship1.value);

            Assert.IsNotNull(ship2);
            Assert.AreEqual("Krait Mk. II", ship2.model);
            Assert.AreEqual(81, ship2.LocalId);
            Assert.AreEqual("The Impact Kraiter", ship2.name);
            Assert.AreEqual(16, ship2.cargocapacity);
            Assert.AreEqual(8, ship2.compartments.Count());
            Assert.AreEqual("Slot01_Size6", ship2.compartments[0].name);
            Assert.AreEqual(6, ship2.compartments[0].size);
            Assert.IsNotNull(ship2.compartments[0].module);
            Assert.AreEqual("Int_ShieldGenerator_Size6_Class3_Fast", ship2.compartments[0].module.EDName);
            Assert.AreEqual("Bi-Weave Shield Generator", ship2.compartments[0].module.invariantName);
            Assert.AreEqual("SRV", ship2.launchbays[0].type);
            Assert.AreEqual(2, ship2.launchbays[0].vehicles.Count());
        }
Beispiel #2
0
        public void TestShipScenario1()
        {
            int sidewinderId = 901;
            int courierId    = 902;

            Ship sidewinder;
            Ship courier;

            // Set ourselves as in beta to stop sending data to remote systems
            EDDI.Instance.eventHandler(new FileHeaderEvent(DateTime.Now, "JournalBeta.txt", "beta", "beta"));
            Logging.Verbose = true;

            // Start a ship monitor
            ShipMonitor shipMonitor = new ShipMonitor();

            // Log in
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:10:21Z"", ""event"":""LoadGame"", ""Commander"":""McDonald"", ""Ship"":""SideWinder"", ""ShipID"":901, ""ShipName"":"""", ""ShipIdent"":"""", ""FuelLevel"":2.000000, ""FuelCapacity"":2.000000, ""GameMode"":""Solo"", ""Credits"":1637243231, ""Loan"":0 }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:10:24Z"", ""event"":""Location"", ""Docked"":true, ""StationName"":""Jameson Memorial"", ""StationType"":""Orbis"", ""StarSystem"":""Shinrarta Dezhra"", ""StarPos"":[55.719,17.594,27.156], ""SystemAllegiance"":""Independent"", ""SystemEconomy"":""$economy_HighTech;"", ""SystemEconomy_Localised"":""High Tech"", ""SystemGovernment"":""$government_Democracy;"", ""SystemGovernment_Localised"":""Democracy"", ""SystemSecurity"":""$SYSTEM_SECURITY_high;"", ""SystemSecurity_Localised"":""High Security"", ""Body"":""Jameson Memorial"", ""BodyType"":""Station"", ""Factions"":[ { ""Name"":""Lori Jameson"", ""FactionState"":""None"", ""Government"":""Engineer"", ""Influence"":0.040307, ""Allegiance"":""Independent"" }, { ""Name"":""LTT 4487 Industry"", ""FactionState"":""None"", ""Government"":""Corporate"", ""Influence"":0.191939, ""Allegiance"":""Federation"" }, { ""Name"":""The Pilots Federation"", ""FactionState"":""Boom"", ""Government"":""Democracy"", ""Influence"":0.447217, ""Allegiance"":""Independent"" }, { ""Name"":""Future of Arro Naga"", ""FactionState"":""Boom"", ""Government"":""Democracy"", ""Influence"":0.128599, ""Allegiance"":""Federation"" }, { ""Name"":""The Dark Wheel"", ""FactionState"":""Boom"", ""Government"":""Democracy"", ""Influence"":0.092131, ""Allegiance"":""Independent"" }, { ""Name"":""Los Chupacabras"", ""FactionState"":""None"", ""Government"":""PrisonColony"", ""Influence"":0.099808, ""Allegiance"":""Independent"" } ], ""SystemFaction"":""The Pilots Federation"", ""FactionState"":""Boom"" }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:10:25Z"", ""event"":""Docked"", ""StationName"":""Jameson Memorial"", ""StationType"":""Orbis"", ""StarSystem"":""Shinrarta Dezhra"", ""StationFaction"":""The Pilots Federation"", ""FactionState"":""Boom"", ""StationGovernment"":""$government_Democracy;"", ""StationGovernment_Localised"":""Democracy"", ""StationEconomy"":""$economy_HighTech;"", ""StationEconomy_Localised"":""High Tech"", ""DistFromStarLS"":325.124878 }", shipMonitor);

            sidewinder = shipMonitor.GetShip(sidewinderId);
            Assert.AreEqual(sidewinder, shipMonitor.GetCurrentShip());
            Assert.AreEqual(sidewinder.model, "Sidewinder");
            Assert.AreEqual(100, sidewinder.health);

            // Purchase a Courier
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:14:37Z"", ""event"":""ShipyardBuy"", ""ShipType"":""empire_courier"", ""ShipPrice"":2231423, ""StoreOldShip"":""SideWinder"", ""StoreShipID"":901 }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:14:38Z"", ""event"":""Cargo"", ""Inventory"":[ ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:14:38Z"", ""event"":""Loadout"", ""Ship"":""Empire_Courier"", ""ShipID"":902, ""ShipName"":"""", ""ShipIdent"":"""", ""Modules"":[ { ""Slot"":""MediumHardpoint1"", ""Item"":""Hpt_PulseLaser_Fixed_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1930 }, { ""Slot"":""MediumHardpoint2"", ""Item"":""Hpt_PulseLaser_Fixed_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1930 }, { ""Slot"":""Armour"", ""Item"":""Empire_Courier_Armour_Grade1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""PowerPlant"", ""Item"":""Int_PowerPlant_Size4_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":17442 }, { ""Slot"":""MainEngines"", ""Item"":""Int_Engine_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5502 }, { ""Slot"":""FrameShiftDrive"", ""Item"":""Int_Hyperdrive_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5502 }, { ""Slot"":""LifeSupport"", ""Item"":""Int_LifeSupport_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""PowerDistributor"", ""Item"":""Int_PowerDistributor_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":3556 }, { ""Slot"":""Radar"", ""Item"":""Int_Sensors_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1270 }, { ""Slot"":""FuelTank"", ""Item"":""Int_FuelTank_Size3_Class3"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":6197 }, { ""Slot"":""Slot01_Size3"", ""Item"":""Int_CargoRack_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":2851 }, { ""Slot"":""Slot02_Size3"", ""Item"":""Int_CargoRack_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":2851 }, { ""Slot"":""Slot03_Size2"", ""Item"":""Int_ShieldGenerator_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""Slot04_Size2"", ""Item"":""Int_CargoRack_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""Slot05_Size2"", ""Item"":""Int_CargoRack_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""Slot06_Size1"", ""Item"":""Int_StellarBodyDiscoveryScanner_Standard"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""PlanetaryApproachSuite"", ""Item"":""Int_PlanetApproachSuite"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":438 }, { ""Slot"":""ShipCockpit"", ""Item"":""Empire_Courier_Cockpit"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""CargoHatch"", ""Item"":""ModularCargoBayDoor"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":0 } ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:14:38Z"", ""event"":""ShipyardNew"", ""ShipType"":""empire_courier"", ""NewShipID"":902 }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:14:48Z"", ""event"":""Docked"", ""StationName"":""Jameson Memorial"", ""StationType"":""Orbis"", ""StarSystem"":""Shinrarta Dezhra"", ""StationFaction"":""The Pilots Federation"", ""FactionState"":""Boom"", ""StationGovernment"":""$government_Democracy;"", ""StationGovernment_Localised"":""Democracy"", ""StationEconomy"":""$economy_HighTech;"", ""StationEconomy_Localised"":""High Tech"", ""DistFromStarLS"":325.122131 }", shipMonitor);

            sidewinder = shipMonitor.GetShip(sidewinderId);
            Assert.AreEqual(sidewinder.model, "Sidewinder");

            courier = shipMonitor.GetShip(courierId);
            Assert.AreEqual(courier, shipMonitor.GetCurrentShip());
            Assert.AreEqual(courier.model, "Imperial Courier");
            Assert.AreEqual(100, courier.health);

            // Swap back to the SideWinder
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:17:15Z"", ""event"":""ShipyardSwap"", ""ShipType"":""sidewinder"", ""ShipID"":901, ""StoreOldShip"":""Empire_Courier"", ""StoreShipID"":902 }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:17:16Z"", ""event"":""Cargo"", ""Inventory"":[ ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:17:16Z"", ""event"":""Loadout"", ""Ship"":""SideWinder"", ""ShipID"":901, ""ShipName"":"""", ""ShipIdent"":"""", ""Modules"":[ { ""Slot"":""SmallHardpoint1"", ""Item"":""Hpt_PulseLaser_Gimbal_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5791 }, { ""Slot"":""SmallHardpoint2"", ""Item"":""Hpt_PulseLaser_Gimbal_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5791 }, { ""Slot"":""Armour"", ""Item"":""SideWinder_Armour_Grade1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""PowerPlant"", ""Item"":""Int_PowerPlant_Size2_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""MainEngines"", ""Item"":""Int_Engine_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""FrameShiftDrive"", ""Item"":""Int_Hyperdrive_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""LifeSupport"", ""Item"":""Int_LifeSupport_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""PowerDistributor"", ""Item"":""Int_PowerDistributor_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""Radar"", ""Item"":""Int_Sensors_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""FuelTank"", ""Item"":""Int_FuelTank_Size1_Class3"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""Slot01_Size2"", ""Item"":""Int_ShieldGenerator_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""Slot02_Size2"", ""Item"":""Int_CargoRack_Size2_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":2851 }, { ""Slot"":""Slot03_Size1"", ""Item"":""Int_StellarBodyDiscoveryScanner_Standard"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""PlanetaryApproachSuite"", ""Item"":""Int_PlanetApproachSuite"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":438 }, { ""Slot"":""ShipCockpit"", ""Item"":""Sidewinder_Cockpit"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""CargoHatch"", ""Item"":""ModularCargoBayDoor"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":0 } ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:17:25Z"", ""event"":""Docked"", ""StationName"":""Jameson Memorial"", ""StationType"":""Orbis"", ""StarSystem"":""Shinrarta Dezhra"", ""StationFaction"":""The Pilots Federation"", ""FactionState"":""Boom"", ""StationGovernment"":""$government_Democracy;"", ""StationGovernment_Localised"":""Democracy"", ""StationEconomy"":""$economy_HighTech;"", ""StationEconomy_Localised"":""High Tech"", ""DistFromStarLS"":325.120514 }", shipMonitor);

            sidewinder = shipMonitor.GetShip(sidewinderId);
            Assert.AreEqual(sidewinder, shipMonitor.GetCurrentShip());
            Assert.AreEqual(sidewinder.model, "Sidewinder");

            // Swap back to the Courier
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:18:35Z"", ""event"":""ShipyardSwap"", ""ShipType"":""empire_courier"", ""ShipID"":902, ""StoreOldShip"":""SideWinder"", ""StoreShipID"":901 }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:18:35Z"", ""event"":""Cargo"", ""Inventory"":[ ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:18:36Z"", ""event"":""Loadout"", ""Ship"":""Empire_Courier"", ""ShipID"":902, ""ShipName"":"""", ""ShipIdent"":"""", ""Modules"":[ { ""Slot"":""MediumHardpoint1"", ""Item"":""Hpt_PulseLaser_Fixed_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1930 }, { ""Slot"":""MediumHardpoint2"", ""Item"":""Hpt_PulseLaser_Fixed_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1930 }, { ""Slot"":""Armour"", ""Item"":""Empire_Courier_Armour_Grade1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""PowerPlant"", ""Item"":""Int_PowerPlant_Size4_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":17442 }, { ""Slot"":""MainEngines"", ""Item"":""Int_Engine_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5502 }, { ""Slot"":""FrameShiftDrive"", ""Item"":""Int_Hyperdrive_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5502 }, { ""Slot"":""LifeSupport"", ""Item"":""Int_LifeSupport_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""PowerDistributor"", ""Item"":""Int_PowerDistributor_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":3556 }, { ""Slot"":""Radar"", ""Item"":""Int_Sensors_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1270 }, { ""Slot"":""FuelTank"", ""Item"":""Int_FuelTank_Size3_Class3"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":6197 }, { ""Slot"":""Slot01_Size3"", ""Item"":""Int_CargoRack_Size2_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":2851 }, { ""Slot"":""Slot02_Size3"", ""Item"":""Int_CargoRack_Size2_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":2851 }, { ""Slot"":""Slot03_Size2"", ""Item"":""Int_ShieldGenerator_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""Slot04_Size2"", ""Item"":""Int_CargoRack_Size1_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""Slot05_Size2"", ""Item"":""Int_CargoRack_Size1_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""Slot06_Size1"", ""Item"":""Int_StellarBodyDiscoveryScanner_Standard"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""PlanetaryApproachSuite"", ""Item"":""Int_PlanetApproachSuite"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":438 }, { ""Slot"":""ShipCockpit"", ""Item"":""Empire_Courier_Cockpit"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""CargoHatch"", ""Item"":""ModularCargoBayDoor"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":0 } ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:18:45Z"", ""event"":""Docked"", ""StationName"":""Jameson Memorial"", ""StationType"":""Orbis"", ""StarSystem"":""Shinrarta Dezhra"", ""StationFaction"":""The Pilots Federation"", ""FactionState"":""Boom"", ""StationGovernment"":""$government_Democracy;"", ""StationGovernment_Localised"":""Democracy"", ""StationEconomy"":""$economy_HighTech;"", ""StationEconomy_Localised"":""High Tech"", ""DistFromStarLS"":325.119690 }", shipMonitor);

            courier = shipMonitor.GetShip(courierId);
            Assert.AreEqual(courier, shipMonitor.GetCurrentShip());
            Assert.AreEqual(courier.model, "Imperial Courier");

            // Name the Courier
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:19:55Z"", ""event"":""SetUserShipName"", ""Ship"":""empire_courier"", ""ShipID"":902, ""UserShipName"":""Scunthorpe Bound"", ""UserShipId"":""MC-24E"" }", shipMonitor);

            courier = shipMonitor.GetShip(courierId);
            Assert.AreEqual(courier, shipMonitor.GetCurrentShip());
            Assert.AreEqual(courier.model, "Imperial Courier");
            Assert.AreEqual(courier.name, "Scunthorpe Bound");

            // Swap back to the SideWinder
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:21:03Z"", ""event"":""ShipyardSwap"", ""ShipType"":""sidewinder"", ""ShipID"":901, ""StoreOldShip"":""Empire_Courier"", ""StoreShipID"":902 }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:21:04Z"", ""event"":""Cargo"", ""Inventory"":[ ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:21:04Z"", ""event"":""Loadout"", ""Ship"":""SideWinder"", ""ShipID"":901, ""ShipName"":"""", ""ShipIdent"":"""", ""Modules"":[ { ""Slot"":""SmallHardpoint1"", ""Item"":""Hpt_PulseLaser_Gimbal_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5791 }, { ""Slot"":""SmallHardpoint2"", ""Item"":""Hpt_PulseLaser_Gimbal_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5791 }, { ""Slot"":""Armour"", ""Item"":""SideWinder_Armour_Grade1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""PowerPlant"", ""Item"":""Int_PowerPlant_Size2_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""MainEngines"", ""Item"":""Int_Engine_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""FrameShiftDrive"", ""Item"":""Int_Hyperdrive_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""LifeSupport"", ""Item"":""Int_LifeSupport_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""PowerDistributor"", ""Item"":""Int_PowerDistributor_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""Radar"", ""Item"":""Int_Sensors_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""FuelTank"", ""Item"":""Int_FuelTank_Size1_Class3"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""Slot01_Size2"", ""Item"":""Int_ShieldGenerator_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""Slot02_Size2"", ""Item"":""Int_CargoRack_Size2_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":2851 }, { ""Slot"":""Slot03_Size1"", ""Item"":""Int_StellarBodyDiscoveryScanner_Standard"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""PlanetaryApproachSuite"", ""Item"":""Int_PlanetApproachSuite"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":438 }, { ""Slot"":""ShipCockpit"", ""Item"":""Sidewinder_Cockpit"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""CargoHatch"", ""Item"":""ModularCargoBayDoor"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":0 } ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:21:13Z"", ""event"":""Docked"", ""StationName"":""Jameson Memorial"", ""StationType"":""Orbis"", ""StarSystem"":""Shinrarta Dezhra"", ""StationFaction"":""The Pilots Federation"", ""FactionState"":""Boom"", ""StationGovernment"":""$government_Democracy;"", ""StationGovernment_Localised"":""Democracy"", ""StationEconomy"":""$economy_HighTech;"", ""StationEconomy_Localised"":""High Tech"", ""DistFromStarLS"":325.120514 }", shipMonitor);

            sidewinder = shipMonitor.GetShip(sidewinderId);
            Assert.AreEqual(sidewinder, shipMonitor.GetCurrentShip());
            Assert.AreEqual(sidewinder.model, "Sidewinder");

            // Swap back to the Courier
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:21:47Z"", ""event"":""ShipyardSwap"", ""ShipType"":""empire_courier"", ""ShipID"":902, ""StoreOldShip"":""SideWinder"", ""StoreShipID"":901 }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:21:48Z"", ""event"":""Cargo"", ""Inventory"":[ ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:21:48Z"", ""event"":""Loadout"", ""Ship"":""Empire_Courier"", ""ShipID"":902, ""ShipName"":""Scunthorpe Bound"", ""ShipIdent"":""MC-24E"", ""Modules"":[ { ""Slot"":""MediumHardpoint1"", ""Item"":""Hpt_PulseLaser_Fixed_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1930 }, { ""Slot"":""MediumHardpoint2"", ""Item"":""Hpt_PulseLaser_Fixed_Small"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1930 }, { ""Slot"":""Armour"", ""Item"":""Empire_Courier_Armour_Grade1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""PowerPlant"", ""Item"":""Int_PowerPlant_Size4_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":17442 }, { ""Slot"":""MainEngines"", ""Item"":""Int_Engine_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5502 }, { ""Slot"":""FrameShiftDrive"", ""Item"":""Int_Hyperdrive_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":5502 }, { ""Slot"":""LifeSupport"", ""Item"":""Int_LifeSupport_Size1_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":453 }, { ""Slot"":""PowerDistributor"", ""Item"":""Int_PowerDistributor_Size3_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":3556 }, { ""Slot"":""Radar"", ""Item"":""Int_Sensors_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1270 }, { ""Slot"":""FuelTank"", ""Item"":""Int_FuelTank_Size3_Class3"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":6197 }, { ""Slot"":""Slot01_Size3"", ""Item"":""Int_CargoRack_Size2_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":2851 }, { ""Slot"":""Slot02_Size3"", ""Item"":""Int_CargoRack_Size2_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":2851 }, { ""Slot"":""Slot03_Size2"", ""Item"":""Int_ShieldGenerator_Size2_Class1"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":1735 }, { ""Slot"":""Slot04_Size2"", ""Item"":""Int_CargoRack_Size1_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""Slot05_Size2"", ""Item"":""Int_CargoRack_Size1_Class1"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""Slot06_Size1"", ""Item"":""Int_StellarBodyDiscoveryScanner_Standard"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":877 }, { ""Slot"":""PlanetaryApproachSuite"", ""Item"":""Int_PlanetApproachSuite"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":438 }, { ""Slot"":""ShipCockpit"", ""Item"":""Empire_Courier_Cockpit"", ""On"":true, ""Priority"":1, ""Health"":1.000000, ""Value"":0 }, { ""Slot"":""CargoHatch"", ""Item"":""ModularCargoBayDoor"", ""On"":true, ""Priority"":2, ""Health"":1.000000, ""Value"":0 } ] }", shipMonitor);
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:21:57Z"", ""event"":""Docked"", ""StationName"":""Jameson Memorial"", ""StationType"":""Orbis"", ""StarSystem"":""Shinrarta Dezhra"", ""StationFaction"":""The Pilots Federation"", ""FactionState"":""Boom"", ""StationGovernment"":""$government_Democracy;"", ""StationGovernment_Localised"":""Democracy"", ""StationEconomy"":""$economy_HighTech;"", ""StationEconomy_Localised"":""High Tech"", ""DistFromStarLS"":325.117706 }", shipMonitor);

            courier = shipMonitor.GetShip(courierId);
            Assert.AreEqual(courier, shipMonitor.GetCurrentShip());
            Assert.AreEqual(courier.model, "Imperial Courier");
            Assert.AreEqual(courier.name, "Scunthorpe Bound");

            // Sell the Sidewinder
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:27:51Z"", ""event"":""ShipyardSell"", ""ShipType"":""sidewinder"", ""SellShipID"":901, ""ShipPrice"":25272 }", shipMonitor);

            // Sell the Courier.  Note that this isn't strictly legal, as it involves selling our active ship, but we can get away with it in our test harness
            SendEvents(@"{ ""timestamp"":""2017-04-24T08:27:51Z"", ""event"":""ShipyardSell"", ""ShipType"":""Empire_Courier"", ""SellShipID"":902, ""ShipPrice"":2008281 }", shipMonitor);
        }
Beispiel #3
0
        public static void VA_Init1(dynamic vaProxy)
        {
            // Initialize and launch an EDDI instance without opening the main window
            // VoiceAttack commands will be used to manipulate the window state.
            App.vaProxy = vaProxy;
            if (App.AlreadyRunning())
            {
                return;
            }

            Thread appThread = new Thread(App.Main);

            appThread.SetApartmentState(ApartmentState.STA);
            appThread.Start();

            try
            {
                int timeout = 0;
                while (Application.Current == null)
                {
                    if (timeout < 200)
                    {
                        Thread.Sleep(50);
                        timeout++;
                    }
                    else
                    {
                        throw new TimeoutException("EDDI VoiceAttack plugin initialisation has timed out");
                    }
                }

                Logging.Info("Initialising EDDI VoiceAttack plugin");

                // Set up our event responders
                VoiceAttackResponder.RaiseEvent += (s, theEvent) =>
                {
                    try
                    {
                        eventQueue.Enqueue(theEvent);
                        Thread eventHandler = new Thread(() => dequeueEvent(ref vaProxy))
                        {
                            Name         = "VoiceAttackEventHandler",
                            IsBackground = true
                        };
                        eventHandler.Start();
                        eventHandler.Join();
                    }
                    catch (ThreadAbortException tax)
                    {
                        Thread.ResetAbort();
                        Logging.Debug("Thread aborted", tax);
                    }
                    catch (Exception ex)
                    {
                        Dictionary <string, object> data = new Dictionary <string, object>
                        {
                            { "event", JsonConvert.SerializeObject(theEvent) },
                            { "exception", ex.Message },
                            { "stacktrace", ex.StackTrace }
                        };
                        Logging.Error("VoiceAttack failed to handle event.", data);
                    }
                };

                // Add notifiers for changes in variables we want to react to
                // (we can only use event handlers with classes which are always constructed - nullable objects will be updated via responder events)
                EDDI.Instance.State.CollectionChanged  += (s, e) => setDictionaryValues(EDDI.Instance.State, "state", ref vaProxy);
                SpeechService.Instance.PropertyChanged += (s, e) => setSpeaking(SpeechService.Instance.eddiSpeaking, ref vaProxy);

                CargoMonitor cargoMonitor = (CargoMonitor)EDDI.Instance.ObtainMonitor("Cargo monitor");
                cargoMonitor.InventoryUpdatedEvent += (s, e) =>
                {
                    lock (vaProxyLock)
                    {
                        setCargo(cargoMonitor, ref vaProxy);
                    }
                };

                ShipMonitor shipMonitor = (ShipMonitor)EDDI.Instance.ObtainMonitor("Ship monitor");
                if (shipMonitor != null)
                {
                    shipMonitor.ShipyardUpdatedEvent += (s, e) =>
                    {
                        lock (vaProxyLock)
                        {
                            setShipValues(shipMonitor.GetCurrentShip(), "Ship", ref vaProxy);
                            Task.Run(() => setShipyardValues(shipMonitor.shipyard?.ToList(), ref vaProxy));
                        }
                    };
                }

                StatusMonitor statusMonitor = (StatusMonitor)EDDI.Instance.ObtainMonitor("Status monitor");
                if (statusMonitor != null)
                {
                    statusMonitor.StatusUpdatedEvent += (s, e) =>
                    {
                        lock (vaProxyLock)
                        {
                            setStatusValues(statusMonitor.currentStatus, "Status", ref vaProxy);
                        }
                    };
                }

                // Display instance information if available
                if (EddiUpgrader.UpgradeRequired)
                {
                    vaProxy.WriteToLog("Please shut down VoiceAttack and run EDDI standalone to upgrade", "red");
                    string msg = Properties.VoiceAttack.run_eddi_standalone;
                    SpeechService.Instance.Say(((ShipMonitor)EDDI.Instance.ObtainMonitor("Ship monitor")).GetCurrentShip(), msg, 0);
                }
                else if (EddiUpgrader.UpgradeAvailable)
                {
                    vaProxy.WriteToLog("Please shut down VoiceAttack and run EDDI standalone to upgrade", "orange");
                    string msg = Properties.VoiceAttack.run_eddi_standalone;
                    SpeechService.Instance.Say(((ShipMonitor)EDDI.Instance.ObtainMonitor("Ship monitor")).GetCurrentShip(), msg, 0);
                }

                if (EddiUpgrader.Motd != null)
                {
                    vaProxy.WriteToLog("Message from EDDI: " + EddiUpgrader.Motd, "black");
                    string msg = String.Format(Eddi.Properties.EddiResources.msg_from_eddi, EddiUpgrader.Motd);
                    SpeechService.Instance.Say(((ShipMonitor)EDDI.Instance.ObtainMonitor("Ship monitor")).GetCurrentShip(), msg, 0);
                }

                // Set the initial values from the main EDDI objects
                setStandardValues(ref vaProxy);

                vaProxy.WriteToLog("The EDDI plugin is fully operational.", "green");
                setStatus(ref vaProxy, "Operational");

                // Fire an event once the VA plugin is initialized
                Event @event = new VAInitializedEvent(DateTime.UtcNow);

                if (initEventEnabled(@event.type))
                {
                    EDDI.Instance.enqueueEvent(@event);
                }

                // Set a variable indicating the version of VoiceAttack in use
                System.Version v = vaProxy.VAVersion;
                EDDI.Instance.vaVersion = v.ToString();

                // Set a variable indicating whether EDDI is speaking
                try
                {
                    setSpeaking(SpeechService.Instance.eddiSpeaking, ref vaProxy);
                }
                catch (Exception ex)
                {
                    Logging.Error("Failed to set initial speaking status", ex);
                }
                Logging.Info("EDDI VoiceAttack plugin initialization complete");
            }
            catch (Exception e)
            {
                Logging.Error("Failed to initialize VoiceAttack plugin", e);
                vaProxy.WriteToLog("Unable to fully initialize EDDI. Some functions may not work.", "red");
            }
        }
Beispiel #4
0
        /// <summary>Set all values</summary>
        public static void setStandardValues(ref dynamic vaProxy)
        {
            // Update our primary objects only if they don't match the state of the EDDI instance.
            try
            {
                if (EDDI.Instance.CurrentStarSystem != CurrentStarSystem)
                {
                    setStarSystemValues(EDDI.Instance.CurrentStarSystem, "System", ref vaProxy);
                    CurrentStarSystem = EDDI.Instance.CurrentStarSystem;
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set current system", ex);
            }

            try
            {
                if (EDDI.Instance.LastStarSystem != LastStarSystem)
                {
                    setStarSystemValues(EDDI.Instance.LastStarSystem, "Last system", ref vaProxy);
                    LastStarSystem = EDDI.Instance.LastStarSystem;
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set last system", ex);
            }

            try
            {
                if (EDDI.Instance.CurrentStellarBody != CurrentStellarBody)
                {
                    setDetailedBodyValues(EDDI.Instance.CurrentStellarBody, "Body", ref vaProxy);
                    CurrentStellarBody = EDDI.Instance.CurrentStellarBody;
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set stellar body", ex);
            }

            try
            {
                if (EDDI.Instance.CurrentStation != CurrentStation)
                {
                    setStationValues(EDDI.Instance.CurrentStation, "Last station", ref vaProxy);
                    CurrentStation = EDDI.Instance.CurrentStation;
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set last station", ex);
            }

            try
            {
                ShipMonitor shipMonitor = ((ShipMonitor)EDDI.Instance.ObtainMonitor("Ship monitor"));

                try
                {
                    if (shipMonitor?.GetCurrentShip() != Ship)
                    {
                        setShipValues(shipMonitor?.GetCurrentShip(), "Ship", ref vaProxy);
                        Ship = shipMonitor.GetCurrentShip();
                    }
                }
                catch (Exception ex)
                {
                    Logging.Error("Failed to set current ship values", ex);
                }

                try
                {
                    if (shipMonitor?.shipyard != Shipyard)
                    {
                        List <Ship> shipyard = new List <Ship>(shipMonitor?.shipyard);
                        if (shipyard != null)
                        {
                            int currentStoredShip = 1;
                            foreach (Ship StoredShip in shipyard)
                            {
                                setShipValues(StoredShip, "Stored ship " + currentStoredShip, ref vaProxy);
                                currentStoredShip++;
                            }
                            vaProxy.SetInt("Stored ship entries", shipMonitor?.shipyard.Count);
                        }
                        Shipyard = shipMonitor.shipyard;
                    }
                }
                catch (Exception ex)
                {
                    Logging.Error("Failed to set shipyard", ex);
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to obtain ship monitor & set VoiceAttack values", ex);
            }

            try
            {
                if (EDDI.Instance.HomeStarSystem != HomeStarSystem)
                {
                    setStarSystemValues(EDDI.Instance.HomeStarSystem, "Home system", ref vaProxy);
                    HomeStarSystem = EDDI.Instance.HomeStarSystem;

                    // Backwards-compatibility with 1.x
                    try
                    {
                        if (EDDI.Instance.HomeStarSystem != null)
                        {
                            vaProxy.SetText("Home system", EDDI.Instance.HomeStarSystem.name);
                            vaProxy.SetText("Home system (spoken)", Translations.StarSystem(EDDI.Instance.HomeStarSystem.name));
                        }
                        if (EDDI.Instance.HomeStation != null)
                        {
                            vaProxy.SetText("Home station", EDDI.Instance.HomeStation.name);
                        }
                    }
                    catch (Exception ex)
                    {
                        Logging.Error("Failed to set 1.x home system values", ex);
                    }
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set home system", ex);
            }

            try
            {
                Status currentStatus = ((StatusMonitor)EDDI.Instance.ObtainMonitor("Status monitor"))?.GetStatus();
                if (currentStatus != Status)
                {
                    setStatusValues(StatusMonitor.currentStatus, "Status", ref vaProxy);
                    Status = currentStatus;
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set current status", ex);
            }

            try
            {
                // Set SetState values
                if (EDDI.Instance.State != State)
                {
                    setDictionaryValues(EDDI.Instance.State, "state", ref vaProxy);
                    State = EDDI.Instance.State;
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set state", ex);
            }

            try
            {
                if (EDDI.Instance.Cmdr != Commander)
                {
                    setCommanderValues(EDDI.Instance.Cmdr, ref vaProxy);
                    Commander = EDDI.Instance.Cmdr;
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set commander values", ex);
            }

            // On every event...
            // Set miscellaneous values
            try
            {
                vaProxy.SetText("Environment", EDDI.Instance.Environment);
                vaProxy.SetText("Vehicle", EDDI.Instance.Vehicle);
                vaProxy.SetText("EDDI version", Constants.EDDI_VERSION.ToString());
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to set misc values", ex);
            }
        }
Beispiel #5
0
        public static void VA_Init1(dynamic vaProxy)
        {
            // Initialize and launch an EDDI instance without opening the main window
            // VoiceAttack commands will be used to manipulate the window state.
            App.vaProxy = vaProxy;
            if (App.AlreadyRunning())
            {
                return;
            }

            Thread appThread = new Thread(App.Main);

            appThread.SetApartmentState(ApartmentState.STA);
            appThread.Start();

            try
            {
                int timeout = 0;
                while (Application.Current == null)
                {
                    if (timeout < 200)
                    {
                        Thread.Sleep(50);
                        timeout++;
                    }
                    else
                    {
                        throw new TimeoutException("EDDI VoiceAttack plugin initialisation has timed out");
                    }
                }

                Logging.Info("Initialising EDDI VoiceAttack plugin");

                // Set up our event responder.
                VoiceAttackResponder.RaiseEvent += (s, theEvent) =>
                {
                    if (theEvent is null)
                    {
                        return;
                    }
                    if (eventQueues.ContainsKey(theEvent.type))
                    {
                        // Add our event to an existing blocking collection for that event type.
                        eventQueues[theEvent.type].Add(theEvent);
                    }
                    else
                    {
                        // Add our event to a new blocking collection for that event type and start a consumer task for that collection
                        eventQueues[theEvent.type] = new BlockingCollection <Event> {
                            theEvent
                        };
                        var consumerTask = Task.Run(() =>
                        {
                            // ReSharper disable once AccessToModifiedClosure - OK to use vaProxy in this context.
                            dequeueEvents(eventQueues[theEvent.type], ref vaProxy);
                        });
                        consumerTasks.Add(consumerTask);
                    }
                };

                // Add notifiers for changes in variables we want to react to
                // (we can only use event handlers with classes which are always constructed - nullable objects will be updated via responder events)
                EDDI.Instance.PropertyChanged             += (s, e) => updateStandardValues(e);
                EDDI.Instance.State.CollectionChanged     += (s, e) => setDictionaryValues(EDDI.Instance.State, "state", ref vaProxy);
                SpeechService.Instance.PropertyChanged    += (s, e) => setSpeechState(e);
                CompanionAppService.Instance.StateChanged += (oldState, newState) => setCAPIState(newState == CompanionAppService.State.Authorized, ref vaProxy);

                CargoMonitor cargoMonitor = (CargoMonitor)EDDI.Instance.ObtainMonitor("Cargo monitor");
                cargoMonitor.InventoryUpdatedEvent += (s, e) =>
                {
                    lock (vaProxyLock)
                    {
                        setCargo(cargoMonitor, ref vaProxy);
                    }
                };

                ShipMonitor shipMonitor = (ShipMonitor)EDDI.Instance.ObtainMonitor("Ship monitor");
                if (shipMonitor != null)
                {
                    shipMonitor.ShipyardUpdatedEvent += (s, e) =>
                    {
                        lock (vaProxyLock)
                        {
                            setShipValues(shipMonitor.GetCurrentShip(), "Ship", ref vaProxy);
                            Task.Run(() => setShipyardValues(shipMonitor.shipyard?.Copy().ToList(), ref vaProxy));
                        }
                    };
                }

                StatusMonitor statusMonitor = (StatusMonitor)EDDI.Instance.ObtainMonitor("Status monitor");
                if (statusMonitor != null)
                {
                    statusMonitor.StatusUpdatedEvent += (s, e) =>
                    {
                        lock (vaProxyLock)
                        {
                            setStatusValues(statusMonitor.currentStatus, "Status", ref vaProxy);
                        }
                    };
                }

                // Set initial values for standard variables
                initializeStandardValues();

                // Display instance information if available
                if (EddiUpgrader.UpgradeRequired)
                {
                    vaProxy.WriteToLog("Please shut down VoiceAttack and run EDDI standalone to upgrade", "red");
                    string msg = Properties.VoiceAttack.run_eddi_standalone;
                    SpeechService.Instance.Say(null, msg, 0);
                }
                else if (EddiUpgrader.UpgradeAvailable)
                {
                    vaProxy.WriteToLog("Please shut down VoiceAttack and run EDDI standalone to upgrade", "orange");
                    string msg = Properties.VoiceAttack.run_eddi_standalone;
                    SpeechService.Instance.Say(null, msg, 0);
                }

                if (EddiUpgrader.Motd != null)
                {
                    vaProxy.WriteToLog("Message from EDDI: " + EddiUpgrader.Motd, "black");
                    string msg = String.Format(Eddi.Properties.EddiResources.msg_from_eddi, EddiUpgrader.Motd);
                    SpeechService.Instance.Say(null, msg, 0);
                }

                vaProxy.WriteToLog("The EDDI plugin is fully operational.", "green");
                setStatus(ref vaProxy, "Operational");

                // Fire an event once the VA plugin is initialized
                EDDI.Instance.enqueueEvent(new VAInitializedEvent(DateTime.UtcNow));

                // Set a variable indicating the version of VoiceAttack in use
                System.Version v = vaProxy.VAVersion;
                EDDI.Instance.vaVersion = v.ToString();

                Logging.Info("EDDI VoiceAttack plugin initialization complete");
            }
            catch (Exception e)
            {
                Logging.Error("Failed to initialize VoiceAttack plugin", e);
                vaProxy.WriteToLog("Unable to fully initialize EDDI. Some functions may not work.", "red");
            }
        }