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


C# CommandLineParser.method_1方法代码示例

本文整理汇总了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;
        }
开发者ID:OlympusServers,项目名称:Oxide,代码行数:61,代码来源:BlockstormExtension.cs


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