示例#1
0
        /// <summary>
        /// Imports an enumeration of ESI objects.
        /// </summary>
        /// <param name="kills">The enumeration of serializable kill data from ESI.</param>
        internal void Import(EsiAPIKillLog kills)
        {
            bool startRequest = false;

            lock (m_pendingItems)
            {
                // If no request currently running, start a new one
                if (m_killMailCounter == 0)
                {
                    m_killMailCounter = kills.Count;
                    m_pendingItems.Clear();
                    m_pendingItems.Capacity = m_killMailCounter;
                    startRequest            = true;
                }
            }
            if (startRequest)
            {
                EveMonClient.Notifications.InvalidateAPIError();
                foreach (EsiKillLogListItem srcKillLog in kills)
                {
                    // Query each individual mail; while the etag would be nice storing it in
                    // the legacy XML architecture is not really worth the trouble
                    string hash = srcKillLog.Hash;
                    EveMonClient.APIProviders.CurrentProvider.QueryEsi <EsiAPIKillMail>(
                        ESIAPIGenericMethods.KillMail, OnKillMailDownloaded, new ESIParams()
                    {
                        ParamOne = srcKillLog.KillID,
                        GetData  = hash
                    }, hash);
                }
            }
        }
示例#2
0
        /// <summary>
        /// Processes the queried character's kill log.
        /// </summary>
        /// <param name="result"></param>
        private void OnKillLogUpdated(EsiAPIKillLog result)
        {
            var target = m_ccpCharacter;

            // Character may have been deleted since we queried
            if (target != null)
            {
                target.KillLog.Import(result);
                EveMonClient.OnCharacterKillLogUpdated(m_ccpCharacter);
            }
        }
示例#3
0
        /// <summary>
        /// Processes the queried character's kill log.
        /// </summary>
        /// <param name="result"></param>
        private void OnKillLogUpdated(EsiAPIKillLog result)
        {
            var target = m_ccpCharacter;

            // Character may have been deleted since we queried
            if (target != null)
            {
                target.KillLog.Import(result);
                EveMonClient.OnCharacterKillLogUpdated(m_ccpCharacter);
                // Save the file to the cache
                string filename = $"{target.Name}-{ESIAPICharacterMethods.KillLog}";
                LocalXmlCache.SaveAsync(filename, Util.SerializeToXmlDocument(result)).
                ConfigureAwait(false);
            }
        }
示例#4
0
 /// <summary>
 /// Imports an enumeration of ESI objects.
 /// </summary>
 /// <param name="kills">The enumeration of serializable kill data from ESI.</param>
 internal void Import(EsiAPIKillLog kills)
 {
     if (m_killMailCounter == 0)
     {
         Items.Clear();
         EveMonClient.Notifications.InvalidateAPIError();
         lock (m_counterLock)
         {
             m_killMailCounter = kills.Count;
         }
         foreach (EsiKillLogListItem srcKillLog in kills)
         {
             // Query each individual mail
             string hash = srcKillLog.Hash;
             EveMonClient.APIProviders.CurrentProvider.QueryEsiAsync <EsiAPIKillMail>(
                 ESIAPIGenericMethods.KillMail, srcKillLog.KillID, hash,
                 OnKillMailDownloaded, hash);
         }
     }
 }