Пример #1
0
        /// <summary>
        /// Imports data from a serialization object.
        /// </summary>
        /// <param name="serial"></param>
        private void Import(SerializableCCPCharacter serial)
        {
            Import((SerializableSettingsCharacter)serial);

            // Skill queue
            SkillQueue.Import(serial.SkillQueue);

            // Market orders
            MarketOrdersImport(serial.MarketOrders);

            // Contracts
            ContractsImport(serial.Contracts);

            // Industry jobs
            IndustryJobsImport(serial.IndustryJobs);

            // EVE mail messages IDs
            EVEMailMessages.Import(serial.EveMailMessagesIDs);

            // EVE notifications IDs
            EVENotifications.Import(serial.EveNotificationsIDs);

            // Kill Logs
            KillLog.ImportFromCacheFile();

            // Fire the global event
            EveMonClient.OnCharacterUpdated(this);
        }
Пример #2
0
        /// <summary>
        /// Called when the object gets disposed.
        /// </summary>
        internal override void Dispose()
        {
            // Unsubscribe events
            EveMonClient.CharacterAssetsUpdated           -= EveMonClient_CharacterAssetsUpdated;
            EveMonClient.CharacterMarketOrdersUpdated     -= EveMonClient_CharacterMarketOrdersUpdated;
            EveMonClient.CorporationMarketOrdersUpdated   -= EveMonClient_CorporationMarketOrdersUpdated;
            EveMonClient.CharacterContractsUpdated        -= EveMonClient_CharacterContractsUpdated;
            EveMonClient.CorporationContractsUpdated      -= EveMonClient_CorporationContractsUpdated;
            EveMonClient.CharacterIndustryJobsUpdated     -= EveMonClient_CharacterIndustryJobsUpdated;
            EveMonClient.CorporationIndustryJobsUpdated   -= EveMonClient_CorporationIndustryJobsUpdated;
            EveMonClient.CharacterIndustryJobsCompleted   -= EveMonClient_CharacterIndustryJobsCompleted;
            EveMonClient.CorporationIndustryJobsCompleted -= EveMonClient_CorporationIndustryJobsCompleted;
            EveMonClient.CharacterPlaneteryPinsCompleted  -= EveMonClient_CharacterPlaneteryPinsCompleted;
            EveMonClient.APIKeyInfoUpdated -= EveMonClient_APIKeyInfoUpdated;
            EveMonClient.TimerTick         -= EveMonClient_TimerTick;

            // Unsubscribe events
            SkillQueue.Dispose();
            CharacterIndustryJobs.Dispose();
            CorporationIndustryJobs.Dispose();
            PlanetaryColonies.Dispose();

            // Unsubscribe events
            if (m_characterDataQuerying != null)
            {
                m_characterDataQuerying.Dispose();
                m_characterDataQuerying = null;
            }

            if (m_corporationDataQuerying != null)
            {
                m_corporationDataQuerying.Dispose();
                m_corporationDataQuerying = null;
            }
        }
Пример #3
0
        /// <summary>
        /// Base constructor.
        /// </summary>
        /// <param name="identity"></param>
        /// <param name="guid"></param>
        private CCPCharacter(CharacterIdentity identity, Guid guid)
            : base(identity, guid)
        {
            QueryMonitors           = new QueryMonitorCollection();
            SkillQueue              = new SkillQueue(this);
            Standings               = new StandingCollection(this);
            Assets                  = new AssetCollection(this);
            WalletJournal           = new WalletJournalCollection(this);
            WalletTransactions      = new WalletTransactionsCollection(this);
            CharacterMarketOrders   = new MarketOrderCollection(this);
            CorporationMarketOrders = new MarketOrderCollection(this);
            CharacterContracts      = new ContractCollection(this);
            CorporationContracts    = new ContractCollection(this);
            CharacterIndustryJobs   = new IndustryJobCollection(this);
            CorporationIndustryJobs = new IndustryJobCollection(this);
            ResearchPoints          = new ResearchPointCollection(this);
            EVEMailMessages         = new EveMailMessageCollection(this);
            EVEMailingLists         = new EveMailingListCollection(this);
            EVENotifications        = new EveNotificationCollection(this);
            Contacts                = new ContactCollection(this);
            CharacterMedals         = new MedalCollection(this);
            CorporationMedals       = new MedalCollection(this);
            UpcomingCalendarEvents  = new UpcomingCalendarEventCollection(this);
            KillLog                 = new KillLogCollection(this);
            PlanetaryColonies       = new PlanetaryColonyCollection(this);
            LoyaltyPoints           = new LoyaltyCollection(this);

            m_endedOrdersForCharacter   = new List <MarketOrder>();
            m_endedOrdersForCorporation = new List <MarketOrder>();

            m_endedContractsForCharacter   = new List <Contract>();
            m_endedContractsForCorporation = new List <Contract>();

            m_jobsCompletedForCharacter = new List <IndustryJob>();
            m_allianceName    = EveIDToName.GetIDToName(AllianceID);
            m_corporationName = EveIDToName.GetIDToName(CorporationID);

            EveMonClient.CharacterAssetsUpdated           += EveMonClient_CharacterAssetsUpdated;
            EveMonClient.CharacterMarketOrdersUpdated     += EveMonClient_CharacterMarketOrdersUpdated;
            EveMonClient.CorporationMarketOrdersUpdated   += EveMonClient_CorporationMarketOrdersUpdated;
            EveMonClient.CharacterContractsUpdated        += EveMonClient_CharacterContractsUpdated;
            EveMonClient.CorporationContractsUpdated      += EveMonClient_CorporationContractsUpdated;
            EveMonClient.CharacterIndustryJobsUpdated     += EveMonClient_CharacterIndustryJobsUpdated;
            EveMonClient.CorporationIndustryJobsUpdated   += EveMonClient_CorporationIndustryJobsUpdated;
            EveMonClient.CharacterIndustryJobsCompleted   += EveMonClient_CharacterIndustryJobsCompleted;
            EveMonClient.CorporationIndustryJobsCompleted += EveMonClient_CorporationIndustryJobsCompleted;
            EveMonClient.CharacterPlaneteryPinsCompleted  += EveMonClient_CharacterPlaneteryPinsCompleted;
            EveMonClient.ESIKeyInfoUpdated  += EveMonClient_ESIKeyInfoUpdated;
            EveMonClient.EveIDToNameUpdated += EveMonClient_EveIDToNameUpdated;
            EveMonClient.TimerTick          += EveMonClient_TimerTick;
        }
Пример #4
0
        /// <summary>
        /// Create a serializable character sheet for this character.
        /// </summary>
        /// <returns></returns>
        public override SerializableSettingsCharacter Export()
        {
            SerializableCCPCharacter serial = new SerializableCCPCharacter();

            Export(serial);

            // Skill queue
            serial.SkillQueue.AddRange(SkillQueue.Export());

            // Market orders
            serial.MarketOrders.AddRange(MarketOrdersExport());

            // Contracts
            serial.Contracts.AddRange(ContractsExport());

            // Industry jobs
            serial.IndustryJobs.AddRange(IndustryJobsExport());

            // Eve mail messages IDs
            serial.EveMailMessagesIDs = EVEMailMessages.Export();

            // Eve notifications IDs
            serial.EveNotificationsIDs = EVENotifications.Export();

            // WalletTransactions to XML
            WalletTransactions.ExportToCacheFile();
            serial.LastWalletTransactionTime = WalletTransactions.Count == 0 ? DateTime.MinValue : WalletTransactions.Max(wt => wt.Date);

            // Last API updates
            if (QueryMonitors.Any())
            {
                m_lastAPIUpdates = QueryMonitors.Select(
                    monitor => new SerializableAPIUpdate
                {
                    Method = monitor.Method.ToString(),
                    Time   = monitor.LastUpdate
                }).ToList();
            }

            serial.LastUpdates.AddRange(m_lastAPIUpdates);

            return(serial);
        }
Пример #5
0
        /// <summary>
        /// Create a serializable character sheet for this character.
        /// </summary>
        /// <returns></returns>
        public override SerializableSettingsCharacter Export()
        {
            SerializableCCPCharacter serial = new SerializableCCPCharacter();

            Export(serial);

            // Skill queue
            serial.SkillQueue.AddRange(SkillQueue.Export());

            // Market orders
            serial.MarketOrders.AddRange(MarketOrdersExport());

            // Contracts
            serial.Contracts.AddRange(ContractsExport());

            // ContractBids
            serial.ContractBids.AddRange(CharacterContractBids.Export());

            // Industry jobs
            serial.IndustryJobs.AddRange(IndustryJobsExport());

            // Eve mail messages IDs
            serial.EveMailMessagesIDs = EVEMailMessages.Export();

            // Eve notifications IDs
            serial.EveNotificationsIDs = EVENotifications.Export();

            // Last API updates
            if (QueryMonitors.Any())
            {
                m_lastAPIUpdates = QueryMonitors.Select(
                    monitor => new SerializableAPIUpdate
                {
                    Method = monitor.Method.ToString(),
                    Time   = monitor.LastUpdate
                }).ToList();
            }

            serial.LastUpdates.AddRange(m_lastAPIUpdates);

            return(serial);
        }