Terraria.Program.Main C# (CSharp) Method

Main() public static method

public static Main ( string args ) : void
args string
return void
        public static void Main(string[] args)
        {
            try
            {
                using (Main main = new Main())
                {
                    Program.LaunchParameters = Utils.ParseArguements(args);
                    for (int i = 0; i < args.Length; i++)
                    {
                        if (args[i].ToLower() == "-port" || args[i].ToLower() == "-p")
                        {
                            i++;
                            try
                            {
                                int listenPort = Convert.ToInt32(args[i]);
                                Netplay.ListenPort = listenPort;
                            }
                            catch { }
                        }
                        if (args[i].ToLower() == "-join" || args[i].ToLower() == "-j")
                        {
                            i++;
                            try
                            {
                                main.AutoJoin(args[i]);
                            }
                            catch { }
                        }
                        if (args[i].ToLower() == "-pass" || args[i].ToLower() == "-password")
                        {
                            i++;
                            Netplay.ServerPassword = args[i];
                            main.AutoPass();
                        }
                        if (args[i].ToLower() == "-host")
                        {
                            main.AutoHost();
                        }
                        if (args[i].ToLower() == "-loadlib")
                        {
                            i++;
                            string path = args[i];
                            main.loadLib(path);
                        }
                    }
                    main.Run();
                }
            }
            catch (Exception ex)
            {
                try
                {
                    using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true))
                    {
                        streamWriter.WriteLine(DateTime.Now);
                        streamWriter.WriteLine(ex);
                        streamWriter.WriteLine("");
                    }
                    MessageBox.Show(ex.ToString(), "Terraria: Error");
                }
                catch { }
            }
        }
    }
Program