public OmniEveUI(OmniEve omniEve) { _omniEve = omniEve; InitializeComponent(); Logging.TextBoxWriter = new TextBoxWriter(logTextBox); }
public static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ParseArgs(args); // This has to come after parsing the args, otherwise we won't get the correct ini file LoadPreLoginSettingsFromINI(); if (!string.IsNullOrEmpty(Logging.EVELoginUserName) && !string.IsNullOrEmpty(Logging.EVELoginPassword) && !string.IsNullOrEmpty(Logging.MyCharacterName)) { _readyToLoginToEVEAccount = true; } #region Load DirectEVE // // Load DirectEVE // try { bool EasyHookExists = File.Exists(System.IO.Path.Combine(Logging.PathToCurrentDirectory, "EasyHook.dll")); if (!EasyHookExists && !_missingEasyHookWarningGiven) { Logging.Log("Program:Main", "EasyHook DLL's are missing. Please copy them into the same directory as your questor.exe", Logging.Orange); Logging.Log("Program:Main", "halting!", Logging.Orange); _missingEasyHookWarningGiven = true; return; } int TryLoadingDirectEVE = 0; while (Cache.Instance.DirectEve == null && TryLoadingDirectEVE < 30) { // // DE now has cloaking enabled using EasyHook, If EasyHook DLLs are missing DE should complain. We check for and complain about missing EasyHook stuff before we get this far. // // //Logging.Log("Program:Startup", "temporarily disabling the loading of DE for debugging purposes, halting", Logging.Debug); //while (Cache.Instance.DirectEve == null) //{ // System.Threading.Thread.Sleep(50); //this pauses forever... //} try { Logging.Log("Program:Main", "Starting Instance of DirectEVE using StandaloneFramework", Logging.Debug); Cache.Instance.DirectEve = new DirectEve(new StandaloneFramework()); TryLoadingDirectEVE++; Logging.Log("Program:Main", "DirectEVE should now be active: see above for any messages from DirectEVE", Logging.Debug); } catch (Exception exception) { Logging.Log("Program:Main", "exception [" + exception + "]", Logging.Orange); return; } } } catch (Exception exception) { Logging.Log("Program:Main", "exception [" + exception + "]", Logging.Orange); return; } if (Cache.Instance.DirectEve == null) { try { Logging.Log("Program:Main", "Error on Loading DirectEve, maybe server is down", Logging.Orange); return; } catch (Exception exception) { Logging.BasicLog("Program:Main", "Exception while logging exception, oh joy [" + exception + "]"); return; } } #endregion Load DirectEVE try { Cache.Instance.DirectEve.OnFrame += LoginOnFrame; } catch (Exception ex) { Logging.Log("Program:Main", string.Format("DirectEVE.OnFrame: Exception {0}...", ex), Logging.White); } // Sleep until we're LoggedInAndReady while (!_loggedInAndReady) { System.Threading.Thread.Sleep(50); //this runs while we wait to login } if (_loggedInAndReady) { try { Cache.Instance.DirectEve.OnFrame -= LoginOnFrame; } catch (Exception ex) { Logging.Log("Program:Main", "DirectEVE.Dispose: Exception [" + ex + "]", Logging.White); } // If the last parameter is false, then we only auto-login if (_loginOnly) { Logging.Log("Program:Main", "LoginOnly: done and exiting", Logging.Teal); return; } StartTime = DateTime.Now; // // We should only get this far if run if we are already logged in... // launch questor // try { Logging.Log("Program:Main", "We are logged in.", Logging.Teal); Logging.Log("Program:Main", "Launching OmniEve", Logging.Teal); _omniEve = new OmniEve(); int intdelayOmniEveUI = 0; while (intdelayOmniEveUI < 50) //2.5sec = 50ms x 50 { intdelayOmniEveUI++; System.Threading.Thread.Sleep(50); } Logging.Log("Program:Main", "Launching OmniEveUI", Logging.Teal); Automation automation = new Automation(); _omniEve.RunScript(automation); //Application.Run(new OmniEveUI(_omniEve)); while (_omniEve.State != OmniEveModules.States.OmniEveState.CloseOmniEve) { System.Threading.Thread.Sleep(50); //this runs while omniEve is running. } Logging.Log("Program:Main", "Exiting OmniEve", Logging.Teal); } catch (Exception ex) { Logging.Log("Program:Main", "Exception [" + ex + "]", Logging.Teal); } finally { //Cleanup.DirecteveDispose(); AppDomain.Unload(AppDomain.CurrentDomain); } } }