From 55a578c93248a0a88a63e8f96daf0f0fc8c525dd Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 16 八月 2018 14:20:20 +0800
Subject: [PATCH] 2585 【后端】排行榜离线玩家仙盟刷新优化

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py
index 24f82af..e94851e 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py
@@ -27,8 +27,10 @@
 import PlayerFamily
 import IPY_GameServer
 import ShareDefine
-import time
 import ChConfig
+
+import time
+import json
 
 ViewCacheMgr = GameWorld.GameWorldData.GetPlayerViewCacheMgr()
 
@@ -279,4 +281,20 @@
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     NetPackCommon.SendFakePack(curPlayer, answerPack)
     return
-    
\ No newline at end of file
+
+def OnPlayerLeaveFamily(playerID):
+    GameWorld.DebugLog("ViewCache->OnPlayerLeaveFamily", playerID)
+    curCache = ViewCacheMgr.FindCache(playerID)
+    if not curCache:
+        return
+    PropData = eval(curCache.GetPropData())
+    PropData["FamilyID"] = 0
+    PropData["FamilyName"] = ""
+    playerLV = PropData["LV"]
+    
+    PropData = json.dumps(PropData, ensure_ascii=False)
+    ItemData = curCache.GetItemData()
+    PlusData = curCache.GetPlusData()
+    UpdatePlayerCache(playerID, PropData, ItemData, PlusData, True if playerLV > 150 else False)  
+    return
+

--
Gitblit v1.8.0