Пример #1
0
        static void Main(string[] args)
        {
            ConsoleUtilities.DeleteMenu(ConsoleUtilities.GetSystemMenu(ConsoleUtilities.GetConsoleWindow(), false), ConsoleUtilities.SC_CLOSE, ConsoleUtilities.MF_BYCOMMAND);
            consoleHandler = new ConsoleUtilities.HandlerRoutine(ConsoleCtrlCheck);
            ConsoleUtilities.SetConsoleCtrlHandler(consoleHandler, true);

            ConfigureLogging();

            X509Certificate  x509Certificate  = Assembly.GetEntryAssembly().GetModules()[0].GetSignerCertificate();
            X509Certificate2 x509Certificate2 = x509Certificate != null ? new X509Certificate2(x509Certificate) : null;
            var signTool = new SignTool(x509Certificate2);

            if (x509Certificate2 == null || x509Certificate2.GetCertHashString() != "793D48CE7A9DDC71CE8A31E0929D215165FA9B8E")
            {
                logger.Fatal("Certificate is missing or could not be verified.");
                logger.Info("Certificate Hash: ", x509Certificate2?.GetCertHashString());
                Console.ReadLine();
                return;
            }

            CreateServer();
            StartServer();

            gameCore.StartCommandInputThread(true);
        }