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


C# Main.AutoPass方法代码示例

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


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

示例1: 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

示例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

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