private static int ParsedMain(bool useSsl, bool useCertStore, string certID, string pass)
        {
            RWLockLevels = new ReaderWriterLockSlim();
            RWLockLevels.AddTag("RWLS_Levels");
            RWLockTeams = new ReaderWriterLockSlim();
            RWLockTeams.AddTag("RWLS_Teams");

            Levels = new List <Level>();
            Teams  = new List <Team>();

            DataLogger = new Datalogger(Path.Combine(AppPath, "DataLogs", DateTime.Now.ToString("yyyyMMdd_HHmmss")));

            var port = 80;
            X509Certificate2 cert = null;

            if (useSsl)
            {
                if (useCertStore)
                {
                    cert = GetCertificateFromStore(certID);
                }
                else
                {
                    cert = new X509Certificate2(certID, pass);
                }
                port = 443;
            }

            GameTitle = "LevelScore Display";

            try
            {
                using (var host = CreateWebHostBuilder(IPAddress.Any, port, useSsl, cert).Build()) //.Run();
                {
                    ServiceProvider = host.Services;

                    StartTime = DateTime.Now.Ticks;
                    var task = host.RunAsync();

                    var url = (useSsl ? "https" : "http") + "://localhost/";
                    var ps1 = new ProcessStartInfo(url)
                    {
                        UseShellExecute = true,
                        Verb            = "open"
                    };
                    //Process.Start(ps1);
                    var ps2 = new ProcessStartInfo(url + "admin/")
                    {
                        UseShellExecute = true,
                        Verb            = "open"
                    };
                    //Process.Start(ps2);

                    task.Wait();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Could not use specified configuration. Using fallback at localhost:5000");
                Console.WriteLine(e.ToString());
                CreateWebHostBuilder(IPAddress.Loopback, 5000, false, null).Build().Run();
            }

            return(0);
        }