Просмотр исходного кода

因为机器人的存在,服务端必须包含客户端的配置,所以配置中标记为c等价于cs

tanghai 3 лет назад
Родитель
Сommit
5b6c0f4fd5

+ 0 - 3
Codes/Generate/Client/Config/UnitConfig.cs

@@ -93,9 +93,6 @@ namespace ET
 		/// <summary>身高</summary>
 		[ProtoMember(6)]
 		public int Height { get; set; }
-		/// <summary>体重</summary>
-		[ProtoMember(7)]
-		public int Weight { get; set; }
 
 	}
 }

+ 3 - 1
Config/UnitConfigCategory.bytes

@@ -1,2 +1,4 @@
 
-1é	米克尔"带有强力攻击技能(0²8D
+1é	米克尔"带有强力攻击技能(0²8D
+3ê
+米克尔2"带有强力攻击技能2(0–8N

+ 31 - 16
DotNet/Tool/ExcelExporter/ExcelExporter.cs

@@ -23,7 +23,7 @@ namespace ET
 
     class HeadInfo
     {
-        public string FieldAttribute;
+        public string FieldCS;
         public string FieldDesc;
         public string FieldName;
         public string FieldType;
@@ -31,7 +31,7 @@ namespace ET
 
         public HeadInfo(string cs, string desc, string name, string type, int index)
         {
-            this.FieldAttribute = cs;
+            this.FieldCS = cs;
             this.FieldDesc = desc;
             this.FieldName = name;
             this.FieldType = type;
@@ -54,6 +54,7 @@ namespace ET
         private static string template;
 
         public const string ClientClassDir = "../Codes/Generate/Client/Config";
+        // 服务端因为机器人的存在必须包含客户端所有配置,所以单独的c字段没有意义,单独的c就表示cs
         public const string ServerClassDir = "../Codes/Generate/Server/Config";
 
         private const string excelDir = "../Excel";
@@ -128,6 +129,12 @@ namespace ET
                         cs = ss[1];
                     }
 
+                    // 服务端因为机器人的存在必须包含客户端所有配置,所以单独的c字段没有意义,单独的c就表示cs
+                    if (cs == "c")
+                    {
+                        cs = "cs";
+                    }
+
                     if (cs == "")
                     {
                         cs = "cs";
@@ -232,6 +239,12 @@ namespace ET
                 fileNameWithoutCS = ss[0];
                 cs = ss[1];
             }
+            
+            // 服务端因为机器人的存在必须包含客户端所有配置,所以单独的c字段没有意义,单独的c就表示cs
+            if (cs == "c")
+            {
+                cs = "cs";
+            }
 
             if (cs == "")
             {
@@ -388,6 +401,12 @@ namespace ET
                     continue;
                 }
 
+                // 服务端因为机器人的存在必须包含客户端所有配置,所以单独的c字段没有意义,单独的c就表示cs
+                if (fieldCS == "c")
+                {
+                    fieldCS = "cs";
+                }
+                
                 if (fieldCS == "")
                 {
                     fieldCS = "cs";
@@ -395,9 +414,9 @@ namespace ET
 
                 if (table.HeadInfos.TryGetValue(fieldName, out var oldClassField))
                 {
-                    if (oldClassField.FieldAttribute != fieldCS)
+                    if (oldClassField.FieldCS != fieldCS)
                     {
-                        Log.Console($"field cs not same: {worksheet.Name} {fieldName} oldcs: {oldClassField.FieldAttribute} {fieldCS}");
+                        Log.Console($"field cs not same: {worksheet.Name} {fieldName} oldcs: {oldClassField.FieldCS} {fieldCS}");
                     }
 
                     continue;
@@ -431,12 +450,7 @@ namespace ET
                     continue;
                 }
 
-                if (headInfo.FieldType == "json")
-                {
-                    continue;
-                }
-
-                if (!headInfo.FieldAttribute.Contains(configType.ToString()))
+                if (!headInfo.FieldCS.Contains(configType.ToString()))
                 {
                     continue;
                 }
@@ -444,11 +458,6 @@ namespace ET
                 sb.Append($"\t\t/// <summary>{headInfo.FieldDesc}</summary>\n");
                 sb.Append($"\t\t[ProtoMember({headInfo.FieldIndex})]\n");
                 string fieldType = headInfo.FieldType;
-                if (fieldType == "int[][]")
-                {
-                    fieldType = "string[]";
-                }
-
                 sb.Append($"\t\tpublic {fieldType} {headInfo.FieldName} {{ get; set; }}\n");
             }
 
@@ -505,6 +514,12 @@ namespace ET
                 {
                     prefix = "cs";
                 }
+                
+                // 服务端因为机器人的存在必须包含客户端所有配置,所以单独的c字段没有意义,单独的c就表示cs
+                if (prefix == "c")
+                {
+                    prefix = "cs";
+                }
 
                 if (!prefix.Contains(configTypeStr))
                 {
@@ -533,7 +548,7 @@ namespace ET
                         continue;
                     }
 
-                    if (headInfo.FieldType == "json")
+                    if (!headInfo.FieldCS.Contains(configTypeStr))
                     {
                         continue;
                     }

+ 2 - 1
Excel/Json/c/UnitConfig.txt

@@ -1,3 +1,4 @@
 {"list":[
-{"_t":"UnitConfig","_id":1001,"Type":1,"Name":"米克尔","Desc":"带有强力攻击技能","Position":1,"Height":178,"Weight":68},
+{"_t":"UnitConfig","_id":1001,"Type":1,"Name":"米克尔","Desc":"带有强力攻击技能","Position":1,"Height":178},
+{"_t":"UnitConfig","_id":1002,"Type":1,"Name":"米克尔2","Desc":"带有强力攻击技能2","Position":2,"Height":278},
 ]}

+ 1 - 0
Excel/Json/s/UnitConfig.txt

@@ -1,3 +1,4 @@
 {"list":[
 {"_t":"UnitConfig","_id":1001,"Type":1,"Name":"米克尔","Desc":"带有强力攻击技能","Position":1,"Height":178,"Weight":68},
+{"_t":"UnitConfig","_id":1002,"Type":1,"Name":"米克尔2","Desc":"带有强力攻击技能2","Position":2,"Height":278,"Weight":78},
 ]}

BIN
Excel/UnitConfig.xlsx


+ 3 - 1
Unity/Assets/Bundles/Config/UnitConfigCategory.bytes

@@ -1,2 +1,4 @@
 
-1é	米克尔"带有强力攻击技能(0²8D
+/é	米克尔"带有强力攻击技能(0²
+1ê
+米克尔2"带有强力攻击技能2(0–