当前位置: 首页>>代码示例>>C#>>正文


C# Main.Run方法代码示例

本文整理汇总了C#中Terraria.Main.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Main.Run方法的具体用法?C# Main.Run怎么用?C# Main.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Terraria.Main的用法示例。


在下文中一共展示了Main.Run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LaunchGame

 public static void LaunchGame(string[] args)
 {
     Program.LaunchParameters = Utils.ParseArguements(args);
     Program.usingSteam = !Program.LaunchParameters.ContainsKey("-usingsteam");  //If it doesn't have that key, we will use Steam
     ThreadPool.SetMinThreads(8, 8);
     using (Main main = new Main())
     {
         try
         {
             if (Program.usingSteam) SocialAPI.Initialize(null);
             LaunchInitializer.LoadParameters(main);
             Main.OnEngineLoad += delegate
             {
                 Program.ForceLoadAssembly(Assembly.GetExecutingAssembly(), true);
             };
             main.Run();
         }
         catch (Exception e)
         {
             Program.DisplayException(e);
         }
     }
 }
开发者ID:MEFBAEA,项目名称:mefbaea,代码行数:23,代码来源:Program.cs

示例2: Main

		private static void Main(string[] args)
		{
            if (1 == 1)
            {
                PlayerStates test = new PlayerStates(null);
                //DedicatedConfig.test();
                return;
            }
			using (Main main = new Main())
			{
				try
				{
					for (int i = 0; i < args.Length; i++)
					{
						if (args[i].ToLower() == "-port" || args[i].ToLower() == "-p")
						{
							i++;
							try
							{
								int serverPort = Convert.ToInt32(args[i]);
								Netplay.serverPort = serverPort;
							}
							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.password = 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
					{
					}
				}
			}
		}
开发者ID:NoviaDroid,项目名称:TerrariaRefractoring_1.3.2.1,代码行数:74,代码来源:Program.cs

示例3: Main

 private static void Main(string[] args)
 {
     using (Main main = new Main())
     {
         try
         {
             for (int i = 0; i < args.Length; i++)
             {
                 if (args[i].ToLower() == "-port" || args[i].ToLower() == "-p")
                 {
                     i++;
                     try
                     {
                         int serverPort = Convert.ToInt32(args[i]);
                         Netplay.serverPort = serverPort;
                     }
                     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.password = args[i];
                     main.AutoPass();
                 }
                 if (args[i].ToLower() == "-host")
                 {
                     main.AutoHost();
                 }
                 if (args[i].ToLower() == "-loadlib")
                 {
                     i++;
                     string path = args[i];
                     main.loadLib(path);
                 }
             }
             Steam.Init();
             if (Steam.SteamInit)
             {
                 main.Run();
             }
             else
             {
                 MessageBox.Show("Please launch the game from your Steam client.", "Error");
             }
         }
         catch (Exception ex)
         {
             try
             {
                 using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true))
                 {
                     streamWriter.WriteLine(DateTime.Now);
                     streamWriter.WriteLine(ex);
                     streamWriter.WriteLine("/n");
                 }
                 MessageBox.Show(ex.ToString(), "Terraria: Error");
             }
             catch
             {
             }
         }
     }
 }
开发者ID:brianmcmichael,项目名称:Terraria-Source-Code,代码行数:76,代码来源:Program.cs

示例4: LaunchGame

		public static void LaunchGame(string[] args)
		{
			Program.LaunchParameters = Utils.ParseArguements(args);
            ThreadPool.SetMinThreads(8, 8);
            using (Main main = new Main())
			{
				try
                {
                    SocialAPI.Initialize(null);
                    LaunchInitializer.LoadParameters(main);
                    Main.OnEngineLoad += delegate
					{
						Program.ForceLoadAssembly(Assembly.GetExecutingAssembly(), true);
					};
#if CLIENT
                    main.Run();
#else
                    main.DedServ();
#endif
                }
                catch (Exception e)
				{
					Program.DisplayException(e);
				}
			}
		}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:26,代码来源:Program.cs

示例5: Main

 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 { }
     }
 }
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:63,代码来源:Program.cs


注:本文中的Terraria.Main.Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。