Пример #1
0
        public IActionResult Index()
        {
            var dataProvider = new DataProviderService();
            var data         = dataProvider.GetAllTaskData();

            return(View(data));
        }
Пример #2
0
 public void start()
 {
     fakeEdsmRestClient  = new FakeEdsmRestClient();
     fakeEdsmService     = new StarMapService(fakeEdsmRestClient);
     dataProviderService = new DataProviderService(fakeEdsmService);
     MakeSafe();
 }
Пример #3
0
        // Obtain the list of outfitting modules from the profile
        public static List <Module> OutfittingFromProfile(dynamic json)
        {
            List <Module> Modules = new List <Module>();

            if (json["lastStarport"] != null && json["lastStarport"]["modules"] != null)
            {
                foreach (dynamic moduleJson in json["lastStarport"]["modules"])
                {
                    dynamic module = moduleJson.Value;
                    // Not interested in paintjobs, decals, ...
                    if (module["category"] == "weapon" || module["category"] == "module")
                    {
                        Module Module = ModuleDefinitions.ModuleFromEliteID((long)module["id"]);
                        if (Module.Name == null)
                        {
                            // Unknown module; log an error so that we can update the definitions
                            DataProviderService.LogError("No definition for outfitting module " + module.ToString());
                        }
                        Module.Cost = module["cost"];
                        Modules.Add(Module);
                    }
                }
            }

            return(Modules);
        }
Пример #4
0
        public void TestUnknown()
        {
            StarSystem starSystem = DataProviderService.GetSystemData("Unknown star system", null, null, null);

            Assert.AreEqual("Unknown star system", starSystem.name);
            Assert.IsNull(starSystem.population);
        }
Пример #5
0
        public static void obtainEdsmLogs(IEdsmService edsmService, IProgress <string> progress)
        {
            if (edsmService != null)
            {
                try
                {
                    DataProviderService            dataProviderService = new DataProviderService(edsmService);
                    List <StarMapResponseLogEntry> flightLogs          = edsmService.getStarMapLog();
                    Dictionary <string, string>    comments            = edsmService.getStarMapComments();
                    int total = flightLogs.Count;
                    int i     = 0;

                    while (i < total)
                    {
                        int batchSize = Math.Min(total, StarMapService.syncBatchSize);
                        List <StarMapResponseLogEntry> flightLogBatch = flightLogs.Skip(i).Take(batchSize).ToList();
                        dataProviderService.syncEdsmLogBatch(flightLogs.Skip(i).Take(batchSize).ToList(), comments);
                        i += batchSize;
                        progress.Report($"{Properties.EDSMResources.log_button_fetching_progress} {i}/{total}");
                    }
                    progress.Report(Properties.EDSMResources.log_button_fetched);
                }
                catch (EDSMException edsme)
                {
                    progress.Report(Properties.EDSMResources.log_button_error_received + edsme.Message);
                }
            }
        }
Пример #6
0
        public static Module ModuleFromProfile(string name, dynamic json)
        {
            long   id     = (long)json["module"]["id"];
            Module module = ModuleDefinitions.ModuleFromEliteID(id);

            if (module.Name == null)
            {
                // Unknown module; log an error so that we can update the definitions
                DataProviderService.LogError("No definition for ship module " + json["module"].ToString());
            }

            module.Cost     = (long)json["module"]["value"];
            module.Enabled  = (bool)json["module"]["on"];
            module.Priority = (int)json["module"]["priority"];
            // Be sensible with health - round it unless it's very low
            decimal Health = (decimal)json["module"]["health"] / 10000;

            if (Health < 5)
            {
                module.Health = Math.Round(Health, 1);
            }
            else
            {
                module.Health = Math.Round(Health);
            }

            if (json["module"]["modifiers"] != null && firstRun)
            {
                DataProviderService.LogError("Module with modification " + json["module"].ToString());
            }
            return(module);
        }
Пример #7
0
        public JsonResult GetChartData()
        {
            List <GoogleChartData> data = new List <GoogleChartData>();

            //Here MyDatabaseEntities  is our dbContext
            //using (UsersDBEntities1 dc = new UsersDBEntities1())
            //{
            //    data = dc.GoogleChartDatas.ToList();
            //}
            data = DataProviderService.GetGoogleChartDatas();

            var chartData = new object[data.Count + 1];

            chartData[0] = new object[] {
                "Year",
                "Electronics",
                "Books & Media",
                "Home & Kitchen"
            };

            int j = 0;

            foreach (var i in data)
            {
                j++;
                chartData[j] = new object[] { i.Year.ToString(), i.Electronics, i.BookAndMedia, i.HomeAndKitchen };
            }

            return(new JsonResult {
                Data = chartData.ToArray(), JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Пример #8
0
        private void _handleBondAwardedEvent(BondAwardedEvent @event)
        {
            int    shipId        = EDDI.Instance?.CurrentShip?.LocalId ?? 0;
            string currentSystem = EDDI.Instance?.CurrentStarSystem?.systemname;

            // Get the victim faction data
            Faction faction = DataProviderService.GetFactionByName(@event.victimfaction);

            FactionReport report = new FactionReport(@event.timestamp, false, shipId, Crime.None, currentSystem, @event.reward)
            {
                station          = EDDI.Instance?.CurrentStation?.name,
                body             = EDDI.Instance?.CurrentStellarBody?.bodyname,
                victim           = @event.victimfaction,
                victimAllegiance = (faction?.Allegiance ?? Superpower.None).invariantName
            };

            FactionRecord record = GetRecordWithFaction(@event.awardingfaction);

            if (record == null)
            {
                record = AddRecord(@event.awardingfaction);
            }
            record.factionReports.Add(report);
            record.claims += @event.reward;
        }
Пример #9
0
        public void TestLatency()
        {
            System.DateTime startTime  = System.DateTime.UtcNow;
            StarSystem      starSystem = DataProviderService.GetSystemData("Sol");

            Assert.IsTrue((System.DateTime.UtcNow - startTime).Milliseconds < 1000);
        }
Пример #10
0
        public void TestUgrasin()
        {
            string     data       = @"{""z"": 11.28125, ""y"": 88.625, ""updated_at"": 1451665574, ""needs_permit"": 0, ""faction"": ""Ugrasin Purple Advanced Industry"", ""x"": -106.71875, ""is_populated"": true, ""population"": 1261, ""allegiance"": ""Federation"", ""government"": ""Corporate"", ""stations"": [{""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste""], ""has_shipyard"": 0, ""has_commodities"": 1, ""shipyard_updated_at"": null, ""export_commodities"": [""Hydrogen Fuel"", ""Gallite"", ""Lepidolite""], ""import_commodities"": [""Explosives"", ""Mineral Extractors"", ""Bioreducing Lichen""], ""type"": ""Mining Outpost"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 4820, ""has_rearm"": 0, ""name"": ""Kuo Settlement"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 6, ""system_id"": 18166, ""updated_at"": 1444494512, ""faction"": ""Ugrasin Purple Advanced Industry"", ""market_updated_at"": 1453582032, ""has_market"": 1, ""selling_ships"": [], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 753, 754, 755, 756, 757, 763, 764, 765, 766, 767, 768, 769, 770, 837, 839, 840, 843, 846, 847, 848, 850, 851, 852, 855, 867, 870, 876, 877, 878, 879, 880, 884, 885, 886, 887, 888, 891, 892, 893, 894, 895, 896, 897, 898, 900, 962, 963, 964, 965, 967, 968, 969, 970, 1000, 1005, 1010, 1037, 1038, 1039, 1043, 1044, 1047, 1048, 1066, 1071, 1072, 1106, 1107, 1111, 1112, 1116, 1117, 1118, 1120, 1122, 1123, 1125, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1201, 1202, 1203, 1204, 1205, 1207, 1227, 1228, 1229, 1234, 1242, 1243, 1245, 1246, 1264, 1272, 1280, 1286, 1287, 1290, 1291, 1294, 1295, 1296, 1297, 1299, 1300, 1301, 1302, 1303, 1305, 1306, 1307, 1310, 1311, 1351, 1357, 1358, 1366, 1395, 1396, 1397, 1400, 1401, 1404, 1405, 1409, 1415, 1416, 1417, 1419, 1420, 1421, 1424, 1425, 1426, 1429, 1430, 1518, 1519, 1520, 1521, 1522, 1523, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Corporate"", ""economies"": [""Extraction""], ""outfitting_updated_at"": 1453582033, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""M"", ""state"": ""None"", ""id"": 12952}], ""state"": ""None"", ""power"": null, ""name"": ""Ugrasin"", ""security"": ""Low"", ""simbad_ref"": """", ""power_state"": null, ""primary_economy"": null, ""id"": 18166}";
            StarSystem starSystem = DataProviderService.StarSystemFromEDDP(data, null, null, null);

            Assert.AreEqual("Ugrasin", starSystem.name);
            Assert.AreEqual(1, starSystem.stations.Count);
            Assert.AreEqual(starSystem.z, (decimal)11.28125);
        }
        private void RegisterViews()
        {
            var providers = DataProviderService.GetRegisteredProviderExports();

            foreach (var view in providers.Select(prov => prov.ViewType))
            {
                Manager.RegisterViewWithRegion(DialogRegionNames.ConnectionStringViewRegion, view);
            }
        }
Пример #12
0
 public async void sdasds()
 {
     IDownloadService download     = new DownloadService();
     IDeserializer    deserializer = new Deserializer();
     var city = Cities.Gdansk;
     IUrlProviderService  urls = new MultiKinoUrlProviderService(download, deserializer);
     IDataProviderService data = new DataProviderService(download, deserializer, urls);
     var result = await data.GetCurrentData <MultiKinoShowing>(city);
 }
Пример #13
0
        public CrimeMonitor()
        {
            IEdsmService edsmService = new StarMapService();

            dataProviderService = new DataProviderService(edsmService);
            criminalrecord      = new ObservableCollection <FactionRecord>();
            homeSystems         = new Dictionary <string, string>();
            BindingOperations.CollectionRegistering += Record_CollectionRegistering;
            initializeCrimeMonitor();
        }
Пример #14
0
 public ScriptResolver(Dictionary <string, Script> scripts)
 {
     dataProviderService = new DataProviderService();
     bgsService          = new BgsService();
     random       = new Random();
     this.scripts = scripts ?? new Dictionary <string, Script>();
     setting      = new CustomSetting
     {
         Trimmer = BuiltinTrimmers.CollapseBlankCharacters
     };
 }
        private void Initialize()
        {
            var items      = DataProviderService.GetRegisteredProviderExports();
            var observable = new ObservableCollection <IDataProviderControllerExportAttribute>(items);
            var providers  = new ListCollectionView(new ObservableCollection <IDataProviderControllerExportAttribute>(observable));

            ProviderExports           = providers;
            CurrentProviderExport     = null;
            providers.CurrentChanged += (o, e) =>
            {
                LoadConnectionStringViewForProvider();
            };
        }
Пример #16
0
        public void TestSol()
        {
            string     data       = @"{ ""z"": 0, ""y"": 0, ""updated_at"": 1451665540, ""needs_permit"": 1, ""faction"": ""Federal Congress"", ""x"": 0, ""is_populated"": true, ""population"": 16999999880, ""allegiance"": ""Federation"", ""government"": ""Democracy"", ""stations"": [{""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste""], ""has_shipyard"": 1, ""has_commodities"": 1, ""shipyard_updated_at"": 1454022433, ""export_commodities"": [""Biowaste""], ""import_commodities"": [""Gold"", ""Palladium"", ""Platinum""], ""type"": ""Orbis Starport"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 496, ""has_rearm"": 1, ""name"": ""Abraham Lincoln"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 8, ""system_id"": 17072, ""updated_at"": 1446272933, ""faction"": ""Mother Gaia"", ""market_updated_at"": 1454030244, ""has_market"": 1, ""selling_ships"": [""Adder"", ""Eagle Mk. II"", ""Orca"", ""Sidewinder Mk. I"", ""Viper Mk III"", ""Vulture""], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 783, 784, 785, 786, 787, 793, 798, 799, 800, 801, 802, 823, 824, 826, 827, 828, 835, 836, 837, 839, 843, 845, 846, 848, 849, 856, 857, 866, 873, 874, 875, 886, 887, 888, 902, 903, 904, 906, 907, 908, 910, 911, 912, 915, 920, 924, 925, 969, 970, 973, 975, 977, 978, 979, 981, 982, 983, 984, 1052, 1053, 1054, 1055, 1057, 1058, 1059, 1060, 1061, 1062, 1064, 1106, 1107, 1108, 1109, 1111, 1112, 1113, 1115, 1116, 1153, 1154, 1158, 1163, 1164, 1165, 1168, 1169, 1170, 1172, 1174, 1176, 1177, 1178, 1179, 1180, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1207, 1220, 1221, 1224, 1225, 1228, 1229, 1230, 1232, 1234, 1235, 1238, 1239, 1242, 1246, 1256, 1261, 1262, 1263, 1264, 1268, 1269, 1270, 1271, 1277, 1280, 1285, 1286, 1287, 1290, 1291, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1334, 1335, 1340, 1341, 1346, 1350, 1357, 1358, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1376, 1378, 1383, 1418, 1423, 1433, 1454, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Service""], ""outfitting_updated_at"": 1454030244, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""L"", ""state"": ""None"", ""id"": 18}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste""], ""has_shipyard"": 1, ""has_commodities"": 1, ""shipyard_updated_at"": 1454018210, ""export_commodities"": [""Cobalt"", ""Gold"", ""Silver""], ""import_commodities"": [""Bertrandite"", ""Gallite"", ""Indite""], ""type"": ""Ocellus Starport"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 505, ""has_rearm"": 1, ""name"": ""Galileo"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 7, ""system_id"": 17072, ""updated_at"": 1444494465, ""faction"": ""Mother Gaia"", ""market_updated_at"": 1454018204, ""has_market"": 1, ""selling_ships"": [""Eagle Mk. II"", ""Hauler"", ""Sidewinder Mk. I"", ""Type - 7 Transporter"", ""Type - 9 Heavy"", ""Vulture""], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 773, 774, 775, 776, 777, 783, 784, 785, 786, 787, 793, 803, 804, 805, 806, 807, 843, 844, 845, 848, 849, 856, 857, 858, 862, 867, 868, 869, 870, 872, 874, 875, 876, 877, 878, 879, 880, 882, 883, 884, 885, 886, 887, 890, 891, 892, 893, 894, 895, 896, 897, 898, 927, 928, 929, 930, 931, 932, 933, 934, 935, 961, 962, 963, 965, 966, 967, 968, 969, 970, 1038, 1039, 1043, 1044, 1045, 1048, 1049, 1050, 1055, 1059, 1060, 1064, 1065, 1078, 1080, 1083, 1084, 1085, 1088, 1090, 1094, 1095, 1099, 1104, 1105, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1125, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1170, 1180, 1191, 1193, 1194, 1195, 1196, 1197, 1198, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1229, 1230, 1231, 1233, 1236, 1238, 1239, 1240, 1242, 1246, 1248, 1255, 1256, 1262, 1263, 1264, 1267, 1271, 1272, 1275, 1279, 1280, 1282, 1286, 1287, 1290, 1291, 1294, 1295, 1298, 1299, 1302, 1306, 1307, 1310, 1311, 1314, 1315, 1318, 1319, 1327, 1372, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Refinery""], ""outfitting_updated_at"": 1454018205, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""L"", ""state"": ""None"", ""id"": 19}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste""], ""has_shipyard"": 1, ""has_commodities"": 1, ""shipyard_updated_at"": 1454030713, ""export_commodities"": [""Biowaste""], ""import_commodities"": [""Gold"", ""Palladium"", ""Platinum""], ""type"": ""Unknown Starport"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 506, ""has_rearm"": 1, ""name"": ""Li Qing Jao"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 12, ""system_id"": 17072, ""updated_at"": 1444494465, ""faction"": ""Federal Congress"", ""market_updated_at"": 1454030707, ""has_market"": 1, ""selling_ships"": [""Cobra Mk. III"", ""Eagle Mk. II"", ""Type - 6 Transporter"", ""Viper Mk III"", ""Vulture"", ""Viper MK IV"", ""Cobra MK IV""], ""has_refuel"": 1, ""selling_modules"": [743, 744, 745, 746, 747, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 783, 784, 785, 786, 787, 793, 826, 827, 828, 830, 834, 835, 837, 838, 839, 849, 856, 859, 866, 867, 868, 869, 870, 872, 876, 877, 884, 886, 887, 890, 930, 935, 938, 939, 940, 943, 945, 947, 948, 949, 950, 999, 1005, 1009, 1010, 1013, 1014, 1015, 1017, 1019, 1020, 1021, 1022, 1023, 1024, 1029, 1030, 1033, 1037, 1038, 1039, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1066, 1068, 1069, 1071, 1072, 1073, 1074, 1093, 1094, 1095, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1105, 1116, 1128, 1129, 1132, 1133, 1134, 1137, 1138, 1140, 1183, 1184, 1188, 1189, 1190, 1191, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1209, 1211, 1213, 1214, 1215, 1216, 1228, 1231, 1232, 1233, 1234, 1238, 1239, 1241, 1242, 1243, 1244, 1245, 1246, 1250, 1251, 1257, 1258, 1259, 1265, 1266, 1267, 1273, 1281, 1283, 1286, 1306, 1307, 1309, 1310, 1311, 1313, 1314, 1315, 1317, 1318, 1319, 1320, 1321, 1324, 1334, 1335, 1340, 1341, 1346, 1373, 1375, 1377, 1379, 1381, 1383, 1417, 1425, 1429, 1454, 1455, 1508, 1509, 1510, 1511, 1512, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Service""], ""outfitting_updated_at"": 1454030707, ""has_blackmarket"": 1, ""max_landing_pad_size"": ""L"", ""state"": ""Lockdown"", ""id"": 21}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste""], ""has_shipyard"": 1, ""has_commodities"": 1, ""shipyard_updated_at"": 1453962591, ""export_commodities"": [""Biowaste""], ""import_commodities"": [""Gold"", ""Palladium"", ""Platinum""], ""type"": ""Orbis Starport"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 506, ""has_rearm"": 1, ""name"": ""M.Gorbachev"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 8, ""system_id"": 17072, ""updated_at"": 1444494465, ""faction"": ""Mother Gaia"", ""market_updated_at"": 1453962585, ""has_market"": 1, ""selling_ships"": [""Cobra Mk. III"", ""Eagle Mk. II"", ""Type - 6 Transporter"", ""Viper Mk III"", ""Vulture"", ""Viper MK IV"", ""Cobra MK IV""], ""has_refuel"": 1, ""selling_modules"": [743, 744, 745, 746, 747, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 783, 784, 785, 786, 787, 793, 828, 829, 830, 831, 833, 835, 836, 838, 840, 846, 856, 859, 862, 866, 867, 868, 869, 870, 872, 876, 888, 889, 935, 937, 938, 939, 942, 944, 945, 946, 947, 950, 1000, 1005, 1009, 1010, 1013, 1014, 1017, 1018, 1019, 1021, 1022, 1023, 1024, 1033, 1035, 1037, 1038, 1039, 1040, 1042, 1043, 1044, 1045, 1047, 1048, 1049, 1050, 1067, 1068, 1069, 1071, 1072, 1073, 1074, 1093, 1094, 1095, 1097, 1098, 1100, 1101, 1102, 1103, 1104, 1105, 1116, 1127, 1128, 1130, 1132, 1135, 1136, 1137, 1139, 1184, 1185, 1188, 1189, 1190, 1191, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1209, 1210, 1214, 1215, 1216, 1229, 1231, 1232, 1234, 1236, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1258, 1259, 1265, 1266, 1267, 1273, 1274, 1275, 1281, 1283, 1286, 1306, 1307, 1309, 1310, 1311, 1313, 1314, 1315, 1316, 1318, 1319, 1320, 1321, 1324, 1334, 1335, 1340, 1341, 1373, 1375, 1377, 1379, 1381, 1383, 1417, 1425, 1429, 1455, 1508, 1509, 1510, 1511, 1512, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Service""], ""outfitting_updated_at"": 1453962585, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""L"", ""state"": ""None"", ""id"": 122}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste"", ""Bootleg Liquor"", ""Landmines"", ""Nerve Agents""], ""has_shipyard"": 1, ""has_commodities"": 1, ""shipyard_updated_at"": 1454025831, ""export_commodities"": [""Polymers"", ""Copper"", ""Titanium""], ""import_commodities"": [""Microbial Furnaces"", ""Bauxite"", ""Rutile""], ""type"": ""Orbis Starport"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 225, ""has_rearm"": 1, ""name"": ""Daedalus"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 8, ""system_id"": 17072, ""updated_at"": 1453945727, ""faction"": ""Mother Gaia"", ""market_updated_at"": 1454025824, ""has_market"": 1, ""selling_ships"": [""Eagle Mk. II"", ""Hauler"", ""Sidewinder Mk. I"", ""Type - 7 Transporter"", ""Type - 9 Heavy"", ""Vulture""], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 773, 774, 775, 776, 777, 783, 784, 785, 786, 787, 793, 803, 804, 805, 806, 807, 843, 845, 846, 848, 849, 856, 857, 859, 867, 868, 869, 870, 872, 873, 874, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 927, 928, 929, 930, 931, 932, 933, 934, 935, 961, 962, 963, 965, 966, 967, 968, 969, 970, 1038, 1043, 1044, 1045, 1047, 1048, 1049, 1050, 1054, 1055, 1059, 1063, 1064, 1079, 1080, 1083, 1084, 1085, 1088, 1090, 1099, 1102, 1103, 1104, 1105, 1116, 1117, 1118, 1119, 1121, 1122, 1123, 1124, 1125, 1141, 1142, 1143, 1144, 1146, 1147, 1148, 1175, 1180, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1231, 1233, 1234, 1237, 1238, 1239, 1242, 1246, 1248, 1255, 1256, 1262, 1263, 1264, 1267, 1271, 1272, 1278, 1279, 1281, 1282, 1283, 1286, 1287, 1290, 1291, 1294, 1295, 1298, 1299, 1302, 1303, 1306, 1307, 1310, 1311, 1314, 1318, 1319, 1323, 1327, 1372, 1375, 1376, 1378, 1379, 1380, 1381, 1382, 1383, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1427, 1428, 1429, 1430, 1431, 1432, 1523, 1524, 1525, 1526, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Refinery""], ""outfitting_updated_at"": 1454025825, ""has_blackmarket"": 1, ""max_landing_pad_size"": ""L"", ""state"": ""None"", ""id"": 128}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste""], ""has_shipyard"": 1, ""has_commodities"": 1, ""shipyard_updated_at"": 1453957989, ""export_commodities"": [""Biowaste""], ""import_commodities"": [""Gold"", ""Palladium"", ""Platinum""], ""type"": ""Orbis Starport"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 699, ""has_rearm"": 1, ""name"": ""Mars High"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 8, ""system_id"": 17072, ""updated_at"": 1452013050, ""faction"": ""Sol Workers' Party"", ""market_updated_at"": 1453957982, ""has_market"": 1, ""selling_ships"": [""Cobra Mk. III"", ""Eagle Mk. II"", ""Type-6 Transporter"", ""Viper Mk III"", ""Vulture"", ""Viper MK IV"", ""Cobra MK IV""], ""has_refuel"": 1, ""selling_modules"": [743, 744, 745, 746, 747, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 783, 784, 785, 786, 787, 793, 824, 826, 827, 828, 833, 834, 835, 837, 839, 843, 852, 856, 857, 866, 867, 868, 869, 870, 872, 876, 877, 884, 886, 887, 888, 889, 890, 930, 935, 938, 939, 940, 942, 943, 944, 945, 946, 947, 948, 956, 958, 999, 1000, 1005, 1009, 1012, 1013, 1015, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1029, 1034, 1035, 1037, 1038, 1039, 1040, 1042, 1043, 1044, 1045, 1047, 1048, 1049, 1050, 1066, 1067, 1068, 1071, 1072, 1074, 1092, 1093, 1094, 1095, 1097, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1116, 1128, 1129, 1130, 1132, 1133, 1134, 1136, 1137, 1138, 1182, 1183, 1184, 1187, 1189, 1190, 1191, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1209, 1210, 1211, 1214, 1215, 1216, 1227, 1230, 1233, 1234, 1236, 1239, 1242, 1243, 1244, 1245, 1246, 1251, 1258, 1259, 1265, 1266, 1267, 1273, 1274, 1275, 1281, 1283, 1286, 1306, 1307, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1318, 1319, 1321, 1324, 1325, 1334, 1335, 1340, 1341, 1346, 1373, 1375, 1377, 1379, 1383, 1416, 1421, 1425, 1429, 1454, 1455, 1508, 1509, 1510, 1511, 1512, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Service""], ""outfitting_updated_at"": 1453957983, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""L"", ""state"": ""None"", ""id"": 1350}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste"", ""Lucan Onion Head""], ""has_shipyard"": 1, ""has_commodities"": 1, ""shipyard_updated_at"": 1453827714, ""export_commodities"": [""Aluminium"", ""Copper"", ""Limpet""], ""import_commodities"": [""Beer"", ""Wine"", ""Grain""], ""type"": ""Ocellus Starport"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 2477, ""has_rearm"": 1, ""name"": ""Columbus"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 7, ""system_id"": 17072, ""updated_at"": 1444494465, ""faction"": ""Mother Gaia"", ""market_updated_at"": 1454009761, ""has_market"": 1, ""selling_ships"": [""Adder"", ""Eagle Mk. II"", ""Hauler"", ""Sidewinder Mk. I"", ""Type-6 Transporter"", ""Type-9 Heavy"", ""Viper Mk III"", ""Vulture""], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 768, 769, 770, 771, 772, 783, 784, 785, 786, 787, 793, 803, 804, 805, 806, 807, 826, 827, 828, 834, 835, 838, 840, 843, 845, 846, 848, 849, 852, 854, 856, 857, 862, 866, 868, 869, 870, 872, 873, 874, 876, 878, 879, 880, 881, 883, 884, 887, 889, 890, 891, 892, 893, 894, 896, 897, 898, 899, 904, 905, 909, 910, 912, 913, 914, 915, 961, 962, 963, 966, 967, 968, 970, 974, 979, 980, 982, 983, 984, 985, 999, 1000, 1004, 1005, 1009, 1010, 1037, 1038, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1052, 1053, 1054, 1055, 1057, 1058, 1059, 1061, 1062, 1063, 1064, 1065, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1107, 1108, 1109, 1111, 1112, 1113, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1155, 1160, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1176, 1177, 1178, 1179, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1227, 1229, 1231, 1233, 1234, 1236, 1237, 1238, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1264, 1271, 1272, 1277, 1279, 1280, 1285, 1286, 1287, 1290, 1291, 1293, 1294, 1295, 1296, 1297, 1298, 1301, 1304, 1306, 1310, 1311, 1314, 1318, 1319, 1322, 1323, 1334, 1335, 1341, 1351, 1359, 1366, 1367, 1368, 1369, 1371, 1372, 1374, 1376, 1378, 1380, 1383, 1414, 1415, 1416, 1417, 1419, 1420, 1421, 1424, 1425, 1429, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Refinery""], ""outfitting_updated_at"": 1454009762, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""L"", ""state"": ""None"", ""id"": 1429}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste""], ""has_shipyard"": 1, ""has_commodities"": 1, ""shipyard_updated_at"": 1454005589, ""export_commodities"": [""Cobalt"", ""Gold"", ""Silver""], ""import_commodities"": [""Bertrandite"", ""Gallite"", ""Indite""], ""type"": ""Orbis Starport"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 4589, ""has_rearm"": 1, ""name"": ""Titan City"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 8, ""system_id"": 17072, ""updated_at"": 1452013013, ""faction"": ""Mother Gaia"", ""market_updated_at"": 1454005582, ""has_market"": 1, ""selling_ships"": [""Cobra Mk. III"", ""Eagle Mk. II"", ""Sidewinder Mk. I"", ""Type-6 Transporter"", ""Viper Mk III"", ""Vulture"", ""Viper MK IV"", ""Cobra MK IV""], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 783, 784, 785, 786, 787, 793, 839, 840, 846, 856, 857, 858, 859, 862, 866, 867, 868, 869, 870, 871, 873, 874, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 887, 889, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 905, 908, 909, 910, 912, 913, 915, 926, 927, 928, 929, 930, 931, 932, 933, 934, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 974, 978, 979, 982, 984, 985, 1038, 1039, 1043, 1044, 1045, 1047, 1048, 1050, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1108, 1110, 1112, 1113, 1114, 1116, 1117, 1118, 1119, 1120, 1122, 1123, 1124, 1125, 1155, 1160, 1167, 1168, 1169, 1170, 1172, 1173, 1174, 1176, 1177, 1178, 1179, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1229, 1230, 1231, 1233, 1234, 1237, 1238, 1239, 1240, 1242, 1246, 1264, 1271, 1278, 1280, 1286, 1287, 1290, 1291, 1294, 1295, 1297, 1298, 1301, 1302, 1304, 1305, 1306, 1311, 1315, 1318, 1319, 1323, 1326, 1327, 1358, 1359, 1366, 1368, 1369, 1370, 1371, 1372, 1374, 1376, 1378, 1382, 1383, 1414, 1415, 1416, 1417, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1437, 1449, 1455, 1508, 1509, 1510, 1511, 1512, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Refinery""], ""outfitting_updated_at"": 1454005583, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""L"", ""state"": ""None"", ""id"": 1430}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste""], ""has_shipyard"": 0, ""has_commodities"": 1, ""shipyard_updated_at"": null, ""export_commodities"": [""Cobalt"", ""Gold"", ""Silver""], ""import_commodities"": [""Bertrandite"", ""Gallite"", ""Indite""], ""type"": ""Civilian Outpost"", ""is_planetary"": 0, ""allegiance"": ""Federation"", ""distance_to_star"": 364, ""has_rearm"": 1, ""name"": ""Burnell Station"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 1, ""system_id"": 17072, ""updated_at"": 1444494465, ""faction"": ""Sol Workers' Party"", ""market_updated_at"": 1453937505, ""has_market"": 1, ""selling_ships"": [], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 748, 749, 750, 751, 752, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 793, 841, 842, 843, 846, 847, 848, 852, 854, 855, 857, 858, 862, 863, 865, 866, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 884, 885, 886, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 930, 933, 934, 935, 937, 938, 939, 940, 941, 942, 945, 946, 948, 949, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 999, 1000, 1005, 1009, 1010, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1021, 1022, 1024, 1025, 1028, 1029, 1030, 1033, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1045, 1046, 1047, 1048, 1049, 1050, 1066, 1068, 1069, 1070, 1071, 1073, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1101, 1102, 1103, 1104, 1116, 1118, 1123, 1124, 1125, 1128, 1129, 1130, 1133, 1134, 1137, 1138, 1139, 1140, 1181, 1183, 1184, 1185, 1186, 1187, 1189, 1191, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1213, 1214, 1215, 1216, 1228, 1230, 1231, 1233, 1234, 1237, 1238, 1239, 1240, 1242, 1243, 1244, 1245, 1246, 1251, 1258, 1259, 1265, 1266, 1267, 1273, 1274, 1275, 1281, 1282, 1283, 1286, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1319, 1323, 1327, 1373, 1375, 1377, 1379, 1381, 1383, 1396, 1397, 1401, 1404, 1405, 1409, 1414, 1415, 1416, 1417, 1419, 1420, 1421, 1424, 1425, 1429, 1443, 1447, 1452, 1454, 1503, 1504, 1505, 1506, 1507, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Refinery""], ""outfitting_updated_at"": 1453936634, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""M"", ""state"": ""None"", ""id"": 4645}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste"", ""Bootleg Liquor"", ""Landmines"", ""Nerve Agents""], ""has_shipyard"": 0, ""has_commodities"": 1, ""shipyard_updated_at"": null, ""export_commodities"": [""Food Cartridges"", ""Crop Harvesters"", ""Thermal Cooling Units""], ""import_commodities"": [""Polymers"", ""Copper"", ""Natural Fabrics""], ""type"": ""Planetary Outpost"", ""is_planetary"": 1, ""allegiance"": ""Federation"", ""distance_to_star"": 209, ""has_rearm"": 1, ""name"": ""Ehrlich City"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 13, ""system_id"": 17072, ""updated_at"": 1451821312, ""faction"": ""Sol Workers Party"", ""market_updated_at"": 1453941949, ""has_market"": 1, ""selling_ships"": [], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 773, 774, 775, 776, 777, 783, 784, 785, 786, 787, 793, 845, 846, 847, 848, 849, 856, 857, 866, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 885, 886, 888, 889, 890, 891, 892, 893, 896, 897, 898, 899, 900, 927, 928, 929, 930, 931, 932, 933, 934, 939, 945, 947, 948, 949, 961, 962, 963, 965, 966, 967, 968, 969, 970, 1014, 1015, 1019, 1020, 1023, 1024, 1037, 1038, 1039, 1040, 1043, 1044, 1045, 1047, 1048, 1049, 1050, 1069, 1074, 1093, 1095, 1097, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1116, 1130, 1134, 1139, 1191, 1193, 1194, 1195, 1196, 1197, 1198, 1204, 1205, 1206, 1207, 1229, 1232, 1233, 1234, 1240, 1241, 1242, 1246, 1255, 1256, 1262, 1263, 1264, 1265, 1266, 1267, 1270, 1271, 1273, 1274, 1275, 1278, 1279, 1281, 1286, 1287, 1290, 1291, 1294, 1295, 1298, 1299, 1302, 1303, 1306, 1314, 1315, 1318, 1319, 1322, 1327, 1373, 1375, 1377, 1379, 1381, 1383, 1407, 1408, 1411, 1412, 1442, 1443, 1446, 1447, 1448, 1450, 1451, 1452, 1454, 1503, 1504, 1505, 1506, 1507, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Industrial""], ""outfitting_updated_at"": 1453941950, ""has_blackmarket"": 1, ""max_landing_pad_size"": ""L"", ""state"": ""Boom"", ""id"": 42238}, {""prohibited_commodities"": [], ""has_shipyard"": 0, ""has_commodities"": 1, ""shipyard_updated_at"": null, ""export_commodities"": [], ""import_commodities"": [], ""type"": ""Planetary Outpost"", ""is_planetary"": 1, ""allegiance"": ""Federation"", ""distance_to_star"": 2498, ""has_rearm"": 1, ""name"": ""Haberlandt Survey"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 13, ""system_id"": 17072, ""updated_at"": 1451037064, ""faction"": ""Sol Workers party"", ""market_updated_at"": 1453670697, ""has_market"": 1, ""selling_ships"": [], ""has_refuel"": 1, ""selling_modules"": [743, 744, 745, 746, 747, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 783, 784, 785, 786, 787, 793, 794, 795, 796, 797, 808, 809, 810, 811, 812, 840, 843, 845, 846, 849, 852, 856, 857, 858, 869, 870, 871, 876, 877, 878, 879, 880, 881, 882, 883, 884, 886, 887, 890, 893, 894, 895, 898, 899, 900, 916, 917, 919, 920, 921, 922, 923, 926, 927, 928, 929, 931, 932, 933, 934, 935, 951, 952, 954, 955, 956, 957, 959, 961, 962, 963, 964, 966, 967, 968, 969, 970, 986, 987, 988, 990, 991, 992, 997, 998, 1000, 1002, 1003, 1005, 1006, 1007, 1008, 1009, 1010, 1026, 1027, 1029, 1031, 1033, 1034, 1039, 1040, 1044, 1045, 1050, 1055, 1060, 1065, 1079, 1080, 1084, 1085, 1089, 1090, 1095, 1099, 1104, 1105, 1116, 1117, 1118, 1120, 1122, 1123, 1124, 1125, 1141, 1143, 1144, 1145, 1146, 1147, 1148, 1191, 1195, 1196, 1197, 1198, 1207, 1228, 1229, 1230, 1233, 1236, 1238, 1239, 1242, 1246, 1275, 1283, 1286, 1306, 1326, 1378, 1380, 1383, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1423, 1424, 1425, 1426, 1429, 1430, 1431, 1432, 1433, 1508, 1509, 1510, 1511, 1512, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Military""], ""outfitting_updated_at"": 1453670699, ""has_blackmarket"": 0, ""max_landing_pad_size"": ""L"", ""state"": ""Boom"", ""id"": 42442}, {""prohibited_commodities"": [], ""has_shipyard"": 0, ""has_commodities"": 1, ""shipyard_updated_at"": null, ""export_commodities"": [], ""import_commodities"": [], ""type"": ""Planetary Outpost"", ""is_planetary"": 1, ""allegiance"": ""Federation"", ""distance_to_star"": 204, ""has_rearm"": 1, ""name"": ""Furukawa Enterprise"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 13, ""system_id"": 17072, ""updated_at"": 1451037160, ""faction"": ""Sol Workers Party"", ""market_updated_at"": 1453675101, ""has_market"": 1, ""selling_ships"": [], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 773, 774, 775, 776, 777, 783, 784, 785, 786, 787, 793, 794, 795, 796, 797, 843, 845, 846, 848, 849, 856, 859, 862, 871, 873, 874, 875, 876, 877, 878, 879, 880, 882, 883, 885, 886, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 927, 928, 929, 930, 931, 932, 933, 934, 940, 947, 948, 949, 950, 961, 962, 963, 964, 965, 966, 967, 968, 969, 1014, 1018, 1022, 1023, 1024, 1025, 1037, 1038, 1040, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1050, 1070, 1075, 1093, 1094, 1095, 1098, 1099, 1100, 1102, 1103, 1104, 1105, 1116, 1129, 1130, 1134, 1139, 1191, 1193, 1194, 1195, 1196, 1197, 1198, 1204, 1205, 1206, 1207, 1230, 1232, 1233, 1236, 1238, 1240, 1242, 1246, 1262, 1263, 1264, 1265, 1266, 1267, 1270, 1271, 1272, 1273, 1275, 1278, 1279, 1280, 1281, 1282, 1286, 1287, 1290, 1291, 1294, 1295, 1299, 1302, 1303, 1306, 1310, 1311, 1314, 1318, 1319, 1327, 1373, 1375, 1377, 1381, 1383, 1397, 1398, 1403, 1408, 1413, 1438, 1442, 1446, 1447, 1450, 1451, 1452, 1454, 1503, 1504, 1505, 1506, 1507, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Industrial""], ""outfitting_updated_at"": 1453675102, ""has_blackmarket"": 1, ""max_landing_pad_size"": ""L"", ""state"": ""Boom"", ""id"": 42519}, {""prohibited_commodities"": [], ""has_shipyard"": 0, ""has_commodities"": 1, ""shipyard_updated_at"": null, ""export_commodities"": [], ""import_commodities"": [], ""type"": ""Planetary Outpost"", ""is_planetary"": 1, ""allegiance"": ""Federation"", ""distance_to_star"": 205, ""has_rearm"": 1, ""name"": ""Walz Depot"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 13, ""system_id"": 17072, ""updated_at"": 1451037234, ""faction"": ""Sol Workers Party"", ""market_updated_at"": 1453327397, ""has_market"": 1, ""selling_ships"": [], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 773, 774, 775, 776, 777, 783, 784, 785, 786, 787, 793, 794, 795, 796, 797, 841, 842, 843, 845, 847, 857, 859, 866, 872, 873, 874, 875, 876, 878, 879, 880, 881, 882, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 926, 927, 928, 930, 931, 932, 933, 934, 939, 940, 943, 944, 947, 961, 962, 963, 964, 966, 967, 968, 969, 970, 1014, 1015, 1019, 1020, 1023, 1024, 1037, 1038, 1039, 1040, 1043, 1044, 1045, 1047, 1048, 1049, 1050, 1070, 1075, 1093, 1094, 1095, 1097, 1100, 1101, 1102, 1103, 1104, 1105, 1116, 1130, 1135, 1140, 1191, 1193, 1194, 1195, 1196, 1197, 1198, 1204, 1205, 1206, 1207, 1234, 1236, 1239, 1240, 1242, 1246, 1256, 1262, 1263, 1264, 1266, 1267, 1270, 1272, 1274, 1275, 1278, 1279, 1280, 1281, 1282, 1283, 1286, 1287, 1290, 1291, 1294, 1295, 1298, 1299, 1302, 1303, 1306, 1311, 1314, 1315, 1319, 1322, 1326, 1327, 1373, 1375, 1377, 1379, 1381, 1383, 1397, 1398, 1402, 1408, 1411, 1442, 1443, 1446, 1447, 1450, 1451, 1455, 1503, 1504, 1505, 1506, 1507, 1523, 1524, 1525, 1526, 1527, 1528, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Industrial""], ""outfitting_updated_at"": 1453327398, ""has_blackmarket"": 1, ""max_landing_pad_size"": ""L"", ""state"": ""Boom"", ""id"": 42523}, {""prohibited_commodities"": [], ""has_shipyard"": 0, ""has_commodities"": 1, ""shipyard_updated_at"": null, ""export_commodities"": [], ""import_commodities"": [], ""type"": ""Unknown Planetary"", ""is_planetary"": 1, ""allegiance"": ""Federation"", ""distance_to_star"": 2498, ""has_rearm"": 1, ""name"": ""Durrance Camp"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 15, ""system_id"": 17072, ""updated_at"": 1451039540, ""faction"": ""Sol Workers Party"", ""market_updated_at"": 1451964763, ""has_market"": 1, ""selling_ships"": [], ""has_refuel"": 1, ""selling_modules"": [738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 783, 784, 785, 786, 787, 793, 794, 795, 796, 797, 808, 809, 810, 811, 812, 827, 828, 829, 834, 835, 840, 856, 862, 863, 865, 866, 868, 869, 870, 871, 873, 874, 880, 882, 885, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 961, 962, 963, 965, 966, 967, 968, 969, 970, 1039, 1040, 1044, 1045, 1048, 1049, 1050, 1066, 1069, 1071, 1072, 1073, 1074, 1080, 1085, 1090, 1116, 1118, 1119, 1120, 1123, 1124, 1125, 1128, 1129, 1130, 1132, 1133, 1134, 1135, 1137, 1138, 1155, 1160, 1164, 1165, 1191, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1211, 1216, 1228, 1229, 1230, 1231, 1233, 1234, 1235, 1238, 1240, 1242, 1243, 1244, 1245, 1246, 1264, 1271, 1272, 1278, 1279, 1280, 1286, 1287, 1290, 1291, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1303, 1304, 1305, 1306, 1307, 1310, 1311, 1314, 1315, 1318, 1319, 1320, 1324, 1325, 1326, 1327, 1358, 1359, 1366, 1367, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1447, 1449, 1450, 1451, 1452, 1453, 1454, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Colony""], ""outfitting_updated_at"": 1451964764, ""has_blackmarket"": 1, ""max_landing_pad_size"": ""L"", ""state"": ""None"", ""id"": 42856}, {""prohibited_commodities"": [""Narcotics"", ""Tobacco"", ""Combat Stabilisers"", ""Imperial Slaves"", ""Slaves"", ""Personal Weapons"", ""Battle Weapons"", ""Toxic Waste"", ""Bootleg Liquor"", ""Landmines"", ""Nerve Agents""], ""has_shipyard"": 0, ""has_commodities"": 1, ""shipyard_updated_at"": null, ""export_commodities"": [""Hydrogen Fuel"", ""Biowaste"", ""Limpet""], ""import_commodities"": [], ""type"": ""Planetary Port"", ""is_planetary"": 1, ""allegiance"": ""Federation"", ""distance_to_star"": 2495, ""has_rearm"": 1, ""name"": ""Schottky Reformatory"", ""has_repair"": 1, ""has_outfitting"": 1, ""type_id"": 14, ""system_id"": 17072, ""updated_at"": 1452905323, ""faction"": ""Sol Nationalists"", ""market_updated_at"": 1453860365, ""has_market"": 1, ""selling_ships"": [], ""has_refuel"": 1, ""selling_modules"": [743, 744, 745, 746, 747, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 783, 784, 785, 786, 787, 793, 843, 846, 849, 852, 854, 857, 858, 862, 865, 866, 867, 868, 869, 870, 871, 876, 878, 879, 882, 883, 887, 890, 927, 928, 930, 931, 932, 933, 934, 935, 951, 952, 953, 954, 955, 956, 959, 998, 999, 1000, 1003, 1004, 1005, 1008, 1009, 1010, 1020, 1025, 1026, 1027, 1029, 1031, 1032, 1035, 1038, 1039, 1043, 1044, 1045, 1047, 1048, 1049, 1050, 1066, 1068, 1069, 1071, 1072, 1073, 1074, 1075, 1095, 1099, 1100, 1104, 1105, 1116, 1117, 1118, 1119, 1122, 1123, 1124, 1125, 1141, 1142, 1143, 1145, 1146, 1147, 1181, 1182, 1183, 1184, 1186, 1187, 1188, 1189, 1190, 1191, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1212, 1213, 1214, 1215, 1216, 1229, 1230, 1231, 1232, 1233, 1234, 1237, 1238, 1239, 1242, 1243, 1244, 1245, 1246, 1286, 1306, 1308, 1309, 1312, 1313, 1317, 1321, 1324, 1334, 1335, 1340, 1341, 1377, 1379, 1381, 1383, 1417, 1423, 1427, 1428, 1432, 1438, 1442, 1447, 1450, 1452, 1454, 1508, 1509, 1510, 1511, 1512, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537], ""government"": ""Democracy"", ""economies"": [""Colony""], ""outfitting_updated_at"": 1453860366, ""has_blackmarket"": 1, ""max_landing_pad_size"": ""L"", ""state"": ""Boom"", ""id"": 42877}], ""state"": ""None"", ""power"": ""Zachary Hudson"", ""name"": ""Sol"", ""security"": ""High"", ""simbad_ref"": """", ""power_state"": ""Control"", ""primary_economy"": ""Service"", ""id"": 17072}";
            StarSystem starSystem = DataProviderService.StarSystemFromEDDP(data, 0, 0, 0);

            Assert.AreEqual("Sol", starSystem.name);
            Assert.AreEqual("Federation", starSystem.allegiance);
            Assert.AreEqual("Democracy", starSystem.government);
            Assert.AreEqual("Service", starSystem.primaryeconomy);
            Assert.AreEqual(16999999880, starSystem.population);
            Assert.AreEqual((decimal)0, starSystem.x);
            Assert.AreEqual((decimal)0, starSystem.y);
            Assert.AreEqual((decimal)0, starSystem.z);
            Assert.AreEqual(15, starSystem.stations.Count);
        }
Пример #17
0
        public void TestMerope()
        {
            string data = @"{""updated_at"": 1451665590, ""security"": null, ""id"": 21120, ""needs_permit"": 0, ""y"": -149.625, ""government"": null, ""simbad_ref"": ""Merope"", ""stations"": [], ""allegiance"": null, ""state"": null, ""x"": -78.59375, ""name"": ""Merope"", ""power"": null, ""faction"": null, ""primary_economy"": null, ""power_state"": null, ""population"": null, ""z"": -340.53125}";

            StarSystem starSystem = DataProviderService.StarSystemFromEDDP(data, null, null, null);

            Assert.AreEqual("Merope", starSystem.name);
            Assert.IsNull(starSystem.allegiance);
            Assert.IsNull(starSystem.government);
            Assert.AreEqual("None", starSystem.primaryeconomy);
            Assert.AreEqual(null, starSystem.population);

            Assert.AreEqual((decimal) - 78.59375, starSystem.x);
            Assert.AreEqual((decimal) - 149.625, starSystem.y);
            Assert.AreEqual((decimal) - 340.53125, starSystem.z);
        }
Пример #18
0
        public void SaveSamplesToFile(DateTime dt, Timeframe frame, int samplesCount, int delay)
        {
            var dirPath = $"./{frame.ToString()}";

            Directory.CreateDirectory(dirPath);

            var provider = new DataProviderService();
            var samps    = provider.GetSamplessWithTimeframeAndStep(dt, frame, samplesCount, delay);

            foreach (var s in samps)
            {
                var r = string.Join('\n', s.Select(i => i.ToString()).ToArray());
                Console.WriteLine("Найдены данные!");
                Console.WriteLine(r);
                File.WriteAllText(dirPath + $"/{s[0].Ticker}_{s[0].DateTime.ToShortDateString().Replace('.', '_')}_{Guid.NewGuid()}.txt", r);
            }
        }
Пример #19
0
        public void Reload()
        {
            // Set up the star map service
            if (ignoredEvents == null)
            {
                ignoredEvents = StarMapService.Instance?.getIgnoredEvents();
            }

            if (StarMapService.Instance != null && updateThread == null)
            {
                // Spin off a thread to download & sync flight logs & system comments from EDSM in the background
                updateThread = new Thread(() => DataProviderService.syncFromStarMapService(StarMapConfiguration.FromFile()?.lastSync))
                {
                    IsBackground = true,
                    Name         = "EDSM updater"
                };
                updateThread.Start();
            }
        }
Пример #20
0
        public static void obtainEdsmLogs(StarMapConfiguration starMapConfiguration, string commanderName, IProgress <string> progress)
        {
            StarMapService starMapService = new StarMapService(starMapConfiguration.apiKey, commanderName);

            try
            {
                Dictionary <string, StarMapLogInfo> systems  = starMapService.getStarMapLog();
                Dictionary <string, string>         comments = starMapService.getStarMapComments();
                int total = systems.Count;
                int i     = 0;
                List <StarSystem> syncSystems = new List <StarSystem>();

                foreach (string system in systems.Keys)
                {
                    ++i;
                    progress.Report($"{Properties.EDSMResources.log_button_fetching_progress} {i}/{total}");
                    StarSystem CurrentStarSystem = StarSystemSqLiteRepository.Instance.GetOrCreateStarSystem(system, false);
                    CurrentStarSystem.visits    = systems[system].visits;
                    CurrentStarSystem.lastvisit = systems[system].lastVisit;
                    if (comments.ContainsKey(system))
                    {
                        CurrentStarSystem.comment = comments[system];
                    }
                    syncSystems.Add(CurrentStarSystem);

                    if (syncSystems.Count == StarMapService.syncBatchSize)
                    {
                        DataProviderService.saveFromStarMapService(syncSystems);
                        syncSystems.Clear();
                    }
                }
                if (syncSystems.Count > 0)
                {
                    DataProviderService.saveFromStarMapService(syncSystems);
                }

                progress.Report(Properties.EDSMResources.log_button_fetched);
            }
            catch (EDSMException edsme)
            {
                progress.Report(Properties.EDSMResources.log_button_error_received + edsme.Message);
            }
        }
Пример #21
0
        public void TestBgsFactionsFromName()
        {
            // Test a known faction
            Faction faction1 = DataProviderService.GetFactionByName("The Dark Wheel");

            Assert.IsNotNull(faction1);
            Assert.AreEqual("The Dark Wheel", faction1.name);
            Assert.AreEqual("Democracy", faction1.Government.invariantName);
            Assert.AreEqual("Independent", faction1.Allegiance.invariantName);
            Assert.AreEqual(41917, faction1.EDDBID);
            Assert.AreNotEqual(System.DateTime.MinValue, faction1.updatedAt);

            // Even if the faction does not exist, we should return a basic object
            Faction faction2 = DataProviderService.GetFactionByName("No such faction");

            Assert.IsNotNull(faction2);
            Assert.AreEqual("No such faction", faction2.name);
            Assert.AreEqual(Government.None, faction2.Government);
            Assert.AreEqual(Superpower.None, faction2.Allegiance);
            Assert.AreEqual(System.DateTime.MinValue, faction2.updatedAt);
        }
Пример #22
0
        private void _handleBountyAwardedEvent(BountyAwardedEvent @event, bool test = false)
        {
            // 20% bonus for Arissa Lavigny-Duval 'controlled' and 'exploited' systems
            StarSystem currentSystem = EDDI.Instance?.CurrentStarSystem;

            if (currentSystem != null)
            {
                currentSystem = LegacyEddpService.SetLegacyData(currentSystem, true, false, false);
            }

            // Default to 1.0 for unit testing
            double bonus = (!test && currentSystem?.Power == Power.FromEDName("ALavignyDuval")) ? 1.2 : 1.0;

            // Get the victim faction data
            Faction faction = DataProviderService.GetFactionByName(@event.faction);

            foreach (Reward reward in @event.rewards.ToList())
            {
                int           shipId = EDDI.Instance?.CurrentShip?.LocalId ?? 0;
                long          amount = Convert.ToInt64(reward.amount * bonus);
                FactionReport report = new FactionReport(@event.timestamp, true, shipId, Crime.None, currentSystem?.systemname, amount)
                {
                    station          = EDDI.Instance?.CurrentStation?.name,
                    body             = EDDI.Instance?.CurrentStellarBody?.bodyname,
                    victim           = @event.faction,
                    victimAllegiance = (faction.Allegiance ?? Superpower.None).invariantName
                };

                FactionRecord record = GetRecordWithFaction(reward.faction);
                if (record == null)
                {
                    record = AddRecord(reward.faction);
                }
                record.factionReports.Add(report);
                record.claims += amount;
            }
        }
Пример #23
0
        public static void obtainEdsmLogs(IProgress <string> progress)
        {
            try
            {
                Dictionary <string, StarMapLogInfo> systems  = StarMapService.Instance.getStarMapLog();
                Dictionary <string, string>         comments = StarMapService.Instance.getStarMapComments();
                int total = systems.Count;
                int i     = 0;

                string[] systemNames = systems.Keys.ToArray();
                while (i < total)
                {
                    int batchSize = Math.Min(total, StarMapService.syncBatchSize);
                    DataProviderService.syncEdsmLogBatch(systems.Skip(i).Take(batchSize).ToDictionary(x => x.Key, x => x.Value), comments);
                    i = i + batchSize;
                    progress.Report($"{Properties.EDSMResources.log_button_fetching_progress} {i}/{total}");
                }
                progress.Report(Properties.EDSMResources.log_button_fetched);
            }
            catch (EDSMException edsme)
            {
                progress.Report(Properties.EDSMResources.log_button_error_received + edsme.Message);
            }
        }
Пример #24
0
        private void handleShipTargetedEvent(ShipTargetedEvent @event)
        {
            // System targets list may be 're-built' for the current system from Log Load
            string currentSystem = EDDI.Instance?.CurrentStarSystem?.systemname;

            if (targetSystem == null)
            {
                targetSystem = currentSystem;
            }
            if (@event.targetlocked && currentSystem == targetSystem)
            {
                Target target = new Target();
                if (@event.scanstage >= 1)
                {
                    target = shipTargets.FirstOrDefault(t => t.name == @event.name);
                    if (target == null)
                    {
                        target = new Target(@event.name, @event.CombatRank, @event.ship);
                        shipTargets.Add(target);
                    }
                }
                if (@event.scanstage >= 3 && target.LegalStatus == null)
                {
                    target.faction = @event.faction;
                    if (@event.faction != null)
                    {
                        Faction faction = DataProviderService.GetFactionByName(@event.faction);
                        Power   power   = Power.FromEDName(@event.faction);
                        target.Power      = power ?? Power.None;
                        target.Allegiance = power?.Allegiance ?? faction?.Allegiance;
                    }
                    target.LegalStatus = @event.LegalStatus;
                    target.bounty      = @event.bounty;
                }
            }
        }
Пример #25
0
        public void TestStarSystemData()
        {
            // Test system & body data in a complete star system
            StarSystem starSystem = DataProviderService.GetSystemData("Sol");

            Assert.AreEqual("Sol", starSystem.name);
            Assert.AreEqual(17072, starSystem.EDDBID);
            Assert.AreEqual((decimal)0, starSystem.x);
            Assert.AreEqual((decimal)0, starSystem.y);
            Assert.AreEqual((decimal)0, starSystem.z);
            Assert.IsNotNull(starSystem.population);
            Assert.IsNotNull(starSystem.Faction);
            Assert.IsNotNull(starSystem.Faction.Allegiance.invariantName);
            Assert.IsNotNull(starSystem.Faction.Government.invariantName);
            Assert.IsNotNull(starSystem.Faction.FactionState.invariantName);
            Assert.IsNotNull(starSystem.Faction.name);
            Assert.IsNotNull(starSystem.securityLevel.invariantName);
            Assert.IsNotNull(starSystem.primaryeconomy);
            Assert.AreEqual("Common", starSystem.Reserve.invariantName);
            Assert.IsNotNull(starSystem.stations.Count);
            Assert.IsNotNull(starSystem);
            Assert.IsNotNull(starSystem.bodies);
            Assert.IsFalse(starSystem.bodies.Count == 0);
        }
Пример #26
0
        public void TestStarSystemData()
        {
            // Test system & body data in a complete star system
            StarSystem starSystem = DataProviderService.GetSystemData("Sol");

            Assert.AreEqual("Sol", starSystem.systemname);
            Assert.AreEqual(17072, starSystem.EDDBID);
            Assert.AreEqual(0M, starSystem.x);
            Assert.AreEqual(0M, starSystem.y);
            Assert.AreEqual(0M, starSystem.z);
            Assert.IsNotNull(starSystem.population);
            Assert.IsNotNull(starSystem.Faction);
            Assert.IsNotNull(starSystem.Faction.Allegiance.invariantName);
            Assert.IsNotNull(starSystem.Faction.Government.invariantName);
            Assert.IsNotNull(starSystem.Faction.presences.FirstOrDefault(p => p.systemName == starSystem.systemname)?.FactionState?.invariantName);
            Assert.IsNotNull(starSystem.Faction.name);
            Assert.IsNotNull(starSystem.securityLevel.invariantName);
            Assert.IsNotNull(starSystem.primaryeconomy);
            Assert.AreEqual("Common", starSystem.Reserve.invariantName);
            Assert.IsNotNull(starSystem.stations.Count);
            Assert.IsNotNull(starSystem);
            Assert.IsNotNull(starSystem.bodies);
            Assert.AreNotEqual(0, starSystem.bodies.Count);
        }
Пример #27
0
 public EDSMResponder(IEdsmService edsmService)
 {
     this.edsmService    = edsmService;
     dataProviderService = new DataProviderService(edsmService);
     Logging.Info($"Initialized {ResponderName()}");
 }
Пример #28
0
        public void GetFactionData(FactionRecord record, string homeSystem = null)
        {
            if (record == null || record.faction == null || record.faction == Properties.CrimeMonitor.blank_faction)
            {
                return;
            }

            // Get the faction from Elite BGS and set faction record values
            Faction faction = DataProviderService.GetFactionByName(record.faction);

            if (faction.EDDBID == null)
            {
                record.faction = Properties.CrimeMonitor.blank_faction;
                record.system  = null;
                record.station = null;
                return;
            }
            record.Allegiance = faction.Allegiance ?? Superpower.None;
            List <string> factionSystems = faction.presences.Select(p => p.systemName).ToList();

            factionSystems = faction.presences
                             .OrderByDescending(p => p.influence)
                             .Select(p => p.systemName).ToList();
            record.factionSystems = factionSystems;

            // If 'home system' is desiginated, check if system is part of faction presence
            if (homeSystem != null && factionSystems.Contains(homeSystem))
            {
                record.system  = homeSystem;
                record.station = GetFactionStation(homeSystem);
                if (FindHomeSystem(record.faction, factionSystems) == null && !homeSystems.ContainsKey(record.faction))
                {
                    // Save home system if not part of faction name and not previously saved
                    homeSystems.Add(record.faction, homeSystem);
                }
                return;
            }

            // Check faction with archived home systems
            if (homeSystems.TryGetValue(record.faction, out string result))
            {
                record.system  = result;
                record.station = GetFactionStation(result);
                return;
            }

            // Find 'home system' by matching faction name with presence and check for qualifying station
            homeSystem = FindHomeSystem(record.faction, factionSystems);
            if (homeSystem != null)
            {
                string factionStation = GetFactionStation(homeSystem);

                // Station found meeting game/user requirements
                if (factionStation != null)
                {
                    record.system  = homeSystem;
                    record.station = factionStation;
                    return;
                }
            }

            // Check faction presences, by order of influence, for qualifying station
            foreach (string system in factionSystems)
            {
                string factionStation = GetFactionStation(system);
                if (factionStation != null)
                {
                    record.system  = system;
                    record.station = factionStation;
                    return;
                }
            }

            // Settle for highest influence faction presence, with no station found
            record.system  = factionSystems.FirstOrDefault();
            record.station = null;
        }
Пример #29
0
        public static Ship ShipFromProfile(dynamic json)
        {
            if (json["ship"] == null)
            {
                return(null);
            }

            string Model = json["ship"]["name"];

            if (shipTranslations.ContainsKey(Model))
            {
                Model = shipTranslations[Model];
            }

            Ship Ship = ShipDefinitions.ShipFromModel(Model);

            Ship.LocalId = json["ship"]["id"];

            Ship.Value = (long)json["ship"]["value"]["hull"] + (long)json["ship"]["value"]["modules"];

            Ship.CargoCapacity = (int)json["ship"]["cargo"]["capacity"];
            Ship.CargoCarried  = (int)json["ship"]["cargo"]["qty"];

            // Be sensible with health - round it unless it's very low
            decimal Health = (decimal)json["ship"]["health"]["hull"] / 10000;

            if (Health < 5)
            {
                Ship.Health = Math.Round(Health, 1);
            }
            else
            {
                Ship.Health = Math.Round(Health);
            }

            // Obtain the internals
            Ship.Bulkheads        = ModuleFromProfile("Armour", json["ship"]["modules"]["Armour"]);
            Ship.PowerPlant       = ModuleFromProfile("PowerPlant", json["ship"]["modules"]["PowerPlant"]);
            Ship.Thrusters        = ModuleFromProfile("MainEngines", json["ship"]["modules"]["MainEngines"]);
            Ship.FrameShiftDrive  = ModuleFromProfile("FrameShiftDrive", json["ship"]["modules"]["FrameShiftDrive"]);
            Ship.LifeSupport      = ModuleFromProfile("LifeSupport", json["ship"]["modules"]["LifeSupport"]);
            Ship.PowerDistributor = ModuleFromProfile("PowerDistributor", json["ship"]["modules"]["PowerDistributor"]);
            Ship.Sensors          = ModuleFromProfile("Radar", json["ship"]["modules"]["Radar"]);
            Ship.FuelTank         = ModuleFromProfile("FuelTank", json["ship"]["modules"]["FuelTank"]);
            Ship.FuelTankCapacity = (decimal)json["ship"]["fuel"]["main"]["capacity"];

            // Obtain the hardpoints.  Hardpoints can come in any order so first parse them then second put them in the correct order
            Dictionary <string, Hardpoint> hardpoints = new Dictionary <string, Hardpoint>();

            foreach (dynamic module in json["ship"]["modules"])
            {
                if (module.Name.Contains("Hardpoint"))
                {
                    hardpoints.Add(module.Name, HardpointFromProfile(module));
                }
            }

            foreach (string size in HARDPOINT_SIZES)
            {
                for (int i = 1; i < 8; i++)
                {
                    Hardpoint hardpoint;
                    hardpoints.TryGetValue(size + "Hardpoint" + i, out hardpoint);
                    if (hardpoint != null)
                    {
                        Ship.Hardpoints.Add(hardpoint);
                    }
                }
            }

            // Obtain the compartments
            foreach (dynamic module in json["ship"]["modules"])
            {
                if (module.Name.Contains("Slot"))
                {
                    Ship.Compartments.Add(CompartmentFromProfile(module));
                }
            }

            // Obtain the cargo
            Ship.Cargo = new List <Cargo>();
            if (json["ship"]["cargo"] != null && json["ship"]["cargo"]["items"] != null)
            {
                foreach (dynamic cargoJson in json["ship"]["cargo"]["items"])
                {
                    string name  = (string)cargoJson["commodity"];
                    Cargo  cargo = new Cargo();
                    cargo.Commodity = CommodityDefinitions.CommodityFromCargoName(name);
                    if (cargo.Commodity.Name == null)
                    {
                        // Unknown commodity; log an error so that we can update the definitions
                        DataProviderService.LogError("No commodity definition for cargo " + cargoJson.ToString());
                        cargo.Commodity.Name = name;
                    }
                    cargo.Quantity = (int)cargoJson["qty"];
                    cargo.Cost     = (long)cargoJson["value"];
                    Ship.Cargo.Add(cargo);
                }
            }

            return(Ship);
        }
Пример #30
0
        public void TestDataProviderUnknown()
        {
            StarSystem starSystem = DataProviderService.GetSystemData("Not appearing in this galaxy");

            Assert.IsNotNull(starSystem);
        }