Пример #1
0
        public QuestorfrmMain()
        {
            if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "QuestorfrmMain", Logging.White);
            if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "InitializeComponent", Logging.White);
            InitializeComponent();
            if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "_questor = new Questor(this);", Logging.White);
            _questor = new Questor(this);
            if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "PopulateStateComboBoxes", Logging.White);
            PopulateStateComboBoxes();
            if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "PopulateBehaviorStateComboBox", Logging.White);
            PopulateBehaviorStateComboBox();
            if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "CreateLavishCommands", Logging.White);
            CreateLavishCommands();
            if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "this.Show();", Logging.White);
            Show();
            if (Settings.Instance.DebugAttachVSDebugger)
            {
                if (!System.Diagnostics.Debugger.IsAttached)
                {
                    //
                    // this is temporarily disabled as CCP is crazy and is now detecting that a debugger is attached (thinking it is a way to catch bots? no idea but odd)
                    //

                    //Logging.Log("QuestorUI", "VS Debugger is not yet attached: System.Diagnostics.Debugger.Launch()", Logging.Teal);
                    //System.Diagnostics.Debugger.Launch();
                }
            }
        }
Пример #2
0
        public frmMain()
        {
            InitializeComponent();

            foreach (var text in Enum.GetNames(typeof(DamageType)))
                DamageTypeComboBox.Items.Add(text);

            foreach (var text in Enum.GetNames(typeof(QuestorState)))
                QuestorStateComboBox.Items.Add(text);

            _questor = new Questor(this);
        }
Пример #3
0
        public frmMain()
        {
            InitializeComponent();

            foreach (var text in Enum.GetNames(typeof(DamageType)))
                DamageTypeComboBox.Items.Add(text);

            foreach (var text in Enum.GetNames(typeof(QuestorState)))
                QuestorStateComboBox.Items.Add(text);

            _questor = new Questor();

            LavishScript.Commands.AddCommand("SetAutoStart", SetAutoStart);
            LavishScript.Commands.AddCommand("SetDisable3D", SetDisable3D);
            LavishScript.Commands.AddCommand("SetExitWhenIdle", SetExitWhenIdle);
        }
Пример #4
0
        public frmMain()
        {
            InitializeComponent();

            foreach (var text in Enum.GetNames(typeof(DamageType)))
            {
                DamageTypeComboBox.Items.Add(text);
            }

            foreach (var text in Enum.GetNames(typeof(QuestorState)))
            {
                QuestorStateComboBox.Items.Add(text);
            }

            _questor = new Questor();
        }
Пример #5
0
        public frmMain()
        {
            InitializeComponent();

            foreach (var text in Enum.GetNames(typeof(DamageType)))
            {
                DamageTypeComboBox.Items.Add(text);
            }

            foreach (var text in Enum.GetNames(typeof(QuestorState)))
            {
                QuestorStateComboBox.Items.Add(text);
            }

            _questor = new Questor(this);

            LavishScript.Commands.AddCommand("SetAutoStart", SetAutoStart);
            LavishScript.Commands.AddCommand("SetDisable3D", SetDisable3D);
            LavishScript.Commands.AddCommand("SetExitWhenIdle", SetExitWhenIdle);
        }
Пример #6
0
 //private DateTime _nextWreckUpdate = DateTime.Now;
 public QuestorfrmMain()
 {
     if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "QuestorfrmMain", Logging.White);
     if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "InitializeComponent", Logging.White);
     InitializeComponent();
     if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "_questor = new Questor(this);", Logging.White);
     _questor = new Questor(this);
     if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "PopulateStateComboBoxes", Logging.White);
     PopulateStateComboBoxes();
     if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "PopulateBehaviorStateComboBox", Logging.White);
     PopulateBehaviorStateComboBox();
     if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "CreateLavishCommands", Logging.White);
     CreateLavishCommands();
     if (Settings.Instance.DebugUI) Logging.Log("QuestorUI", "this.Show();", Logging.White);
     Show();
     if (Settings.Instance.DebugAttachVSDebugger)
     {
         if (!System.Diagnostics.Debugger.IsAttached)
         {
             Logging.Log("QuestorUI", "VS Debugger is not yet attached: System.Diagnostics.Debugger.Launch()", Logging.Teal);
             System.Diagnostics.Debugger.Launch();
         }
     }
 }
Пример #7
0
        public static void Main(string[] args)
        {
            //if (Logging.DebugPreLogin)
            //{
            //    int i = 0;
            //    foreach (string arg in args)
            //    {
            //        Logging.Log("Startup", " *** Questor Parameters we have parsed [" + i + "] - [" + arg + "]", Logging.Debug);
            //        i++;
            //    }
            //}

            ParseArgs(args);
            if (LoginToEVE.OptionallyLoadPreLoginSettingsFromIni(args))
            {
                Logging.Log("Startup:", "OptionallyLoadPreLoginSettingsFromINI was true", Logging.Debug);
            }
            else
            {
                Logging.Log("Startup:", "OptionallyLoadPreLoginSettingsFromINI was false!", Logging.Debug);
            }

            //Logging.Log("Startup:", "OptionallyLoadPreLoginSettingsFromINI is done", Logging.Debug);

            //
            // Wait to login based on schedule info from schedules.xml
            //
            if (LoginToEVE.ChantlingScheduler && !string.IsNullOrEmpty(Logging.MyCharacterName))
            {
                LoginToEVE.WaitToLoginUntilSchedulerSaysWeShould();
            }

            //
            // direct login, no schedules.xml
            //
            if (!string.IsNullOrEmpty(Logging.GameLoginUserName) && !string.IsNullOrEmpty(Logging.GameLoginPassword) && !string.IsNullOrEmpty(Logging.MyCharacterName))
            {
                LoginToEVE.ReadyToLoginToEveAccount = true;
            }

            //if (!LoginToEVE.LoadEveComInstance()) return;

            Time.Instance.LoginStarted_DateTime = DateTime.UtcNow;

            if (!Logging.DebugDisableAutoLogin)
            {
                try
                {
                    EveCom.EVEFrame.OnFrame += LoginToEVE.LoginOnFrame;
                    LoginToEVE.UseLoginOnFrameEvent = true;
                }
                catch (Exception ex)
                {
                    Logging.Log("Startup", "EVECom.OnFrame: Exception [" + ex + "]", Logging.White);
                }

                // Sleep until we're loggedInAndreadyToStartQuestorUI
                while (LoginToEVE.UseLoginOnFrameEvent)
                {
                    System.Threading.Thread.Sleep(50); //this runs while we wait to login
                }

                try
                {
                    Logging.Log("Startup", "We are logged into EVE: unRegistering LoginOnFrame Event", Logging.Teal);
                    EveCom.EVEFrame.OnFrame -= LoginToEVE.LoginOnFrame;
                    LoginToEVE.StartTime = DateTime.Now;
                    LoginToEVE.DoneLoggingInToEveTimeStamp = DateTime.UtcNow;
                }
                catch (Exception ex)
                {
                    Logging.Log("Startup", "EveCom.EVEFrame.OnFrame: Exception [" + ex + "]", Logging.White);
                }

                while (DateTime.UtcNow < LoginToEVE.DoneLoggingInToEveTimeStamp.AddSeconds(2)) //wait a few seconds
                {
                    Logging.Log("Startup", "Waiting a few seconds before launching Questor", Logging.White);
                    System.Threading.Thread.Sleep(1500); //this runs while we wait for the LoginOnframe Event to unregister
                }

                // If the last parameter is false, then we only auto-login
                if (LoginToEVE.LoginOnly)
                {
                    Logging.Log("Startup", "_loginOnly: done and exiting", Logging.Teal);
                    return;
                }

                //
                // We should only get this far if run if we are already logged in...
                // launch questor
                //
                try
                {
                    Logging.Log("Startup", "Launching Questor", Logging.Teal);
                    _questor = new Questor();

                    int intdelayQuestorUserInterface = 0;
                    while (intdelayQuestorUserInterface < 200) //10sec = 200ms x 50
                    {
                        intdelayQuestorUserInterface++;
                        System.Threading.Thread.Sleep(50);
                    }

                    Logging.Log("Startup", "Launching QuestorUI", Logging.Teal);
                    Application.Run(new QuestorUI());

                    while (!Cleanup.SignalToQuitQuestor)
                    {
                        System.Threading.Thread.Sleep(50); //this runs while questor is running.
                    }

                    Logging.Log("Startup", "Exiting Questor", Logging.Teal);

                }
                catch (Exception ex)
                {
                    Logging.Log("Startup", "Exception [" + ex + "]", Logging.Teal);
                }
                finally
                {
                    Cleanup.BeginClosingQuestor();
                    AppDomain.Unload(AppDomain.CurrentDomain);
                }
            }
            else
            {
                Logging.Log("Startup", "DebugDisableAutoLogin is true (check characters prelogin settings ini), closing before doing anything useful!", Logging.Debug);
                //Cache.Instance.EveCom.Dispose();
            }
        }