Ejemplo n.º 1
0
        /// <summary>
        /// The main entry point.
        /// </summary>
        public static async Task <int> Main(string[] args)
        {
            ILogger logger = GetProgramLogger(args);

            try
            {
                // configure ServicePointManager before making any network requests
                ServicePointManagerConfiguration.Configure(logger);
                ThreadPoolConfiguration.Configure(logger);

                // create the host
                IHost host = CreateHostBuilder(args).Build();

                // try to load all the access tokens on startup
                await GetAccessTokensAsync(logger, host.Services);

                logger.Information("Starting web host");
                await host.RunAsync();

                return(0);
            }
            catch (Exception ex)
            {
                logger.Fatal(ex, "Web host terminated unexpectedly");
                return(1);
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }
Ejemplo n.º 2
0
        public static void Main()
        {
            try
            {
                ThreadPoolConfiguration.Init();

                using (var container = new DependencyInjectionContainer())
                {
                    var gameApp = container.Resolve <GameApp>();
                    gameApp.Run();
                }
            }
            catch (Exception ex)
            {
                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }

                MessageBox.Show(ex.ToString(), "CubeHack", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
 static Universe()
 {
     ThreadPoolConfiguration.Init();
 }
Ejemplo n.º 4
0
 static GameHost()
 {
     ThreadPoolConfiguration.Init();
 }