Browse Source

搭配赛的一个线上bug

hexiaojie 11 months ago
parent
commit
2532345bf5

+ 15 - 2
GameClient/Assets/Game/HotUpdate/Data/MatchingCompetitionDataManager.cs

@@ -266,19 +266,32 @@ namespace GFGGame
             }
             //SetNameToIdList();
         }
+
         public int GetIDByString(string name)
         {
             int id = 0;
             //使用正则表达式分割字符串
             string[] parts = Regex.Split(name, "_");
-            if(parts.Length > 0)
+            if (parts.Length > 0)
             {
-                if(parts[0] == "Role")
+                string vl = parts[0];
+                bool isNumeric = int.TryParse(vl, out _);
+                if (vl == "Role")
                 {
                     return -1;
                 }
+                else if (vl == "Border")
+                {
+                    return -2;
+                }
+                else if (!isNumeric)
+                {
+                    return -3;
+                }
+
                 id = int.Parse(parts[0]);
             }
+
             return id;
         }
         public List<int> GetIDListByString(string name)