Beispiel #1
0
        public void Run()
        {
            _api.Start();

            Console.ReadLine();

            _api.Stop();
        }
        public void StartSynchronization()
        {
            if (Synchronization != SynchronizationStatus.Stopped || !IsApiAttached)
            {
                return;
            }

            _eliteAPI.StatusChanged       += OnStatusChanged;
            _eliteAPI.GameEvents.LoadGame += GameOnLoadGameAsync;

            _eliteAPI.PlayerEvents.Commander    += PlayerOnCommander;
            _eliteAPI.PlayerEvents.NewCommander += PlayerOnNewCommander;
            _eliteAPI.PlayerEvents.Friends      += PlayerOnFriendsAsync;
            _eliteAPI.PlayerEvents.Statistics   += PlayerOnStatisticsAsync;
            _eliteAPI.PlayerEvents.Rank         += PlayerOnRankAsync;
            _eliteAPI.PlayerEvents.Promotion    += PlayerOnPromotionAsync;
            _eliteAPI.PlayerEvents.Progress     += PlayerOnProgressAsync;
            _eliteAPI.PlayerEvents.Reputation   += PlayerOnReputationAsync;

            _eliteAPI.PowerplayEvents.Powerplay += PowerplayOnPowerplayAsync;

            _eliteAPI.TravelEvents.FsdJump  += TravelOnFsdJumpAsync;
            _eliteAPI.TravelEvents.Location += TravelOnLocationAsync;
            _eliteAPI.TravelEvents.Docked   += TravelOnDockedAsync;

            _eliteAPI.StationEvents.EngineerProgress += StationOnEngineerProgressAsync;
            _eliteAPI.StationEvents.ShipyardBuy      += StationOnShipyardBuyAsync;
            _eliteAPI.StationEvents.ShipyardNew      += StationOnShipyardNewAsync;
            _eliteAPI.StationEvents.SetUserShipName  += StationOnSetUserShipNameAsync;
            _eliteAPI.StationEvents.ShipyardSwap     += StationOnShipyardSwapAsync;
            _eliteAPI.StationEvents.ShipyardTransfer += StationEventsOnShipyardTransferAsync;

            _eliteAPI.ShipEvents.Loadout += ShipEventsOnLoadoutAsync;

            _eliteAPI.CombatEvents.Died               += CombatEventsOnDiedAsync;
            _eliteAPI.CombatEvents.Interdicted        += CombatEventsOnInterdictedAsync;
            _eliteAPI.CombatEvents.Interdiction       += CombatEventsOnInterdictionAsync;
            _eliteAPI.CombatEvents.EscapeInterdiction += CombatEventsOnEscapeInterdictionAsync;
            _eliteAPI.CombatEvents.PvpKill            += CombatEventsOnPvpKillAsync;

            _eliteAPI.Start();

            Synchronization = _eliteAPI.Status == ApiStatus.Running
                ? SynchronizationStatus.Running
                : SynchronizationStatus.Pending;
        }
Beispiel #3
0
 public ApiService(IEliteDangerousAPI api, string path)
 {
     this.api = api;
     api.ChangeJournal(new System.IO.DirectoryInfo(path));
     api.Start();
 }