本文整理匯總了C#中Terraria.Main.SetNetPlayers方法的典型用法代碼示例。如果您正苦於以下問題:C# Main.SetNetPlayers方法的具體用法?C# Main.SetNetPlayers怎麽用?C# Main.SetNetPlayers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Terraria.Main
的用法示例。
在下文中一共展示了Main.SetNetPlayers方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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();
}