Example #1
0
        public FirstMate(ShipLocator lm)
        {
            logmon = lm;

            lm.EnterStarSystem += OnEnterSystem;
            lm.BeginDocking += OnDockingRequestGranted;
            lm.FoundCommander += OnFoundCommander;
            logmon.Update();
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();

            MainBrowser.LoadCompleted += MainBrowser_LoadCompleted;
            this.Closing += MainWindow_Closing;

            var sl = new ShipLocator();
            Mate = new FirstMate(sl);

            Mate.StarSystemEntered += (name, id, url) =>
            {
                UpdateBrowser(name, url);
            };

            Mate.Start();

            ThreadPool.QueueUserWorkItem((x) =>
            {
                var last_system = BosunConfiguration.Read("lastsystem", "Sol");
                var last_url = Mate.GetEDDBSystemUrl(last_system);
                UpdateBrowser(last_system, last_url);
            });
        }
Example #3
0
        static void Main(string[] args)
        {
            foreach (var help in new string[] { "-h", "--help", "/?", "/help" })
            {
                if (args.Contains(help))
                {
                    Console.WriteLine("Usage: bosunconsole PATH_TO_ED_FOLDER");
                    Console.ReadKey();
                    return;
                }
            }

            if ((args.Length > 0) && Directory.Exists(args[0]))
            {
                ShipLocator.OverrideEDFolder(args[0]);
            }

            LogMessage("Bosun starting up..");

            var eddir = ShipLocator.GetLogFolder();

            if (eddir == null)
            {
                LogMessage("waiting for ED to start..");
            }

            do
            {
                Thread.Sleep(5000);
                eddir = ShipLocator.GetLogFolder();
            } while (eddir == null);

            LogMessage("Using {0} for logs", eddir);

            var sl = new ShipLocator();

            if (!sl.CheckAppConfigXml(false))
            {
                LogMessage("{0}/{1} VerboseLogging not enabled. Please fix and restart Elite: Dangerous",
                    eddir, "appconfig.xml");
            }

            LogMessage("Appointing First Mate..");
            var bc = new BosunCore.FirstMate(sl);

            if (bc.CommanderName != null)
            {
                bc_FoundCommander(bc.CommanderName);
            }

            if (bc.LastSystemName != null)
            {
                long sysid;
                LogMessage("Bosun Ready, last recorded system is {0}", bc.LastSystemName);
                if (bc.LookupEDDBSystemID(bc.LastSystemName, out sysid))
                {
                    LogMessage("EDDB: http://eddb.io/system/{0} - {1}", sysid, bc.LastSystemName);
                }
            }

            bc.FoundCommander += bc_FoundCommander;
            bc.StarSystemEntered += sl_EnterStarSystem;
            bc.DockingRequestGranted += bc_DockingRequestGranted;

            bc.Start();

            LogMessage("First Mate has appointed a Watch Keeper for port {0}",
                bc.WatchKeeperPort);

            while (true)
            {
                bc.Wait();
            }
        }