Ejemplo n.º 1
0
        /// <summary>
        /// Gets the last known docked description.
        /// </summary>
        /// <returns></returns>
        public string GetLastKnownDockedText()
        {
            if (LastKnownLocation == null)
            {
                return(EveMonConstants.UnknownText);
            }

            // Show the tooltip on when the user provides api key
            ESIKey apiKey = Identity.FindAPIKeyWithAccess(ESIAPICharacterMethods.Location);

            if (apiKey == null)
            {
                return(EveMonConstants.UnknownText);
            }

            Station station = LastKnownStation;

            // Not in any station ?
            if (station == null)
            {
                return(String.Empty);
            }

            return(station.Name);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the contract items.
        /// </summary>
        private void GetContractItems()
        {
            // Exit if we are already trying to download
            if (m_queryPending)
            {
                return;
            }

            m_queryPending = true;

            // Special condition to identify corporation contracts in character query
            ESIKey apiKey = IssuedFor == IssuedFor.Corporation && CCPAPICorporationMethods.CorporationContracts.Equals(m_method)
                ? Character.Identity.FindAPIKeyWithAccess(CCPAPICorporationMethods.CorporationContracts)
                : Character.Identity.FindAPIKeyWithAccess(ESIAPICharacterMethods.Contracts);

            // Quits if access denied
            if (apiKey == null)
            {
                return;
            }

            // Special condition to identify corporation contracts in character query and determine the correct api method to call
            var method = IssuedFor == IssuedFor.Corporation && CCPAPICorporationMethods.CorporationContracts.Equals(m_method)
                ? (Enum)CCPAPICorporationMethods.CorporationContractItems : ESIAPICharacterMethods.ContractItems;

            EveMonClient.APIProviders.CurrentProvider.QueryEsiAsync <EsiAPIContractItems>(
                method, apiKey.AccessToken, Character.CharacterID, ID, OnContractItemsDownloaded, method);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the last known location description.
        /// </summary>
        /// <returns></returns>
        public string GetLastKnownLocationText()
        {
            if (LastKnownLocation == null)
            {
                return(EveMonConstants.UnknownText);
            }

            // Show the tooltip on when the user provides api key
            ESIKey apiKey = Identity.FindAPIKeyWithAccess(ESIAPICharacterMethods.Location);

            if (apiKey == null)
            {
                return(EveMonConstants.UnknownText);
            }

            // Check if in an NPC station or in an outpost
            Station station = LastKnownStation;

            // In a station ?
            // Don't care if it's an outpost or regular station
            // as station name will be displayed in docking info
            if (station != null)
            {
                return($"{station.SolarSystem.FullLocation} ({station.SolarSystem.SecurityLevel:N1})");
            }

            // Has to be in a solar system at least
            SolarSystem system = LastKnownSolarSystem;

            // Not in a solar system ??? Then show default location
            return(system != null ? $"{system.FullLocation} ({system.SecurityLevel:N1})"
                : "Lost in space");
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the attendees.
 /// </summary>
 public void GetEventAttendees()
 {
     if (!m_queryPending)
     {
         m_queryPending = true;
         ESIKey apiKey = m_ccpCharacter.Identity.FindAPIKeyWithAccess(
             ESIAPICharacterMethods.CalendarEventAttendees);
         if (apiKey != null)
         {
             EveMonClient.APIProviders.CurrentProvider.QueryEsiAsync <EsiAPICalendarEventAttendees>(
                 ESIAPICharacterMethods.CalendarEventAttendees, apiKey.AccessToken,
                 m_ccpCharacter.CharacterID, m_eventID, OnCalendarEventAttendeesDownloaded);
         }
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets the EVE mail body.
 /// </summary>
 public void GetMailBody()
 {
     // Exit if we are already trying to download the mail message body text
     if (!m_queryPending)
     {
         m_queryPending = true;
         ESIKey apiKey = m_ccpCharacter.Identity.FindAPIKeyWithAccess(
             ESIAPICharacterMethods.MailBodies);
         if (apiKey != null)
         {
             EveMonClient.APIProviders.CurrentProvider.QueryEsiAsync <EsiAPIMailBody>(
                 ESIAPICharacterMethods.MailBodies, apiKey.AccessToken, m_ccpCharacter.
                 CharacterID, MessageID, OnEVEMailBodyDownloaded, MessageID);
         }
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Gets the colony pins.
 /// </summary>
 private void GetColonyLayout()
 {
     if (!m_queryPinsPending)
     {
         m_queryPinsPending = true;
         // Find the API key associated with planetary pins
         ESIKey apiKey = Character.Identity.FindAPIKeyWithAccess(ESIAPICharacterMethods.
                                                                 PlanetaryLayout);
         if (apiKey != null)
         {
             EveMonClient.APIProviders.CurrentProvider.QueryEsiAsync <EsiAPIPlanetaryColony>(
                 ESIAPICharacterMethods.PlanetaryLayout, apiKey.AccessToken, Character.
                 CharacterID, PlanetID, OnPlanetaryPinsUpdated);
         }
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Gets the colony pins.
 /// </summary>
 private void GetColonyLayout()
 {
     if (!m_queryPinsPending && !EsiErrors.IsErrorCountExceeded)
     {
         // Find the API key associated with planetary pins
         ESIKey apiKey = Character.Identity.FindAPIKeyWithAccess(ESIAPICharacterMethods.
                                                                 PlanetaryLayout);
         m_queryPinsPending = true;
         if (apiKey != null)
         {
             EveMonClient.APIProviders.CurrentProvider.QueryEsi <EsiAPIPlanetaryColony>(
                 ESIAPICharacterMethods.PlanetaryLayout, OnPlanetaryPinsUpdated,
                 new ESIParams(m_layoutResponse, apiKey.AccessToken)
             {
                 ParamOne = Character.CharacterID,
                 ParamTwo = PlanetID
             });
         }
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Gets the attendees.
 /// </summary>
 public void GetEventAttendees()
 {
     if (!m_queryPending)
     {
         m_queryPending = true;
         ESIKey apiKey = m_ccpCharacter.Identity.FindAPIKeyWithAccess(
             ESIAPICharacterMethods.CalendarEventAttendees);
         if (apiKey != null)
         {
             EveMonClient.APIProviders.CurrentProvider.QueryEsi
             <EsiAPICalendarEventAttendees>(ESIAPICharacterMethods.
                                            CalendarEventAttendees, OnCalendarEventAttendeesDownloaded,
                                            new ESIParams(m_attendResponse, apiKey.AccessToken)
             {
                 ParamOne = m_ccpCharacter.CharacterID,
                 ParamTwo = m_eventID
             });
         }
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Gets the last known location description.
        /// </summary>
        /// <returns></returns>
        public string GetLastKnownLocationText()
        {
            if (LastKnownLocation == null)
            {
                return(EveMonConstants.UnknownText);
            }

            // Show the tooltip on when the user provides api key
            ESIKey apiKey = Identity.FindAPIKeyWithAccess(ESIAPICharacterMethods.Location);

            if (apiKey == null)
            {
                return(EveMonConstants.UnknownText);
            }

            // Check if in an NPC station or in an outpost
            var system = (LastKnownStation?.SolarSystem) ?? LastKnownSolarSystem;

            // Not in a solar system ??? Then show default location
            return(system != null ? $"{system.FullLocation} ({system.SecurityLevel:N1})"
                : "Lost in space");
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Gets the attendees.
        /// </summary>
        public void GetEventAttendees()
        {
            // Exit if we are already trying to download the calendar event attendees
            if (m_queryPending)
            {
                return;
            }

            m_queryPending = true;

            // Quits if access denied
            ESIKey apiKey = m_ccpCharacter.Identity.FindAPIKeyWithAccess(ESIAPICharacterMethods.CalendarEventAttendees);

            if (apiKey == null)
            {
                return;
            }

            EveMonClient.APIProviders.CurrentProvider.QueryEsiAsync <EsiAPICalendarEventAttendees>(
                ESIAPICharacterMethods.CalendarEventAttendees, apiKey.AccessToken,
                m_ccpCharacter.CharacterID, m_eventID, OnCalendarEventAttendeesDownloaded);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Gets the colony pins.
        /// </summary>
        private void GetColonyLayout()
        {
            // Exit if we are already trying to download
            if (m_queryPinsPending)
            {
                return;
            }

            m_queryPinsPending = true;

            // Find the API key associated with planeatry pins
            ESIKey apiKey = Character.Identity.FindAPIKeyWithAccess(ESIAPICharacterMethods.AssetList);

            // Quits if access denied
            if (apiKey == null)
            {
                return;
            }

            EveMonClient.APIProviders.CurrentProvider.QueryEsiAsync <EsiAPIPlanetaryColony>(
                ESIAPICharacterMethods.PlanetaryLayout, apiKey.AccessToken, Character.CharacterID,
                PlanetID, OnPlanetaryPinsUpdated);
        }