本文整理汇总了C#中Main.SetNetPlayers方法的典型用法代码示例。如果您正苦于以下问题:C# Main.SetNetPlayers方法的具体用法?C# Main.SetNetPlayers怎么用?C# Main.SetNetPlayers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main.SetNetPlayers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadServerParameters
private static void LoadServerParameters(Main game)
{
try
{
string s;
if ((s = LaunchInitializer.TryParameter(new string[]
{
"-forcepriority"
})) != null)
{
Process currentProcess = Process.GetCurrentProcess();
int num;
if (int.TryParse(s, out num))
{
switch (num)
{
case 0:
currentProcess.PriorityClass = ProcessPriorityClass.RealTime;
break;
case 1:
currentProcess.PriorityClass = ProcessPriorityClass.High;
break;
case 2:
currentProcess.PriorityClass = ProcessPriorityClass.AboveNormal;
break;
case 3:
currentProcess.PriorityClass = ProcessPriorityClass.Normal;
break;
case 4:
currentProcess.PriorityClass = ProcessPriorityClass.BelowNormal;
break;
case 5:
currentProcess.PriorityClass = ProcessPriorityClass.Idle;
break;
default:
currentProcess.PriorityClass = ProcessPriorityClass.High;
break;
}
}
else
{
currentProcess.PriorityClass = ProcessPriorityClass.High;
}
}
else
{
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;
}
}
catch
{
}
string s2;
int netPlayers;
if ((s2 = LaunchInitializer.TryParameter(new string[]
{
"-maxplayers",
"-players"
})) != null && int.TryParse(s2, out netPlayers))
{
game.SetNetPlayers(netPlayers);
}
string serverPassword;
if ((serverPassword = LaunchInitializer.TryParameter(new string[]
{
"-pass",
"-password"
})) != null)
{
Netplay.ServerPassword = serverPassword;
}
string s3;
int lang;
if ((s3 = LaunchInitializer.TryParameter(new string[]
{
"-lang"
})) != null && int.TryParse(s3, out lang))
{
Lang.lang = lang;
}
string worldName;
if ((worldName = LaunchInitializer.TryParameter(new string[]
{
"-worldname"
})) != null)
{
game.SetWorldName(worldName);
}
string newMOTD;
if ((newMOTD = LaunchInitializer.TryParameter(new string[]
{
"-motd"
})) != null)
{
game.NewMOTD(newMOTD);
}
string banFilePath;
if ((banFilePath = LaunchInitializer.TryParameter(new string[]
{
"-banlist"
//.........这里部分代码省略.........