示例#1
0
 /// <summary>
 /// Central program entry point.
 /// Decides whether to lauch the server or the client.
 /// </summary>
 /// <param name="args">The command line arguments.</param>
 static void Main(string[] args)
 {
     ConsoleHandle = Process.GetCurrentProcess().MainWindowHandle;
     VoxProgram.PreInitVox();
     SysConsole.Init();
     VoxProgram.Init();
     try
     {
         string game = "default";
         if (args.Length > 0)
         {
             game = args[0];
             string[] t = new string[args.Length - 1];
             Array.Copy(args, 1, t, 0, t.Length);
             args = t;
         }
         Server.Init(game, args);
     }
     catch (Exception ex)
     {
         if (ex is ThreadAbortException)
         {
             Console.WriteLine("Forced shutdown - terminating process.");
             Environment.Exit(0);
             return;
         }
         SysConsole.Output(ex);
         File.WriteAllText("GLOBALERR_" + DateTime.Now.ToFileTimeUtc().ToString() + ".txt", ex.ToString() + "\n\n" + Environment.StackTrace);
     }
     SysConsole.ShutDown();
     Console.WriteLine("Final shutdown - terminating process.");
     Environment.Exit(0);
 }
示例#2
0
 /// <summary>
 /// Central program entry point.
 /// Decides whether to lauch the server or the client.
 /// </summary>
 /// <param name="args">The command line arguments.</param>
 static void Main(string[] args)
 {
     ConsoleHandle = Process.GetCurrentProcess().MainWindowHandle;
     Thread.CurrentThread.CurrentCulture       = CultureInfo.InvariantCulture;
     CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.InvariantCulture;
     CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
     SysConsole.Init();
     Program.Init();
     try
     {
         Server.Init(args);
     }
     catch (Exception ex)
     {
         if (ex is ThreadAbortException)
         {
             Console.WriteLine("Forced shutdown - terminating process.");
             Environment.Exit(0);
             return;
         }
         SysConsole.Output(ex);
         File.WriteAllText("GLOBALERR_" + DateTime.Now.ToFileTimeUtc().ToString() + ".txt", ex.ToString() + "\n\n" + Environment.StackTrace);
     }
     SysConsole.ShutDown();
     Console.WriteLine("Final shutdown - terminating process.");
     Environment.Exit(0);
 }
示例#3
0
        /// <summary>
        /// Main entry method.
        /// </summary>
        /// <param name="args">Command line arguments, if any.</param>
        static void Main(string[] args)
        {
            PreInit(new T3DProgram());
            SysConsole.Init();
            Game game = new Game();

            game.Start();
        }
示例#4
0
 /// <summary>
 /// Main entry point for the game program.
 /// </summary>
 /// <param name="args">Command line arguments.</param>
 static void Main(string[] args)
 {
     // Set up the program.
     PreInit(new GameProgram());
     // Set up the system console.
     SysConsole.Init();
     // Construct and run the game itself.
     new Game().Run();
 }
示例#5
0
        /// <summary>
        /// Central program entry point.
        /// Decides whether to lauch the server or the client.
        /// </summary>
        /// <param name="args">The command line arguments.</param>
        static void Main(string[] args)
        {
            ConsoleHandle = Process.GetCurrentProcess().MainWindowHandle;
            if (args.Length == 1 && args[0] == "{{Launcher}}")
            {
                args = new string[0];
#if !LINUX
                ShowWindow(ConsoleHandle, SW_HIDE);
#endif
            }
            VoxProgram.PreInit();
            SysConsole.AllowCursor = false;
            SysConsole.Init();
            StringBuilder arger = new StringBuilder();
            for (int i = 0; i < args.Length; i++)
            {
                arger.Append(args[i]).Append(' ');
            }
            try
            {
                VoxProgram.Init();
                if (args.Length > 0 && args[0] == "server")
                {
                    string[] targs = new string[args.Length - 1];
                    Array.Copy(args, 1, targs, 0, targs.Length);
                    args = targs;
                    string game = "default";
                    if (args.Length > 0)
                    {
                        game = args[0];
                        string[] t = new string[args.Length - 1];
                        Array.Copy(args, 1, t, 0, t.Length);
                        args = t;
                    }
                    Server.Init(game, args);
                }
                else
                {
                    Client.Init(arger.ToString());
                }
            }
            catch (Exception ex)
            {
                if (ex is ThreadAbortException)
                {
                    Console.WriteLine("Forced shutdown - terminating process.");
                    Environment.Exit(0);
                    return;
                }
                SysConsole.Output(ex);
                File.WriteAllText("GLOBALERR_" + DateTime.Now.ToFileTimeUtc().ToString() + ".txt", ex.ToString() + "\n\n" + Environment.StackTrace);
            }
            SysConsole.ShutDown();
            Console.WriteLine("Final shutdown - terminating process.");
            Environment.Exit(0);
        }
示例#6
0
 static void Main()
 {
     AllocConsole();
     SysConsole.Init();
     Files = new FileHandler();
     Files.Init();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new PrimaryEditor());
 }
示例#7
0
        /// <summary>
        /// Central program entry point.
        /// Decides whether to lauch the server or the client.
        /// </summary>
        /// <param name="args">The command line arguments</param>
        static void Main(string[] args)
        {
            ConsoleHandle = Process.GetCurrentProcess().MainWindowHandle;
            SysConsole.Init();
            LaunchFlags    = new List <char>();
            LaunchSettings = new List <KeyValuePair <string, string> >();
            bool in_setting = false;

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i].StartsWith("--") && args[i].Length > 2)
                {
                    in_setting = true;
                    Console.WriteLine("Found setting " + args[i].Substring(2));
                    LaunchSettings.Add(new KeyValuePair <string, string>(args[i].Substring(2), ""));
                }
                else if (args[i].StartsWith("-") && args[i].Length > 1)
                {
                    for (int x = 1; x < args[i].Length; x++)
                    {
                        Console.WriteLine("Found flag " + args[i][x]);
                        LaunchFlags.Add(args[i][x]);
                    }
                    in_setting = false;
                }
                else if (in_setting)
                {
                    KeyValuePair <string, string> kvp = LaunchSettings[LaunchSettings.Count - 1];
                    LaunchSettings.RemoveAt(LaunchSettings.Count - 1);
                    Console.WriteLine("Found setting argument, " + kvp.Key + " is now " + kvp.Value + (kvp.Value.Length > 0 ? " " : "") + args[i]);
                    LaunchSettings.Add(new KeyValuePair <string, string>(kvp.Key, kvp.Value + (kvp.Value.Length > 0 ? " ": "") + args[i]));
                }
            }
#if CLIENT
            if (args.Length > 0 && args[0] == "server")
            {
                ServerMain.Init();
            }
            else
            {
                ClientMain.Init();
            }
#else
            ServerMain.Init();
#endif
        }
示例#8
0
        /// <summary>
        /// Central program entry point.
        /// Decides whether to lauch the server or the client.
        /// </summary>
        /// <param name="args">The command line arguments.</param>
        static void Main(string[] args)
        {
            ConsoleHandle = Process.GetCurrentProcess().MainWindowHandle;
            Thread.CurrentThread.CurrentCulture       = CultureInfo.InvariantCulture;
            CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.InvariantCulture;
            CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
            SysConsole.Init();
            StringBuilder arger = new StringBuilder();

            for (int i = 0; i < args.Length; i++)
            {
                arger.Append(args[i]).Append(' ');
            }
            try
            {
                Program.Init();
                if (args.Length > 0 && args[0] == "server")
                {
                    string[] targs = new string[args.Length - 1];
                    Array.Copy(args, 1, targs, 0, targs.Length);
                    Server.Init(targs);
                }
                else
                {
                    Client.Init(arger.ToString());
                }
            }
            catch (Exception ex)
            {
                if (ex is ThreadAbortException)
                {
                    Console.WriteLine("Forced shutdown - terminating process.");
                    Environment.Exit(0);
                    return;
                }
                SysConsole.Output(ex);
                File.WriteAllText("GLOBALERR_" + DateTime.Now.ToFileTimeUtc().ToString() + ".txt", ex.ToString() + "\n\n" + Environment.StackTrace);
            }
            SysConsole.ShutDown();
            Console.WriteLine("Final shutdown - terminating process.");
            Environment.Exit(0);
        }