Example #1
0
        /// <summary>
        /// Processes the queried character's skill queue information.
        /// </summary>
        /// <param name="result"></param>
        private void OnSkillQueueUpdated(CCPAPIResult <SerializableAPISkillQueue> result)
        {
            // Character may have been deleted or set to not be monitored since we queried
            if (m_ccpCharacter == null || !m_ccpCharacter.Monitored)
            {
                return;
            }

            // Notify an error occurred
            if (m_ccpCharacter.ShouldNotifyError(result, CCPAPICharacterMethods.SkillQueue))
            {
                EveMonClient.Notifications.NotifySkillQueueError(m_ccpCharacter, result);
            }

            // Quits if there is an error
            if (result.HasError)
            {
                return;
            }

            // Import the data
            m_ccpCharacter.SkillQueue.Import(result.Result.Queue);

            // Check the account has a character in training (if API key of type "Account")
            APIKey apikey = m_ccpCharacter.Identity.FindAPIKeyWithAccess(CCPAPICharacterMethods.SkillInTraining);

            apikey?.CharacterInTraining();

            // Check the character has less than a day of training in skill queue
            if (m_ccpCharacter.IsTraining && m_ccpCharacter.SkillQueue.LessThanWarningThreshold)
            {
                EveMonClient.Notifications.NotifySkillQueueLessThanADay(m_ccpCharacter);
                return;
            }

            EveMonClient.Notifications.InvalidateSkillQueueLessThanADay(m_ccpCharacter);
        }