Пример #1
0
        public void Ready()
        {
            Thread.Sleep(1000);

            SetProgress("Starting EliteAPI ...");
            try
            {
                EliteAPI = new EliteDangerousAPI(EliteDangerousAPI.StandardDirectory, false);
                EliteAPI.Logger.UseLogFile(new DirectoryInfo(Directory.GetCurrentDirectory()));
                ThirdPartyWrapper wrapper = new ThirdPartyWrapper(EliteAPI, "EliteHook");
                EliteAPI.ChangeJournal(wrapper.GetJournalFolder("EliteHook.ini"));
                if (!Directory.Exists(EliteAPI.JournalDirectory.FullName) || EliteAPI.JournalDirectory.GetFiles("Journal.*.log").Count() == 0)
                {
                    SetProgress("Please set a custom Journal Path in EliteHook.ini"); Thread.Sleep(5000); Environment.Exit(-1);
                }
                EliteAPI.Start();
            }
            catch (Exception ex) { SetProgress("Error: " + ex.Message); Thread.Sleep(5000); Environment.Exit(-1); }
            if (!EliteAPI.IsRunning)
            {
                SetProgress("Could not start EliteAPI. See log files for more information");  Thread.Sleep(5000); Environment.Exit(-1);
            }

            SetProgress("Loading program ...");
            Main main = new Main(EliteAPI);

            main.FormClosed += Main_FormClosed;
            this.Invoke(new Action(() => this.Hide()));
            Application.Run(main);
        }
Пример #2
0
 void vmInterface.Init()
 {
     //Create new EliteAPI.
     EliteAPI = new EliteDangerousAPI(EliteDangerousAPI.StandardDirectory);
     //Create new Wrapper.
     Wrapper = new ThirdPartyWrapper(EliteAPI, DisplayName, $@"{vmCommand.GetDataDirectory()}\EliteMacro.ini");
     //Setup EliteAPI.
     EliteAPI.Logger.LogEvent += Logger_Log;
     EliteAPI.Logger.AddHandler(new LogFileHandler(Directory.GetCurrentDirectory(), "EliteAPI"));
     EliteAPI.ChangeJournal(Wrapper.GetJournalFolder());
     //Start the API.
     EliteAPI.Start(Wrapper.GetRichPresenceSetting());
     SetVariables(Wrapper.GetVariables());
     //Listen for events.
     EliteAPI.Events.AllEvent += Events_AllEvent;
 }
Пример #3
0
 public static void VA_Init1(dynamic vaProxy)
 {
     proxy = vaProxy;
     //Create new EliteAPI.
     EliteAPI = new EliteDangerousAPI(EliteDangerousAPI.StandardDirectory);
     //Create new Wrapper.
     Wrapper = new ThirdPartyWrapper(EliteAPI, VA_DisplayName(), $@"{Directory.GetCurrentDirectory()}\EliteVA.ini");
     //Setup EliteAPI.
     EliteAPI.Logger.LogEvent += Logger_Log;
     EliteAPI.Logger.AddHandler(new LogFileHandler(Wrapper.GetLogFolder().ToString(), "EliteAPI"));
     EliteAPI.ChangeJournal(Wrapper.GetJournalFolder());
     //Start the API.
     EliteAPI.Start(Wrapper.GetRichPresenceSetting());
     SetVariables(Wrapper.GetVariables());
     //Listen for events.
     EliteAPI.Events.AllEvent += Events_AllEvent;
 }
Пример #4
0
        void vmInterface.Init()
        {
            //Create new EliteAPI.
            EliteAPI = new EliteDangerousAPI(EliteDangerousAPI.StandardDirectory);

            //Create new Wrapper.
            Wrapper = new ThirdPartyWrapper(EliteAPI, DisplayName, $@"{vmCommand.GetDataDirectory()}\EliteMacro.ini");

            //Setup EliteAPI.
            EliteAPI.Logger.Log += Logger_Log;
            EliteAPI.Logger.UseLogFile(Wrapper.GetLogFolder().ToString());
            EliteAPI.ChangeJournal(Wrapper.GetJournalFolder());

            //Start the API.
            EliteAPI.Start();

            //Listen for events.
            EliteAPI.Events.AllEvent += Events_AllEvent;
        }