Exemple #1
0
 private void ensureInitialized()
 {
     if (_isInitialized)
     {
         return;
     }
     lock (_lazyLoadLock) {
         if (_isInitialized)
         {
             return;
         }
         Corporation corp = ApiKey.Corporation;
         _corporationName = corp.CorporationName;
         _allianceId      = corp.AllianceId;
         _allianceName    = corp.AllianceName;
         _factionId       = corp.FactionId;
         _factionName     = corp.FactionName;
         _isInitialized   = true;
     }
 }
Exemple #2
0
        public async Task <IndustryJobs> GetCorporationIndustryJobs(long keyid, string vcode, long corporationId)
        {
            _logger.Debug("{method} {keyid} {corporationid}", "GetCorporationIndustryJobsBackground", keyid, corporationId);

            try
            {
                var character = new eZet.EveLib.EveXmlModule.Corporation((int)keyid, vcode, corporationId);
                var z         = await character.GetIndustryJobsAsync();

                return(z.Result);
            }
            catch (Exception e)
            {
                if (e.ToString().Contains("Authentication failure"))
                {
                    throw new UserException(strings.ErrorAuthenticationFailure, e);
                }

                _logger.Error("{method} {@exception}", "GetCorporationIndustryJobsBackground", e);

                throw new UserException(strings.ErrorCallingEveApi, e);
            }
        }
Exemple #3
0
        public async Task <WalletTransactions> GetCorporationWallet(long keyid, string vcode,
                                                                    long corporationId, long fromid)
        {
            _logger.Debug("{method} {keyid} {corporationid} {fromid}", "GetCorporationWallet", keyid, corporationId, fromid);

            try
            {
                var entity = new eZet.EveLib.EveXmlModule.Corporation((int)keyid, vcode, corporationId);
                var z      = await entity.GetWalletTransactionsAsync(1000, 2560, fromid);

                return(z.Result);
            }
            catch (Exception e)
            {
                if (e.ToString().Contains("Authentication failure"))
                {
                    throw new UserException(strings.ErrorAuthenticationFailure, e);
                }

                _logger.Error("{method} {@exception}", "GetCorporationJournalBackground", e);

                throw new UserException(strings.ErrorCallingEveApi, e);
            }
        }
 public Corporation_StaticDeserializationTests() {
     _corp = new Corporation(new CorporationKey(0, ""), 0);
     _corp.RequestHandler = new StaticXmlRequestHandler(new XmlSerializer());
 }