本文整理汇总了C#中CommandLineParser.method_1方法的典型用法代码示例。如果您正苦于以下问题:C# CommandLineParser.method_1方法的具体用法?C# CommandLineParser.method_1怎么用?C# CommandLineParser.method_1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandLineParser
的用法示例。
在下文中一共展示了CommandLineParser.method_1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnModLoad
/// <summary>
/// Called when all other extensions have been loaded
/// </summary>
public override void OnModLoad()
{
if (!Interface.Oxide.EnableConsole()) return;
Application.RegisterLogCallback(HandleLog);
Interface.Oxide.ServerConsole.Input += ServerConsoleOnInput;
var commandLineParser = new CommandLineParser();
var serverConfig = "serverConfig";
if (commandLineParser.method_1("config"))
serverConfig = commandLineParser.method_2("config");
dedicatedServerConfiguration.method_0(serverConfig, AssetsCollection.instance);
Interface.Oxide.ServerConsole.Title = () =>
{
var players = FpsMultiplayerGame.instance.playersList.method_5().Count;
var hostname = dedicatedServerConfiguration.string_10;
return string.Concat(players, " | ", hostname);
};
Interface.Oxide.ServerConsole.Status1Left = () =>
{
var hostname = dedicatedServerConfiguration.string_10;
return string.Concat(" ", hostname);
};
Interface.Oxide.ServerConsole.Status1Right = () =>
{
var fps = Mathf.RoundToInt(1f / Time.smoothDeltaTime);
var seconds = TimeSpan.FromSeconds(Time.realtimeSinceStartup);
var uptime = $"{seconds.TotalHours:00}h{seconds.Minutes:00}m{seconds.Seconds:00}s".TrimStart(' ', 'd', 'h', 'm', 's', '0');
return string.Concat(fps, "fps, ", uptime);
};
Interface.Oxide.ServerConsole.Status2Left = () =>
{
var players = FpsMultiplayerGame.instance.playersList.method_5().Count;
var playerLimit = dedicatedServerConfiguration.int_1.ToString();
return string.Concat(" ", players, "/", playerLimit, " players");
};
Interface.Oxide.ServerConsole.Status2Right = () =>
{
// TODO: Network in/out
return "";
};
Interface.Oxide.ServerConsole.Status3Left = () =>
{
// TODO: Server game time, map name
return "";
};
Interface.Oxide.ServerConsole.Status3Right = () =>
{
var gameVersion = Constants.smethod_0();
var oxideVersion = OxideMod.Version.ToString();
return string.Concat("Oxide ", oxideVersion, " for ", gameVersion);
};
Interface.Oxide.ServerConsole.Status3RightColor = ConsoleColor.Yellow;
}