From 67449627d6db97ca0cbe2c910a261bd253c3094d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 03 一月 2019 17:30:58 +0800
Subject: [PATCH] 5660 【后端】【1.4.100】老版绝世武器绝版属性同步

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py |   39 +++++++++++++++++++++++++++++++++++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py    |    3 +++
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
index 042ae17..a4084ee 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -1273,10 +1273,32 @@
         return
     
     def CheckRolePackEquipAttr(self):
+        ''' 玩家上线修复装备属性bug
+                    版本1:邮件给装备没有传奇属性,检查无传奇属性装备
+                    版本2:绝版属性数值调整,已获得的装备重新刷下
+        '''
         curPlayer = self.__Player
+        checkVersion = 2
         key = "LoginCheckEquipAttr"
-        if curPlayer.NomalDictGetProperty(key):
+        curVersion = curPlayer.NomalDictGetProperty(key)
+        if curVersion == checkVersion:
             return
+        playerID = curPlayer.GetPlayerID()
+        GameWorld.Log("玩家上线处理装备属性! curVersion=%s,checkVersion=%s" % (curVersion, checkVersion), playerID)
+        
+        outOfPrintAttrItemDict = {} # 有绝版属性的定制物品属性信息 {itemID:[绝版属性ID列表, 绝版属性数值列表], ...}
+        ipyDataMgr = IpyGameDataPY.IPY_Data()
+        for i in xrange(ipyDataMgr.GetAppointItemCount()):
+            ipyData = ipyDataMgr.GetAppointItemByIndex(i)
+            outOfPrintAttrList = ipyData.GetOutOfPrintAttr()
+            outOfPrintAttrValueList = ipyData.GetOutOfPrintAttrValue()
+            if not outOfPrintAttrList or len(outOfPrintAttrList) != len(outOfPrintAttrValueList):
+                continue
+            itemID = GetAppointItemRealID(ipyData.GetID())
+            if not itemID:
+                continue
+            outOfPrintAttrItemDict[itemID] = [outOfPrintAttrList, outOfPrintAttrValueList]
+            
         checkPackList = [IPY_GameWorld.rptEquip, IPY_GameWorld.rptItem, IPY_GameWorld.rptWarehouse]
         for packType in checkPackList:
             curPack = curPlayer.GetItemManager().GetPack(packType)
@@ -1288,8 +1310,21 @@
                 isEquip = ItemCommon.CheckItemIsEquip(curItem)
                 if not isEquip:
                     continue
+                itemID = curItem.GetItemTypeID()
                 self.CheckEquipAttr(packType, curItem)
-        PlayerControl.NomalDictSetProperty(curPlayer, key, 1)
+                
+                # 重刷绝版属性
+                if itemID in outOfPrintAttrItemDict:
+                    outOfPrintAttrList, outOfPrintAttrValueList = outOfPrintAttrItemDict[itemID]
+                    curItem.ClearUserAttr(ShareDefine.Def_IudetOutOfPrintAttrID)
+                    curItem.ClearUserAttr(ShareDefine.Def_IudetOutOfPrintAttrValue)
+                    for outOfPrintAttrIndex in xrange(len(outOfPrintAttrList)):
+                        curItem.AddUserAttr(ShareDefine.Def_IudetOutOfPrintAttrID, outOfPrintAttrList[outOfPrintAttrIndex])
+                        curItem.AddUserAttr(ShareDefine.Def_IudetOutOfPrintAttrValue, outOfPrintAttrValueList[outOfPrintAttrIndex])
+                    GameWorld.Log("    玩家登录重刷装备绝版属性: packType=%s,i=%s,itemID=%s,outOfPrintAttrList=%s,outOfPrintAttrValueList=%s" 
+                                  % (packType, i, itemID, outOfPrintAttrList, outOfPrintAttrValueList), playerID)
+                    
+        PlayerControl.NomalDictSetProperty(curPlayer, key, checkVersion)
         return
 
     ## 是否能放入物品 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index befd498..9623b08 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -249,6 +249,9 @@
     #初始化玩家背包
     InitPlayerPack(curPlayer)
     
+    #上线检查一次装备属性
+    ItemControler.PlayerItemControler(curPlayer).CheckRolePackEquipAttr()
+    
     #通知玩家物品信息
     __Sync_PackDetel(curPlayer)
     

--
Gitblit v1.8.0