本文整理汇总了C#中Terraria.Main.loadLib方法的典型用法代码示例。如果您正苦于以下问题:C# Main.loadLib方法的具体用法?C# Main.loadLib怎么用?C# Main.loadLib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terraria.Main
的用法示例。
在下文中一共展示了Main.loadLib方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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
{
}
}
}
}
示例2: Main
private static void Main(string[] args)
{
//Process currentProcess = Process.GetCurrentProcess();
//currentProcess.PriorityClass = ProcessPriorityClass.High;
game = new Main();
for (int i = 0; i < args.Length; i++)
{
if (args[i].ToLower() == "-config")
{
i++;
game.LoadDedConfig(args[i]);
}
if (args[i].ToLower() == "-port")
{
i++;
try
{
int serverPort = Convert.ToInt32(args[i]);
Netplay.ListenPort = serverPort;
}
catch
{
}
}
if (args[i].ToLower() == "-players" || args[i].ToLower() == "-maxplayers")
{
i++;
try
{
int netPlayers = Convert.ToInt32(args[i]);
game.SetNetPlayers(netPlayers);
}
catch
{
}
}
if (args[i].ToLower() == "-pass" || args[i].ToLower() == "-password")
{
i++;
Netplay.ServerPassword = args[i];
}
if (args[i].ToLower() == "-lang")
{
i++;
Lang.lang = Convert.ToInt32(args[i]);
}
if (args[i].ToLower() == "-world")
{
i++;
game.SetWorld(args[i], false);
}
if (args[i].ToLower() == "-worldname")
{
i++;
game.SetWorldName(args[i]);
}
if (args[i].ToLower() == "-motd")
{
i++;
game.NewMOTD(args[i]);
}
if (args[i].ToLower() == "-banlist")
{
i++;
Netplay.BanFilePath = args[i];
}
if (args[i].ToLower() == "-autoshutdown")
{
game.autoShut();
}
if (args[i].ToLower() == "-secure")
{
Netplay.spamCheck = true;
}
if (args[i].ToLower() == "-autocreate")
{
i++;
string newOpt = args[i];
game.autoCreate(newOpt);
}
if (args[i].ToLower() == "-loadlib")
{
i++;
string path = args[i];
game.loadLib(path);
}
if (args[i].ToLower() == "-noupnp")
{
Netplay.UseUPNP = false;
}
}
game.DedServ();
}
示例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
{
}
}
}
}
示例4: 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 { }
}
}