Пример #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            try
            {
                AppConfig config = new AppConfig
                {
                    Configuration = (App)App.Current
                };

                MoonlightAPI api = new MoonlightAPI(config)
                {
                    Language = Language.EN
                };


                api.AllocConsole();


                api.DeferPackets();

                BotWindow bot = new BotWindow()
                {
                    DataContext = api.Services.GetService <BotWindowViewModel>()
                };

                bot.Show();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            try // prevent whole process crash on exception
            {
                AppConfig config = new AppConfig
                {
                    Configuration = (App)App.Current
                };

                MoonlightAPI api = new MoonlightAPI(config)
                {
                    Language = Language.CZ
                };

#if DEBUG
                api.AllocConsole();
#endif

                api.DeferPackets();      // handle packets in separate thread to prevent slowing down NosTale
                                         // this is useful if you don't need to modify or cancel packets...
                                         // and if you don't need 'to send packets at precise time right after particular packet etc.
                                         // to disable this use api.SyncPackets(); that is the default behavior

                api.CreateLocalClient(); // creates local client so it will be middleware for real game packet send/receive

                MoonlightMainWindow nosDamage = new MoonlightMainWindow
                {
                    DataContext = api.Services.GetService <MoonlightMainViewModel>()
                };

                nosDamage.Show();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }