Пример #1
0
        static void Main(string[] args) {

            int iValue;
            if (args != null && args.Length >= 2) {
                for (int i = 0; i < args.Length; i = i + 2) {
                    if (String.Compare("-use_core", args[i], true) == 0 && int.TryParse(args[i + 1], out iValue) == true && iValue > 0) {
                        System.Diagnostics.Process.GetCurrentProcess().ProcessorAffinity = (System.IntPtr)iValue;
                    }
                }
            }

            PRoConApplication application = null;

            if (PRoConApplication.IsProcessOpen() == false) {
                try {
                    application = new PRoConApplication(true, args);

                    // Note: The license states usage data must be enabled for procon.console.exe support
                    application.OptionsSettings.AllowAnonymousUsageData = true;

                    System.Console.WriteLine("Procon Frostbite");
                    System.Console.WriteLine("================");
                    System.Console.WriteLine("By executing this application you agree to the license available at:");
                    System.Console.WriteLine("\thttp://myrcon.com/licenses/myrcon.pdf");
                    System.Console.WriteLine("If you do not agree you must immediately exit this application.");
                    System.Console.WriteLine("================");
                    System.Console.WriteLine("This is a cut down version of PRoCon.exe to be used by GSPs and PRoCon Hosts.");
                    System.Console.WriteLine("Executing this file is the same as \"PRoCon.exe -console 1\"");
                    System.Console.WriteLine("No output is given.  This is as cut down as we're gunno get..");
                    System.Console.WriteLine("\nExecuting procon...");
                    application.Execute();

                    GC.Collect();
                    System.Console.WriteLine("Running... (Press any key to shutdown)");
                    System.Console.ReadKey();
                }
                catch (Exception e) {
                    FrostbiteConnection.LogError("PRoCon.Console.exe", "", e);
                }
                finally {
                    if (application != null) {
                        application.Shutdown();
                    }
                }

            }
            else {
                // Possible prevention of a cpu consumption bug I can see at the time of writing.
                // TCAdmin: Start procon.exe
                // procon.exe has an update to install
                // procon.exe loads proconupdater.exe
                // procon.exe unloads
                // proconupdater.exe begins update
                // TCAdmin detects procon.exe shutdown - attempts to reload
                System.Console.WriteLine("Already running - shutting down");
                Thread.Sleep(50);
            }

        }
Пример #2
0
        static void Main(string[] args)
        {
            PRoConApplication application = null;

            if (PRoConApplication.IsProcessOpen() == false)
            {
                try {
                    application = new PRoConApplication(true, args);

                    // Note: The license states usage data must be enabled for procon.console.exe support
                    application.OptionsSettings.AllowAnonymousUsageData = true;

                    System.Console.WriteLine("Procon Frostbite");
                    System.Console.WriteLine("================");
                    System.Console.WriteLine("By executing this application you agree to the license available at:");
                    System.Console.WriteLine("\thttp://myrcon.com/licenses/myrcon.pdf");
                    System.Console.WriteLine("If you do not agree you must immediately exit this application.");
                    System.Console.WriteLine("================");
                    System.Console.WriteLine("This is a cut down version of PRoCon.exe to be used by GSPs and PRoCon Hosts.");
                    System.Console.WriteLine("Executing this file is the same as \"PRoCon.exe -console 1\"");
                    System.Console.WriteLine("No output is given.  This is as cut down as we're gunno get..");
                    System.Console.WriteLine("\nExecuting procon...");
                    application.Execute();

                    GC.Collect();
                    System.Console.WriteLine("Running... (Press any key to shutdown)");
                    System.Console.ReadKey();
                }
                catch (Exception e) {
                    FrostbiteConnection.LogError("PRoCon.Console.exe", "", e);
                }
                finally {
                    if (application != null)
                    {
                        application.Shutdown();
                    }
                }
            }
            else
            {
                // Possible prevention of a cpu consumption bug I can see at the time of writing.
                // TCAdmin: Start procon.exe
                // procon.exe has an update to install
                // procon.exe loads proconupdater.exe
                // procon.exe unloads
                // proconupdater.exe begins update
                // TCAdmin detects procon.exe shutdown - attempts to reload
                System.Console.WriteLine("Already running - shutting down");
                Thread.Sleep(50);
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            PRoConApplication application = null;

            if (PRoConApplication.IsProcessOpen() == false) {
                try {
                    application = new PRoConApplication(true, args);

                    System.Console.WriteLine("PRoCon Frostbite");
                    System.Console.WriteLine("================");
                    System.Console.WriteLine("This is a cut down version of PRoCon.exe to be used by GSPs and PRoCon Hosts.");
                    System.Console.WriteLine("Executing this file is the same as \"PRoCon.exe -console 1\"");
                    System.Console.WriteLine("No output is given.  This is as cut down as we're gunno get..");
                    System.Console.WriteLine("\nExecuting procon...");
                    application.Execute();

                    GC.Collect();
                    System.Console.WriteLine("Running... (Press any key to shutdown)");
                    System.Console.ReadKey();
                }
                catch (Exception e) {
                    FrostbiteConnection.LogError("PRoCon.Console.exe", "", e);
                }
                finally {
                    if (application != null) {
                        application.Shutdown();
                    }
                }

            }
            else {
                // Possible prevention of a cpu consumption bug I can see at the time of writing.
                // TCAdmin: Start procon.exe
                // procon.exe has an update to install
                // procon.exe loads proconupdater.exe
                // procon.exe unloads
                // proconupdater.exe begins update
                // TCAdmin detects procon.exe shutdown - attempts to reload
                System.Console.WriteLine("Already running - shutting down");
                Thread.Sleep(50);
            }
        }
Пример #4
0
 protected override void OnStart(string[] args)
 {
     //Setting the Evironment back to the Basedirectory
     //because Windows changes it to c://windows/system32 when running as service.
     Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
     System.Console.WriteLine(Environment.CurrentDirectory);
     if (PRoConApplication.IsProcessOpen() == false)
     {
         try
         {
             application = new PRoConApplication(true, args);
             // Note: The license states usage data must be enabled for procon.console.exe support
             application.OptionsSettings.AllowAnonymousUsageData = true;
             application.Execute();
             GC.Collect();
         }
         catch (Exception e)
         {
             FrostbiteConnection.LogError("PRoCon.Service.exe", "", e);
         }
     }
 }
Пример #5
0
        protected override void OnStart(string[] args)
        {
            //Setting the Evironment back to the Basedirectory
            //because Windows changes it to c://windows/system32 when running as service.
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
            System.Console.WriteLine(Environment.CurrentDirectory);

            int iValue;

            if (args != null && args.Length >= 2)
            {
                for (int i = 0; i < args.Length; i = i + 2)
                {
                    if (String.Compare("-use_core", args[i], true) == 0 && int.TryParse(args[i + 1], out iValue) == true && iValue > 0)
                    {
                        System.Diagnostics.Process.GetCurrentProcess().ProcessorAffinity = (System.IntPtr)iValue;
                    }
                }
            }

            if (PRoConApplication.IsProcessOpen() == false)
            {
                try
                {
                    application = new PRoConApplication(true, args);
                    // Note: The license states usage data must be enabled for procon.console.exe support
                    //application.OptionsSettings.AllowAnonymousUsageData = true;
                    application.Execute();
                    GC.Collect();
                }
                catch (Exception e)
                {
                    FrostbiteConnection.LogError("PRoCon.Service.exe", "", e);
                }
            }
        }
Пример #6
0
        static void Main(string[] args)
        {
            int iValue;

            if (args != null && args.Length >= 2)
            {
                for (int i = 0; i < args.Length; i = i + 2)
                {
                    if (String.Compare("-use_core", args[i], true) == 0 && int.TryParse(args[i + 1], out iValue) == true && iValue > 0)
                    {
                        System.Diagnostics.Process.GetCurrentProcess().ProcessorAffinity = (System.IntPtr)iValue;
                    }
                }
            }

            PRoConApplication application = null;

            if (PRoConApplication.IsProcessOpen() == false)
            {
                try
                {
                    application = new PRoConApplication(true, args);

                    System.Console.WriteLine("Procon Frostbite");
                    System.Console.WriteLine("================");
                    System.Console.WriteLine("By executing this application you agree to the license available at:");
                    System.Console.WriteLine("\thttps://myrcon.net/licenses/myrcon.pdf");
                    System.Console.WriteLine("If you do not agree you must immediately exit this application.");
                    System.Console.WriteLine("================");
                    System.Console.WriteLine("This is a cut down version of PRoCon.exe to be used by GSPs and PRoCon Hosts.");
                    System.Console.WriteLine("Executing this file is the same as \"PRoCon.exe -console 1\"");
                    System.Console.WriteLine("No output is given.  This is as cut down as we're gunno get..");
                    System.Console.WriteLine("\nExecuting procon...");
                    application.Execute();

                    GC.Collect();
                    System.Console.WriteLine("Running... (Press any key to shutdown)");
                    System.Console.ReadKey();
                }
                catch (Exception e)
                {
                    FrostbiteConnection.LogError("PRoCon.Console.exe", "", e);
                }
                finally
                {
                    if (application != null)
                    {
                        application.Shutdown();
                    }
                }
            }
            else
            {
                // Possible prevention of a cpu consumption bug I can see at the time of writing.
                // TCAdmin: Start procon.exe
                // procon.exe has an update to install
                // procon.exe loads proconupdater.exe
                // procon.exe unloads
                // proconupdater.exe begins update
                // TCAdmin detects procon.exe shutdown - attempts to reload
                System.Console.WriteLine("Already running - shutting down");
                Thread.Sleep(50);
            }
        }
Пример #7
0
        static void Main(string[] args) {

            PRoConApplication application = null;

            if (PRoConApplication.IsProcessOpen() == false) {
                try {
                    application = new PRoConApplication(true, args);

                    // Note: The license states usage data must be enabled for procon.console.exe support
                    application.OptionsSettings.AllowAnonymousUsageData = true;

                    System.Console.WriteLine("Procon Frostbite for mono");
                    System.Console.WriteLine("=========================");
                    System.Console.WriteLine("By executing this application you agree to the license available at:");
                    System.Console.WriteLine("\thttp://myrcon.com/licenses/myrcon.pdf");
                    System.Console.WriteLine("If you do not agree you must immediately exit this application.");
                    System.Console.WriteLine("================");
                    System.Console.WriteLine("This is a cut down version of PRoCon.exe to be used by GSPs and PRoCon Hosts.");
                    System.Console.WriteLine("Executing this file is the same as \"PRoCon.exe -console 1\"");
                    System.Console.WriteLine("No output is given.  This is as cut down as we're gunno get..");
                    System.Console.WriteLine("\nExecuting procon...");
                    application.Execute();

                    GC.Collect();
                    System.Console.WriteLine("Running... (Press ctrl-c to shutdown)");
					
					UnixSignal [] signals = new UnixSignal[] { 
						new UnixSignal(Signum.SIGINT), 
						new UnixSignal(Signum.SIGTERM), 
					};
			
					// Wait for a unix signal
                    for (bool exit = false; !exit; )
                    {
                        try
                        {

                            int id = UnixSignal.WaitAny(signals);

                            if (id >= 0 && id < signals.Length)
                            {
                                if (signals[id].IsSet) exit = true;
                            }
                        }
                        catch (Exception e)
                        {
                            FrostbiteConnection.LogError("PRoCon.Console.exe", "", e);
                        }
                    }
                }
                catch (Exception e) {
                    FrostbiteConnection.LogError("PRoCon.Console.exe", "", e);
                }
                finally {
                    if (application != null) {
                        application.Shutdown();
                    }
                }

            }
            else {
                // Possible prevention of a cpu consumption bug I can see at the time of writing.
                // TCAdmin: Start procon.exe
                // procon.exe has an update to install
                // procon.exe loads proconupdater.exe
                // procon.exe unloads
                // proconupdater.exe begins update
                // TCAdmin detects procon.exe shutdown - attempts to reload
                System.Console.WriteLine("Already running - shutting down");
                Thread.Sleep(50);
            }

        }