/// <summary> /// The main entry point for the application /// </summary> public async Task LaunchBot() { CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture; if (!Injected) { await CheckAndInject(); Environment.Exit(0); } else { "Injected!!".Log(Logs.Injected); AppDomain.CurrentDomain.UnhandledException += (sender, args) => { MessageBox.Show("A exception occured! The details were logged"); args.ExceptionObject.ToString().Log(Logs.Exceptions, false); }; AppDomain.CurrentDomain.AssemblyResolve += DependencyLoader.CurrentDomain_AssemblyResolve; #if DEBUG Debugger.Launch(); WinImports.AllocConsole(); DebugAssist.Init(); #endif await SetRealmlist(); try { $"Enabling the login block until the user authenticates".Log(Logs.Injected, true); LoginBlock.Enable(); Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; //$"Bringing up the login window".Log(Logs.Injected, true); //var authenticationView = new AuthenticationView(); //authenticationView.ShowDialog(); //var authenticationModel = (AuthenticationViewModel)authenticationView.DataContext; //if (authenticationModel.Result == null || authenticationModel.Result.Value != DialogResult.OK) //Environment.Exit(0); $"Initialising the bot".Log(Logs.Injected, true); Memory.Init(); $"Disabling the login block".Log(Logs.Injected, true); LoginBlock.Disable(); $"Showing the bots mainwindow".Log(Logs.Injected, true); var mainView = new MainView(); Current.MainWindow = mainView; mainView.Closed += (sender, args) => { Environment.Exit(0); }; mainView.Show(); } catch (Exception e) { e.ToString().Log(Logs.Exceptions); } } }
/// <summary> /// The main entry point for the application. /// </summary> private static void LaunchBot() { SetPaths(); CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture; if (!AreWeInjected) { LogFiles.PreInjectLog.ClearLog(); LogFiles.QuitLog.ClearLog(); LogFiles.InjectedLog.ClearLog(); "We are not injected yet".Log(LogFiles.PreInjectLog); PrepareAndInject(); Environment.Exit(0); } else { AppDomain.CurrentDomain.UnhandledException += (sender, args) => { MessageBox.Show("A exception occured! The details were logged"); args.ExceptionObject.ToString().Log(LogFiles.Exceptions, false); }; AppDomain.CurrentDomain.AssemblyResolve += DependencyLoader.CurrentDomain_AssemblyResolve; #if DEBUG Debugger.Launch(); WinImports.AllocConsole(); DebugAssist.Init(); #endif SetRealmlist(); try { $"Enabling the login block until the user authenticates".Log(LogFiles.InjectedLog, true); LoginBlock.Enable(); Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; $"Bringing up the login window".Log(LogFiles.InjectedLog, true); var loginWindow = new LoginWindow(); loginWindow.ShowDialog(); var loginModel = (LoginViewModel)loginWindow.DataContext; if (loginModel.Result == null || loginModel.Result.Value != DialogResult.OK) { Environment.Exit(0); } $"Initialising the bot".Log(LogFiles.InjectedLog, true); Memory.Init(); $"Disabling the login block".Log(LogFiles.InjectedLog, true); LoginBlock.Disable(); $"Showing the bots mainwindow".Log(LogFiles.InjectedLog, true); var mainWindow = new MainWindow(); Current.MainWindow = mainWindow; mainWindow.Closed += (sender, args) => { Environment.Exit(0); }; mainWindow.Show(); } catch (Exception e) { e.ToString().Log(LogFiles.Exceptions); } } }
internal void EndLaunchPrepare() { CCManager.LoadCCs(); Memory.Init(); OptionManager.LoadSettings(); Enums.DynamicFlags.AdjustToRealm(); MainForm.Enabled = true; ChatHook.OnNewChatMessage += updateChat; LoginBlock.Disable(); }
internal void EndLaunchPrepare() { Memory.Init(); SettingsManager.LoadSettings(); CCManager.LoadCCs(); #region set wow & bot window location and size Helpers.WindowInteraction.SetWowWindow(); Helpers.WindowInteraction.SetBotWindow(); #endregion #region setup world render minimize if enabled in settings if (Settings.Settings.MinimizeWorldRender) { Hack renderWorld = HookWardenMemScan.GetHack("RenderWorlObjectsPatch"); //setup render world patch if unknown to us if (renderWorld == null) { var RenderWorldPatch = new Hack(ZzukBot.Constants.Offsets.Hacks.RenderDisable, new byte[] { 0x00 }, "RenderWorlObjectsPatch"); HookWardenMemScan.AddHack(RenderWorldPatch); renderWorld = HookWardenMemScan.GetHack("RenderWorlObjectsPatch"); } if (!renderWorld.IsActivated && Settings.Settings.MinimizeWorldRender) { renderWorld.Apply(); } } #endregion IrcMonitor.Instance.MessageReceived += ChannelMessageRecieved; GuiCore.SettingsForm.SetupIrc(); Enums.DynamicFlags.AdjustToRealm(); GuiCore.MainForm.Enabled = true; ChatHook.OnNewChatMessage += updateChat; LoginBlock.Disable(); }
internal void EndLaunchPrepare() { CCManager.LoadCCs(); Memory.Init(); OptionManager.LoadSettings(); try { using (var wc = new WebClient()) { MainForm.rtbNews.Text = wc.DownloadString("http://zzukbot.com/Hk3VEXpjfj8K/Important.txt"); } } catch { MainForm.rtbNews.Text = "Error while fetching news"; } IrcMonitor.Instance.MessageReceived += ChannelMessageRecieved; SetupIrc(); Enums.DynamicFlags.AdjustToRealm(); MainForm.Enabled = true; ChatHook.OnNewChatMessage += updateChat; LoginBlock.Disable(); }