Esempio n. 1
0
        public static void Process(Controller controller, EliteAPI.Events.IEvent apiEvent, ILogger logger)
        {
            try
            {
                if (apiEvent is EliteAPI.Events.StatusEvent)
                {
                    var statusEvent = apiEvent as EliteAPI.Events.StatusEvent;
                    var key         = $"{statusEvent.Event}:{statusEvent.Value}";

                    switch (key)
                    {
                    case "Status.Gear:True":
                    case "Status.Gear:False":
                        controller.PlayFileEffect("gear.ffe", 2000);
                        break;

                    case "Status.Lights:True":
                    case "Status.Lights:False":
                        controller.PlayFileEffect("Vibrate.ffe", 750);
                        break;

                    case "Status.Hardpoints:True":
                    case "Status.Hardpoints:False":
                        controller.PlayFileEffect("Hardpoints.ffe", 1500);
                        break;

                    case "Status.CargoScoop:True":
                    case "Status.CargoScoop:False":
                        controller.PlayFileEffect("Cargo.ffe", 2000);
                        break;

                    case "Status.Landed:True":
                        controller.PlayFileEffect("Landed.ffe", 1000);
                        break;

                    case "Status.Docked:True":
                        controller.PlayFileEffect("Dock.ffe", 1000);
                        break;

                    case "Status.Overheating:True":
                        controller.PlayFileEffect("Vibrate.ffe", 750);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.LogError(ex.Message);
            }
        }
Esempio n. 2
0
        public static void Process(EliteAPI.Events.IEvent apiEvent, ILogger logger, ILogger inGameLogger)
        {
            try
            {
                var scanInfoEvent = apiEvent as EliteAPI.Events.ScanInfo;

                if (null != scanInfoEvent)
                {
                    Exploration.EliteActions.OutputValuableBody(scanInfoEvent, inGameLogger);
                }
            }
            catch (Exception ex)
            {
                logger.LogError(ex.Message);
            }
        }
Esempio n. 3
0
        public static void Process(EliteAPI.Events.IEvent apiEvent, ILogger logger, ILogger inGameLogger) // "InGame" Logger
        {
            try
            {
                logger.LogDebug($"{apiEvent.GetType().ToString()}");

                var startJumpEvent = apiEvent as EliteAPI.Events.StartJumpInfo;

                if (null != startJumpEvent)
                {
                    logger.LogDebug($"{startJumpEvent.JumpType} Jump Started: {startJumpEvent?.StarSystem}");

                    if (startJumpEvent.JumpType == "Hyperspace" && null != startJumpEvent?.StarSystem)
                    {
                        logger.LogDebug($"{startJumpEvent.JumpType} Jump Started: {startJumpEvent?.StarSystem}: Validated");

                        Task.Run(async() =>
                        {
                            var system = await EdsmConnector.Connector.GetSystem(startJumpEvent.StarSystem).ConfigureAwait(false);

                            logger.LogDebug($"System Received {system?.name}");

                            Exploration.EliteActions.OutputValuableSystems(system, inGameLogger);
                        }).ContinueWith(t =>
                        {
                            if (t.IsCanceled)
                            {
                                logger.LogError("JumpStarted Canceled");
                            }
                            else if (t.IsFaulted)
                            {
                                logger.LogError($"JumpStarted Exception: {t.Exception}");
                            }
                            else
                            {
                                logger.LogDebug("JumpStarted Event Complete");
                            }
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                logger.LogError(ex.Message);
            }
        }
        public static void Process(EliteAPI.Events.IEvent apiEvent, ILogger logger, ILogger inGameLogger)
        {
            try
            {
                logger.LogDebug($"{apiEvent.GetType().ToString()}");

                var allBodiesEvent = apiEvent as EliteAPI.Events.FSSAllBodiesFoundInfo;

                if (null != allBodiesEvent)
                {
                    logger.LogDebug($"All Found: {allBodiesEvent.SystemName}");

                    Task.Run(async() =>
                    {
                        var system = await EdsmConnector.Connector.GetSystem(allBodiesEvent.SystemName).ConfigureAwait(false);

                        logger.LogDebug($"System Received {system?.name}");

                        Exploration.EliteActions.OutputValuableSystems(system, inGameLogger);
                    }).ContinueWith(t =>
                    {
                        if (t.IsCanceled)
                        {
                            logger.LogError($"AllBodiesEvent Canceled");
                        }
                        else if (t.IsFaulted)
                        {
                            logger.LogError($"AllBodiesEvent Exception: {t.Exception}");
                        }
                        else
                        {
                            logger.LogDebug($"AllBodiesEvent Complete");
                        }
                    });
                }
            }
            catch (Exception ex)
            {
                logger.LogError(ex.Message);
            }
        }
Esempio n. 5
0
        private void Process(DDJSB2.PioneerDDJSB2 ddjsb2, EliteAPI.Events.IEvent statusEvent)
        {
            Logger.LogDebug($"{statusEvent.GetType()}");

            ddjsb2.LedControl(Leds.Deck.Deck1, Leds.PlayLed, false, GameService.GameStatusObservable.EliteAPI.Status.IsRunning);
        }
Esempio n. 6
0
 public static void Process(EliteAPI.Events.IEvent statusEvent, ILogger logger)
 {
     logger?.LogDebug($"{statusEvent.GetType()}");
 }