浏览代码

【优化】解决多次登录会创建多个角色数据问题(漏提)

johnclot69 1 年之前
父节点
当前提交
93c3bb5a3a
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      DotNet/Hotfix/Scenes/Game/Player/SessionPlayerComponentSystem.cs

+ 2 - 2
DotNet/Hotfix/Scenes/Game/Player/SessionPlayerComponentSystem.cs

@@ -55,7 +55,7 @@ namespace ET.Server
         /// <returns></returns>
         public static bool IsExist(this SessionPlayerComponent self, long playerId)
         {
-            return self.PlayerList.Any(info => info != null && info.Id == playerId);
+            return self.PlayerList.Any(info => info != null && info.PlayerId == playerId);
         }
 
         /// <summary>
@@ -66,7 +66,7 @@ namespace ET.Server
         /// <returns></returns>
         public static PlayerInfo Get(this SessionPlayerComponent self, long playerId)
         {
-            return self.PlayerList.FirstOrDefault(info => info != null && info.Id == playerId);
+            return self.PlayerList.FirstOrDefault(info => info != null && info.PlayerId == playerId);
         }
 
         /// <summary>