提交 e96aa6c2 编写于 作者: T tanghai

加上默认参数,以后命令行可以少输入几个参数

上级 7d3bf75f
......@@ -21,7 +21,7 @@ namespace App
Options options = Game.Scene.AddComponent<OptionComponent, string[]>(args).Options;
StartConfig startConfig = Game.Scene.AddComponent<StartConfigComponent, string, int>(options.Config, options.AppId).StartConfig;
if (options.AppType != startConfig.AppType)
if (!options.AppType.Is(startConfig.AppType))
{
Log.Error("命令行参数apptype与配置不一致");
return;
......
......@@ -2,7 +2,6 @@
"profiles": {
"Server.App": {
"commandName": "Project",
"commandLineArgs": "--appId=1 --appType=AllServer --config=../Config/StartConfig/LocalAllServer.txt",
"workingDirectory": "D:\\Source\\Egametang\\netcoreapp2.0"
}
}
......
......@@ -6,14 +6,14 @@ namespace Model
{
public class Options
{
[Option("appId", Required = true)]
[Option("appId", Required = false, Default = 1)]
public int AppId { get; set; }
// 没啥用,主要是在查看进程信息能区分每个app.exe的类型
[Option("appType", Required = true)]
[Option("appType", Required = false, Default = AppType.Manager)]
public AppType AppType { get; set; }
[Option("config", Required = false)]
[Option("config", Required = false, Default = "../Config/StartConfig/LocalAllServer.txt")]
public string Config { get; set; }
}
}
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.15
MinimumVisualStudioVersion = 10.0.40219.1
# Visual Studio 2017
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Plugins", "Unity.Plugins.csproj", "{D1FDB199-0FB7-099D-3771-C6A942E4E326}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity", "Unity.csproj", "{CF118143-7E37-744F-BE45-3F55345FEC40}"
......@@ -43,7 +41,4 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ED6F29BC-3CD2-4A7E-938F-1F85FFE60CB1}
EndGlobalSection
EndGlobal
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册