From ac0e60d82a41d51ce63323389b2224ef2200f2dd Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 09 十月 2020 18:14:16 +0800
Subject: [PATCH] 8542 【主干】【长尾】【BT】【后端】组队逻辑优化(支持发送teamID请求加入;支持双方无队伍请求加入,被请求玩家为队长)

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py
index e65872c..96adcd2 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py
@@ -28,7 +28,6 @@
 import copy
 import PlayerViewCache
 import PlayerTeam
-import cPickle
 
 #---------------------------------------------------------------------
 
@@ -77,13 +76,12 @@
             return
     
     if not tagPlayer:
-        curCache = PlayerViewCache.ViewCacheMgr.FindCache(curTagPlayerID)
+        curCache = PlayerViewCache.FindViewCache(curTagPlayerID)
         if not curCache:
             #玩家的数据没有缓存过
             PlayerControl.NotifyCode(curPlayer, 'Friend_OffLine')
             return
-        cacheDict = cPickle.loads(curCache.GetPropData())
-        tagLV = cacheDict["LV"]
+        tagLV = curCache.LV
     else:
         tagLV = tagPlayer.GetLV()
     
@@ -266,7 +264,7 @@
     srcPlayer = playerManager.FindPlayerByID(srcPlayerID)
     if srcPlayer == None:
         # 玩家已下线
-        curCache = PlayerViewCache.ViewCacheMgr.FindCache(srcPlayerID)
+        curCache = PlayerViewCache.FindViewCache(srcPlayerID)
         if not curCache:
             #玩家的数据没有缓存过
             #PlayerControl.NotifyCode(curPlayer, 'Friend_OffLine')
@@ -324,7 +322,7 @@
         PlayerControl.NotifyCode(srcPlayer, 'Friend_MakeFriend', [curPlayer.GetName()])
         #srcPlayer.MapServer_QueryPlayerResult(0, 0, 'AddFriendSucceed', "", 0)
     else:
-        cacheDict = cPickle.loads(curCache.GetPropData())
+        cacheDict = PlayerViewCache.GetCachePropDataDict(curCache)
         PlayerControl.NotifyCode(curPlayer, 'Friend_MakeFriend', [cacheDict['Name']])  
         # 记录等对方上线通知地图,任务等会用到触发逻辑,通用记录次数即可, MapServer_SyncFriendInfo为具体的好友数量,根据策划需求制作
         pass
@@ -393,10 +391,10 @@
     
     tagPlayer = GameWorld.GetPlayerManager().FindPlayerByID(tagID)
     if not tagPlayer:
-        curCache = PlayerViewCache.ViewCacheMgr.FindCache(tagID)
+        curCache = PlayerViewCache.FindViewCache(tagID)
         if not curCache:
             return
-        cacheDict = cPickle.loads(curCache.GetPropData())
+        cacheDict = PlayerViewCache.GetCachePropDataDict(curCache)
         playerName = cacheDict['Name']
     else:
         playerName = tagPlayer.GetName()

--
Gitblit v1.8.0