Ejemplo n.º 1
0
        public async Task <IActionResult> SystemInfo(int id)
        {
            SolarSystem_V_Row solarSystem = _DBService.GetSolarSystem(id);

            // TODO: Eventually move this to SDE calls
            var solarSystemApi = await _ESIClient.Universe.GetSolarSystemInfoV4Async(id);

            var star = await _ESIClient.Universe.GetStarInfoV1Async(solarSystemApi.Model.StarId);

            List <Stargate> stargates = new List <Stargate>();

            foreach (int stargateId in solarSystemApi.Model.Stargates)
            {
                var stargate = await _ESIClient.Universe.GetStargateInfoV1Async(stargateId);

                stargates.Add(stargate.Model);
            }

            List <Station_V_Row> stations = _DBService.GetStationsForSolarSystem(id);

            var model = new UniverseSystemInfoPageViewModel
            {
                System         = solarSystem,
                System_API     = solarSystemApi.Model,
                Star           = star.Model,
                Stargates      = stargates,
                Stations       = stations,
                SetDestination = new UniverseSetDestinationModel(),
                OpenInfoModel  = new UniverseSystemInfoItemTypeOpenInfoModel()
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> SystemInfoSetSystemAsWaypoint(UniverseSystemInfoPageViewModel model)
        {
            AuthDTO auth = GetAuth(_ESIClient);

            _Log.LogDebug(String.Format("Logged in to retrieve Character Info for Character Id: {0}", auth.CharacterId));
            await _ESIClient.UserInterface.SetAutopilotWaypointV2Async(auth, model.SetDestination.AddToBeginning, model.SetDestination.ClearOtherWaypoints, model.SetDestination.DestinationId);

            return(RedirectToAction("SystemInfo", new { id = model.SetDestination.DestinationId }));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> SystemInfoOpenInfoWindowForItemType(UniverseSystemInfoPageViewModel model)
        {
            AuthDTO auth = GetAuth(_ESIClient);

            _Log.LogDebug(String.Format("Logged in to retrieve Character Info for Character Id: {0}", auth.CharacterId));
            await _ESIClient.UserInterface.OpenInformationWindowV1Async(auth, model.OpenInfoModel.ItemTypeId);

            return(RedirectToAction("SystemInfo", new { id = model.OpenInfoModel.SystemId }));
        }