Browse Source

【游戏服】修复测试添加的units,openid重复的问题

大爷 1 year ago
parent
commit
da4c182ae8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      DotNet/Hotfix/Scenes/Game/Handler/C2G_AddUnitsToMapHandler.cs

+ 1 - 1
DotNet/Hotfix/Scenes/Game/Handler/C2G_AddUnitsToMapHandler.cs

@@ -55,7 +55,7 @@ namespace ET.Server
 
             int objId = await player.Map.AddUnits(unit, true);
             // 临时openId
-            string _openId = player.GetComponent<PlayerDataComponent>().Data.Id.ToString();
+            string _openId = (10000 + new Random().Next(999)).ToString();
 
             player.Map.AddUnitPlayer(_openId, request.UnitId, objId, 0, unit.name, "");