From ac0cdeb67cbd2829aeea991a89ec4442bba3f865 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 09 五月 2019 20:25:43 +0800
Subject: [PATCH] 6711 【后端】【2.0】洗练从0级开始洗练 6717【后端】【2.0】洗练数值非0 6628【2.0】【后端】查看玩家装备和查看玩家战力功能

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py  |   33 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py |   48 ++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py          |    6 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py                      |  225 +++++++++++++++++++++++++++----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py                |   56 +++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py                   |   10 -
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                          |   12 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py        |   10 +
 8 files changed, 307 insertions(+), 93 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index c0f577b..511bab0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3067,7 +3067,6 @@
 Def_PlayerKey_AttackFollowMaster = "FollowAtk"     # 召唤兽跟随攻击
 Def_PlayerKey_MoreHurtValue = "MoreHurtValue"     # 额外的伤害值,一般用于不走公式
 Def_PlayerKey_BloodShiledHurt = "BSHurt"     # 伤害值用于血盾抵消
-Def_PlayerKey_StartEquipCnt = "StartEquipCnt"     # 珍品数量
 Def_PlayerKey_TJGPackFullAfterEat = "TJGFullEat"     # 脱机挂吞噬后背包依然满的情况
 Def_PlayerKey_TJGStartTime = "TJGStartTime"     # 脱机挂结算时间起点
 Def_PlayerKey_EquipTime = "EquipTime"     # 时效装备
@@ -3173,11 +3172,7 @@
 Def_PlayerKey_ContendNPCObjID = "ContendNPCObjID"    #竞争归属的NPC实例ID
 Def_PlayerKey_AreaRewardMultiple = "AreaRewardMultiple"    #玩家所在区域福利倍值,默认1
 Def_PlayerKey_AttrActivatyNotify = "AttrActivatyNotify" # 属性激活提示类型
-Def_PlayerKey_AttrActivatyRecordStarLV = "AttrActivatyRecordStarLV" # 属性激活记录 - 强化星级
-Def_PlayerKey_AttrActivatyRecordStoneLV = "AttrActivatyRecordStoneLV" # 属性激活记录 - 宝石星级
-Def_PlayerKey_AttrActivatyRecordQualityECnt = "AttrActivatyRecordQualityECnt" # 属性激活记录 - 卓越装备件数
-Def_PlayerKey_AttrActivatyRecordSuiteCnt = "AttrActivatyRecordSuiteCnt" # 属性激活记录 - 套装件数
-Def_PlayerKey_AttrActivatyRecordQualityCnt = "AttrActivatyRecordQualityCnt" # 属性激活记录 - 卓越条数
+Def_PlayerKey_EquipOrangeCount = "EquipOrangeCount" # 装备信息 - 橙装及以上件数
 Def_PlayerKey_LastHurt = "PlayerLastHurt" # 最后补刀
 Def_PlayerKey_AddBackHPPer = "AddBackHPPer"    #增加生命恢复效果
 Def_PlayerKey_ReduceBackHPPer = "ReduceBackHPPer"    #降低生命恢复效果
@@ -3562,14 +3557,18 @@
 Def_PDict_RunTaskNextMissionID = "RunTaskNextMissionID_%s" # 跑环本轮结束下个任务ID 参数任务类型
 
 #强化
+Def_PDict_TotalPlusLV = "TotalPlusLV" # 总强化等级
 Def_PDict_EquipPartPlusLV = "EPPlusLV_%s_%s" # 装备部位对应公共强化星级,参数为(packType, index)
 Def_PDict_EquipActiveStarLV = "EquipActiveStarLV" #装备已激活总强化等级
 Def_PDict_EquipPartProficiency = "EPProf_%s_%s" # 装备部位对应公共强化熟练度,参数为(packType, index)
 Def_PDict_EquipPartPlusEvolveLV = "EPPlusEvolveLV_%s_%s" # 装备部位对应公共强化进化等级,参数为(packType, index)
+Def_PDict_TotalPlusEvolveLV = "TotalPlusEvolveLV" # 装备部位对应公共强化进化总等级
 # 宝石
 Def_PDict_EquipPartStoneID = "StoneID_%s_%s" # 装备位_孔位存储宝石ID*10+是(1)否(0)绑定
+Def_PDict_TotalStoneLV = "TotalStoneLV" # 装备位宝石总等级
 
 # 装备洗练, 暂不区分背包类型,如果有不同背包,策划设定不同的装备位
+Def_PDict_TotalEquipWashLV = "TotalEquipWashLV" # 装备部位洗练总等级
 Def_PDict_EquipWashLV = "EquipWashLV_%s" # 装备部位洗练等级,参数为(place)
 Def_PDict_EquipWashValue = "EquipWashV_%s_%s" # 装备部位洗练当前值,参数为(place, 属性编号)
 Def_PDict_EquipWashValueTemp = "EquipWashVT_%s_%s" # 装备部位洗练当前临时洗练值,参数为(place, 属性编号)
@@ -3912,6 +3911,7 @@
 Def_PDict_DogzBuyHelpbattleCount = "DogzBuyHelpbattleCount" # 额外购买的神兽助战位
 
 #装备部位星数
+Def_PDict_TotalEquipStar = "TotalEquipStar" #装备部位星数总数
 Def_PDict_EquipPartStar = "EQPartStar_%s" #装备部位星数 参数 装备背包格子索引
 
 #缥缈仙域
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
index 8717ca8..e34e150 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
@@ -35,10 +35,10 @@
 
 g_stoneCanPlaceList = [] #可镶嵌的位置
 
-def OnLogin(curPlayer):
-    ###登录发包同步客户端宝石信息
-    Sycn_StoneHoleInfo(curPlayer)
-    return
+#def OnLogin(curPlayer):
+#    ###登录发包同步客户端宝石信息
+#    Sycn_StoneHoleInfo(curPlayer)
+#    return
 
 def GetAllStoneEquipIndexList():
     ###得到所有可镶嵌宝石装备位列表
@@ -96,9 +96,31 @@
 
 def SetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex, changeStoneID, isBind):
     ### 保存装备位孔位宝石ID和绑定信息
+    befStoneID, befIsBind = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)
+    if befStoneID == changeStoneID and befIsBind == isBind:
+        return
+    
     isBind = 0 #现绑定无用,默认存0
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartStoneID % (equipIndex, holeIndex),
-                                       changeStoneID * ChConfig.Def_Stone_SaveStoneInfoXNumber + isBind) 
+                                       changeStoneID * ChConfig.Def_Stone_SaveStoneInfoXNumber + isBind)
+    
+    # 同步更新宝石总等级
+    gameData = GameWorld.GetGameData()
+    befStoneLV = 0
+    if befStoneID:
+        befGem = gameData.GetItemByTypeID(befStoneID)
+        befStoneLV = 0 if not befGem else befGem.GetEffectByIndex(0).GetEffectValue(1)
+        
+    aftStoneLV = 0
+    if changeStoneID:
+        aftGem = gameData.GetItemByTypeID(changeStoneID)
+        aftStoneLV = 0 if not aftGem else aftGem.GetEffectByIndex(0).GetEffectValue(1)
+        
+    befTotalStoneLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalStoneLV)
+    updTotalStoneLV = max(0, befTotalStoneLV + aftStoneLV - befStoneLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalStoneLV, updTotalStoneLV)
+    GameWorld.DebugLog("设置宝石等级: equipIndex=%s,holeIndex=%s,befStoneLV=%s,aftStoneLV=%s,befTotalStoneLV=%s,updTotalStoneLV=%s" 
+                       % (equipIndex, holeIndex, befStoneLV, aftStoneLV, befTotalStoneLV, updTotalStoneLV))
     return
 
 def GetPackTypeByEquipPlace(equipPlace):
@@ -287,21 +309,7 @@
 
 def GetTotalStoneLV(curPlayer):
     ##宝石总等级
-    totalStoneLV = 0
-    equipIndexList = GetAllStoneEquipIndexList()
-    holeIndexList = GetAllEquipPlaceHoleIndex()
-    gameData = GameWorld.GetGameData()
-    for equipIndex in equipIndexList:
-        for holeIndex in holeIndexList:
-            curGemID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)[0]
-            if curGemID == 0:
-                continue
-            curGem = gameData.GetItemByTypeID(curGemID)
-            if not curGem:
-                continue
-            gemLV = curGem.GetEffectByIndex(0).GetEffectValue(1)
-            totalStoneLV += gemLV
-    return totalStoneLV
+    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalStoneLV)
 
 #// A3 06 宝石升级 #tagCMEquipStoneUpgrade
 #struct    tagCMEquipStoneUpgrade
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py
index cdb674a..9201b05 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py
@@ -36,9 +36,9 @@
 Def_EquipWashMaxAttrCount = 3 # 装备洗练最大洗练属性条数
 g_allIndexList = [] #可洗炼的部位缓存
 
-def OnEquipWashLogin(curPlayer):
-    Sycn_EquipWashInfo(curPlayer, isLogin=True)
-    return
+#def OnEquipWashLogin(curPlayer):
+#    Sycn_EquipWashInfo(curPlayer, isLogin=True)
+#    return
 
 def GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace):
     # @return: 0-未开放; >=1-该装备位最大可洗练等级
@@ -178,6 +178,14 @@
                 return
         GameWorld.DebugLog("随机范围属性%s, washValue=%s, %s~%s" % (attrNum, washValue, randValueMin, randValueMax))
         randValue = random.randint(randValueMin, randValueMax)
+        for _ in xrange(50):
+            if randValue != 0:
+                break
+            randValue = random.randint(randValueMin, randValueMax)
+            #GameWorld.DebugLog("随机值0,重新随机!")
+        if randValue == 0:
+            randValue = 1
+            #GameWorld.DebugLog("随机值还是0,强制设置为1!")
         randAttrDict[attrNum] = randValue
         if randValue <= 0:
             negativeValueCnt += 1
@@ -359,13 +367,28 @@
         if tempValue < getattr(washData, "GetAttrMax%s" % attrNum)():
             return
     washLV += 1
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV)
-    GameWorld.DebugLog("装备洗练等级升级: equipPackindex=%s,washLV=%s" % (equipPackindex, washLV), curPlayer.GetPlayerID())
+    SetEquipWashLV(curPlayer, equipPackindex, washLV)
     
     # 洗练广播
     PlayerControl.WorldNotify(0, "WashCongratulation", [curPlayer.GetPlayerName(), curPlayer.GetPlayerID(), classLV, equipPlace, washLV])
     return True
 
+def SetEquipWashLV(curPlayer, index, setWashLV):
+    befWashLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % index)
+    if befWashLV == setWashLV:
+        return
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (index), setWashLV)
+    
+    # 同步更新洗练总等级
+    befTotalWashLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalEquipWashLV)
+    updTotalWashLV = max(0, befTotalWashLV + setWashLV - befWashLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipWashLV, updTotalWashLV)
+    GameWorld.DebugLog("设置洗练等级: index=%s,befWashLV=%s,setWashLV=%s,befTotalWashLV=%s,updTotalWashLV=%s" 
+                       % (index, befWashLV, setWashLV, befTotalWashLV, updTotalWashLV))
+    return
+
+## 全身洗练总等级
+def GetTotalEquipWashLV(curPlayer): return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalEquipWashLV)
 
 def Sycn_EquipWashInfo(curPlayer, equipPackindex=-1, isLogin=False):
     hasValue = False
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py
index 86d7aa8..aff2394 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py
@@ -37,7 +37,7 @@
     syncPlace = -1
     if len(cmdList) == 1 and cmdList[0] == 0:
         for index in allIndexList:
-            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (index), 0)
+            Operate_EquipWash.SetEquipWashLV(curPlayer, index, 0)
             for attrNum in range(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
                 PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (index, attrNum), 0)
                 PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (index, attrNum), 0)
@@ -82,7 +82,7 @@
 
 def __SetEquipPlaceWashLV(curPlayer, equipPackindex, place, washLV, attrPer, maxWashLV):
     washLV = min(maxWashLV, washLV)
-    washLV = max(1, washLV)
+    washLV = max(0, washLV)
     attrPer = max(0, attrPer)
     attrPer = min(100, attrPer)
     
@@ -91,7 +91,7 @@
     preWashData = None if washLV <= 0 else Operate_EquipWash.GetEquipWashData(washType, washLV - 1)
     
     #GameWorld.DebugLog("设置洗练: place=%s,washType=%s,washLV=%s,attrPer=%s" % (place, washType, washLV, attrPer))
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV)
+    Operate_EquipWash.SetEquipWashLV(curPlayer, equipPackindex, washLV)
     for attrNum in range(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
         preMaxValue = 0 if not preWashData else getattr(preWashData, "GetAttrMax%s" % attrNum)()
         curMaxValue = getattr(washData, "GetAttrMax%s" % attrNum)()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
index cca0faa..c1d8bd3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -182,6 +182,152 @@
             #GameWorld.DebugLog("添加装备缓存变更阶: classLV=%s, %s" % (classLV, classLVList), playerID)
     return
 
+def OnPlayerEquipLoginLogic(curPlayer):
+    ''' 玩家登录统一处理装备,只遍历一次装备背包,通知信息、更新一次数据,防止总等级统计异常
+                    装备品质橙装及以上数量、装备总星数、强化总等级、进化总等级、洗练总等级、宝石总等级
+    '''
+    
+    #NotifyEquipPartPlusLV(curPlayer)
+    #NotifyEquipPartStar(curPlayer)
+    #Operate_EquipWash.OnEquipWashLogin(curPlayer)
+    #通知套装信息
+    #ChEquip.SyncAllEquipAttrActiveInfo(curPlayer)
+    #装备位宝石镶嵌通知
+    #Operate_EquipStone.OnLogin(curPlayer)
+    
+    ePartStarLVPack = ChPyNetSendPack.tagMCEquipPartStarInfo() # A3 B1 装备部位星数信息 #tagMCEquipPartStarInfo
+    ePartPlusLVPack = ChPyNetSendPack.tagMCEquipPartPlusInfo() # A3 B3 装备部位强化信息 #tagMCEquipPartPlusInfo
+    ePartXLPack = ChPyNetSendPack.tagMCEquipPartXLAttrInfo() # A3 BB 装备位洗练属性信息 #tagMCEquipPartXLAttrInfo
+    ePartStonePack = ChPyNetSendPack.tagMCStoneInfo() # A3 BC 通知装备位孔位宝石ID #tagMCStoneInfo
+    
+    orangeEquipCount = 0
+    totalStar = 0
+    totalPlusLV = 0
+    totalEvolveLV = 0
+    totalWashLV = 0
+    totalStoneLV = 0
+    holeIndexList = Operate_EquipStone.GetAllEquipPlaceHoleIndex()
+    
+    gameData = GameWorld.GetGameData()
+    packType = IPY_GameWorld.rptEquip
+    equipPack = curPlayer.GetItemManager().GetPack(packType)
+    for index in xrange(equipPack.GetCount()):
+        ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':index}, isLogNone=False)
+        if not ipyData:
+            continue
+        # 只计算有阶的境界装备
+        if not ipyData.GetClassLV():
+            continue
+        
+        curEquip = equipPack.GetAt(index)
+        if not curEquip.IsEmpty():
+            if curEquip.GetItemColor() >= ShareDefine.Def_Item_Color_Orange:
+                orangeEquipCount += 1
+                
+        # 星级
+        starLV = GetEquipPartStar(curPlayer, index)
+        totalStar += starLV
+        
+        # 强化等级
+        plusProficiency = GetEquipPartProficiency(curPlayer, packType, index)
+        plusLV = GetEquipPartPlusLV(curPlayer, packType, index)
+        totalPlusLV += plusLV
+        
+        # 进化等级
+        evolveLV = GetEquipPartPlusEvolveLV(curPlayer, packType, index)
+        totalEvolveLV += evolveLV
+        
+        # 洗练等级
+        washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % index)
+        totalWashLV += washLV
+        
+        # 宝石等级
+        stoneIDList, stoneIsBindList = [], []
+        for holeIndex in holeIndexList:
+            stoneID, stoneIsBind = Operate_EquipStone.GetEquipIndexStoneIDAndIsBand(curPlayer, index, holeIndex)
+            stoneIDList.append(stoneID)
+            stoneIsBindList.append(stoneIsBind)
+            if stoneID == 0:
+                continue
+            curStone = gameData.GetItemByTypeID(stoneID)
+            stoneLV = 0 if not curStone else curStone.GetEffectByIndex(0).GetEffectValue(1)
+            totalStoneLV += stoneLV
+            
+        # 星级信息包
+        if starLV:
+            ePartStarLV = ChPyNetSendPack.tagMCEquipPartStar()
+            ePartStarLV.Clear()
+            ePartStarLV.EquipPackIndex = index
+            ePartStarLV.Star = starLV
+            ePartStarLVPack.InfoList.append(ePartStarLV)
+        
+        # 强化、进化信息包
+        if plusLV or plusProficiency or evolveLV:
+            ePartPlusLV = ChPyNetSendPack.tagMCEquipPartPlusLV()
+            ePartPlusLV.Clear()
+            ePartPlusLV.PackType = packType
+            ePartPlusLV.EquipIndex = index
+            ePartPlusLV.EquipPartStarLV = plusLV
+            ePartPlusLV.Proficiency = plusProficiency
+            ePartPlusLV.EvolveLV = evolveLV
+            ePartPlusLVPack.InfoList.append(ePartPlusLV)
+            
+        # 洗练信息包
+        hasXLValue = False
+        xlAttrList = []
+        for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
+            washValue = ChPyNetSendPack.tagMCEquipPartXLAttrValue()
+            washValue.XLAttrValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (index, attrNum))
+            washValue.XLAttrChange = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValueTemp % (index, attrNum))
+            xlAttrList.append(washValue)
+            if washValue.XLAttrValue or washValue.XLAttrChange:
+                hasXLValue = True
+        if hasXLValue or washLV:
+            ePartXLAttr = ChPyNetSendPack.tagMCEquipPartXLAttr()
+            ePartXLAttr.EquipPlace = index
+            ePartXLAttr.XLAttrLV = washLV
+            ePartXLAttr.XLAttrList = xlAttrList
+            ePartXLAttr.XLAttrCnt = len(ePartXLAttr.XLAttrList)
+            ePartXLPack.InfoList.append(ePartXLAttr)
+            
+        # 宝石信息包
+        stoneCount = len(stoneIDList)
+        if stoneIDList.count(0) != stoneCount:
+            stoneMsg = ChPyNetSendPack.tagMCStoneMsg()
+            stoneMsg.EquipPlace = index
+            stoneMsg.MaxStoneCount = stoneCount 
+            stoneMsg.StoneInfo = stoneIDList
+            stoneMsg.StoneBind = stoneIsBindList
+            ePartStonePack.InfoList.append(stoneMsg)
+            
+    # 通知封包,有值时才通知
+    if ePartStarLVPack.InfoList:
+        ePartStarLVPack.Count = len(ePartStarLVPack.InfoList)
+        NetPackCommon.SendFakePack(curPlayer, ePartStarLVPack)
+    
+    if ePartPlusLVPack.InfoList:
+        ePartPlusLVPack.Count = len(ePartPlusLVPack.InfoList)
+        NetPackCommon.SendFakePack(curPlayer, ePartPlusLVPack)
+    
+    if ePartXLPack.InfoList:
+        ePartXLPack.Count = len(ePartXLPack.InfoList)
+        NetPackCommon.SendFakePack(curPlayer, ePartXLPack)
+        
+    if ePartStonePack.InfoList:
+        ePartStonePack.EquipCount = len(ePartStonePack.InfoList)  
+        NetPackCommon.SendFakePack(curPlayer, ePartStonePack)
+        
+    # 更新统计汇总值
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_EquipOrangeCount, orangeEquipCount)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipStar, totalStar)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusLV, totalPlusLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusEvolveLV, totalEvolveLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipWashLV, totalWashLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalStoneLV, totalStoneLV)
+    GameWorld.DebugLog("登录更新装备相关值汇总: orangeEquipCount=%s,totalStar=%s,totalPlusLV=%s,totalEvolveLV=%s,totalWashLV=%s,totalStoneLV=%s" 
+                       % (orangeEquipCount, totalStar, totalPlusLV, totalEvolveLV, totalWashLV, totalStoneLV)) 
+    return
+
 ## 刷新所有装备对人物属性的改变
 #  @param self 类实例
 #  @return 返回值无意义
@@ -1069,22 +1215,29 @@
     return min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusLV % (packType, index)), maxStarLV)
 
 
-## 获取公共部位强化星级
+## 获取公共部位强化等级
 def GetEquipPartPlusLV(curPlayer, packType, index):
     return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusLV % (packType, index))
 
 
-## 设置公共部位强化星级
-def SetEquipPartPlusLV(curPlayer, packType, index, curEquip, starLV):
-    if GetEquipPartPlusLV(curPlayer, packType, index) == starLV:
+## 设置公共部位强化等级
+def SetEquipPartPlusLV(curPlayer, packType, index, curEquip, setPlusLV):
+    befPlusLV = GetEquipPartPlusLV(curPlayer, packType, index)
+    if befPlusLV == setPlusLV:
         return
     
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusLV % (packType, index), starLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusLV % (packType, index), setPlusLV)
     #===========================================================================
     # if curEquip and not curEquip.IsEmpty():
     #    curEquip.SetItemStarLV(starLV)
     #===========================================================================
-
+    
+    # 同步更新强化总等级
+    befTotalPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusLV)
+    updTotalPlusLV = max(0, befTotalPlusLV + setPlusLV - befPlusLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusLV, updTotalPlusLV)
+    GameWorld.DebugLog("设置强化等级: index=%s,befPlusLV=%s,setPlusLV=%s,befTotalPlusLV=%s,updTotalPlusLV=%s" 
+                       % (index, befPlusLV, setPlusLV, befTotalPlusLV, updTotalPlusLV))
     return
 
 
@@ -1100,10 +1253,18 @@
 
 
 ## 设置公共部位强化进化等级
-def SetEquipPartPlusEvolveLV(curPlayer, packType, index, evolveLV):
-    if GetEquipPartPlusEvolveLV(curPlayer, packType, index) == evolveLV:
+def SetEquipPartPlusEvolveLV(curPlayer, packType, index, setEvolveLV):
+    befEvolveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index))
+    if befEvolveLV == setEvolveLV:
         return
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index), evolveLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index), setEvolveLV)
+    
+    # 同步更新进化总等级
+    befTotalPlusEvolveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusEvolveLV)
+    updTotalPlusEvolveLV = max(0, befTotalPlusEvolveLV + setEvolveLV - befEvolveLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusEvolveLV, updTotalPlusEvolveLV)
+    GameWorld.DebugLog("设置进化等级: index=%s,befEvolveLV=%s,setEvolveLV=%s,befTotalPlusEvolveLV=%s,updTotalPlusEvolveLV=%s" 
+                       % (index, befEvolveLV, setEvolveLV, befTotalPlusEvolveLV, updTotalPlusEvolveLV))
     return
 
 ## 通知公共部位强化等级
@@ -1141,18 +1302,15 @@
 
 ## 全身强化等级
 def GetTotalPlusLV(curPlayer, isActive=True):
-    totalPlusLV = 0
-    equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
-    equipPartIndexList = ChConfig.Pack_EquipPart_CanPlusStar[IPY_GameWorld.rptEquip]
-    for i in equipPartIndexList:
-        if isActive:
-            curEquip = equipPack.GetAt(i)
-            if not curEquip  or curEquip.IsEmpty():
-                continue
-            
-        partStarLV = GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, i)
-        totalPlusLV += partStarLV
-    return totalPlusLV
+    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusLV)
+
+## 全身进化等级
+def GetTotalPlusEvolveLV(curPlayer):
+    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusEvolveLV)
+
+## 全身橙装及以上装备数
+def GetEquipOrangeCount(curPlayer):
+    return curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_EquipOrangeCount)
 
 
 # 获取装备的强化类型
@@ -1187,9 +1345,20 @@
 
 
 
-def SetEquipPartStar(curPlayer, equipPackindex, star):
+def SetEquipPartStar(curPlayer, index, setStarLV):
     #设置公共部位星数
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartStar % equipPackindex, star)
+    
+    befStarLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartStar % index)
+    if befStarLV == setStarLV:
+        return    
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartStar % index, setStarLV)
+    
+    # 同步更新星级总等级
+    befTotalStarLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalEquipStar)
+    updTotalStarLV = max(0, befTotalStarLV + setStarLV - befStarLV)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipStar, updTotalStarLV)
+    GameWorld.DebugLog("设置部位星级: index=%s,befStarLV=%s,setStarLV=%s,befTotalStarLV=%s,updTotalStarLV=%s" 
+                       % (index, befStarLV, setStarLV, befTotalStarLV, updTotalStarLV))
     return
 
 
@@ -1205,15 +1374,7 @@
 
 def GetTotalEquipStars(curPlayer):
     ##获取部位总星数
-    totalStar = 0
-    equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
-    for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, []):
-        for classlv in xrange(1, equipMaxClasslv+1):
-            ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
-            if not ipyData:
-                continue
-            totalStar +=GetEquipPartStar(curPlayer, ipyData.GetGridIndex())
-    return totalStar
+    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalEquipStar)
 
 ## 通知公共部位星数
 def NotifyEquipPartStar(curPlayer, index=None):
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 f1cecf2..02622ea 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -797,26 +797,27 @@
     
     # 计算装备的珍品数量
     def RefreshStartEquipCount(self):
-        curPlayer = self.__Player
-        count = 0
-        equipPack = self.__PlayerEquip
-        for i in xrange(equipPack.GetCount()):
-            curEquip = equipPack.GetAt(i)
-            
-            if curEquip.IsEmpty():
-                continue
-            
-            if not curEquip.GetItemQuality():
-                continue
-            
-            count += 1
-            
-        curPlayer.SetDict(ChConfig.Def_PlayerKey_StartEquipCnt, count)
+#        curPlayer = self.__Player
+#        count = 0
+#        equipPack = self.__PlayerEquip
+#        for i in xrange(equipPack.GetCount()):
+#            curEquip = equipPack.GetAt(i)
+#            
+#            if curEquip.IsEmpty():
+#                continue
+#            
+#            if not curEquip.GetItemQuality():
+#                continue
+#            
+#            count += 1
+#            
+#        curPlayer.SetDict(ChConfig.Def_PlayerKey_StartEquipCnt, count)
         return
     
     def GetStartEquipCount(self):
-        curPlayer = self.__Player
-        return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_StartEquipCnt)
+        return 0
+        #curPlayer = self.__Player
+        #return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_StartEquipCnt)
 
     ## 装备当前物品
     #  @param curItem 当前物品
@@ -834,6 +835,9 @@
         desItemID, desUserData = [0, ''] if equipItem.IsEmpty() else [equipItem.GetItemTypeID(), equipItem.GetUserData()]
         srcItemID, srcUserData = curItem.GetItemTypeID(), curItem.GetUserData()
         
+        befIsOrangeEquip = 1 if (not equipItem.IsEmpty() and equipItem.GetItemColor() >= ChConfig.Def_Quality_Orange) else 0
+        aftIsOrangeEquip = 1 if curItem.GetItemColor() >= ChConfig.Def_Quality_Orange else 0
+        
         #--其他装备物品---
         #itemColor = curItem.GetItemColor()
         result = self.SwitchEquip(curItem, equipPackIndex)
@@ -845,11 +849,21 @@
             EventShell.EventRespons_EquipItem(curPlayer)
             dataDict = {'dotype':'EquipItem', 'desItemID':desItemID, 'desUserData':desUserData,'srcItemID':srcItemID,'srcUserData':srcUserData}
             DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
+            self.__UpdEquipOrangeCount(befIsOrangeEquip, aftIsOrangeEquip)
             
         self.RefreshStartEquipCount()
         return equipPlace if result else -1
     
-
+    def __UpdEquipOrangeCount(self, befIsOrangeEquip, aftIsOrangeEquip):
+        #更新橙装数量
+        curPlayer = self.__Player
+        befEquipOrangeCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_EquipOrangeCount)
+        aftEquipOrangeCount = max(0, befEquipOrangeCount + aftIsOrangeEquip - befIsOrangeEquip)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_EquipOrangeCount, aftEquipOrangeCount)
+        GameWorld.DebugLog("更新橙装及以上件数: befIsOrangeEquip=%s,aftIsOrangeEquip=%s,befEquipOrangeCount=%s,aftEquipOrangeCount=%s" 
+                           % (befIsOrangeEquip, aftIsOrangeEquip, befEquipOrangeCount, aftEquipOrangeCount))
+        return
+    
     ## 替换可以叠加物品逻辑 
     #  @param curEquip 当前装备
     #  @param curItem 当前物品
@@ -938,11 +952,15 @@
         #curEquip.SetIsSoulActive(False)
 #        if curEquip.GetItemStarLV() != 0:
 #            curEquip.SetItemStarLV(0) # 脱下的物品星级设置为0
-            
+        
+        befIsOrangeEquip = 1 if curEquip.GetItemColor() >= ChConfig.Def_Quality_Orange else 0
+        aftIsOrangeEquip = 0
+        
         #背包物品放入仓库
         if not DragItem(curPlayer, IPY_GameWorld.rptEquip, equipIndex, IPY_GameWorld.rptItem, packIndex, curEquipCount):
             return
         self.RefreshStartEquipCount()
+        self.__UpdEquipOrangeCount(befIsOrangeEquip, aftIsOrangeEquip)
         
         # 广播卸装
         if equipIndex in PlayerControl.GetFaceEquipIndexList(curPlayer) or equipPlace in ChConfig.Def_SyncEquipStateByIndex:
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 8d0ac40..2249002 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -550,14 +550,8 @@
     #PK模式
     SyncPKModel(curPlayer)
         
-    #通用强化星级信息
-    ChEquip.NotifyEquipPartPlusLV(curPlayer)
-    ChEquip.NotifyEquipPartStar(curPlayer)
-    Operate_EquipWash.OnEquipWashLogin(curPlayer)
-    #通知套装信息
-    #ChEquip.SyncAllEquipAttrActiveInfo(curPlayer)
-    #装备位宝石镶嵌通知
-    Operate_EquipStone.OnLogin(curPlayer)
+    #装备相关信息
+    ChEquip.OnPlayerEquipLoginLogic(curPlayer)
     
     #大师
     PlayerGreatMaster.MasterOnLogin(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
index 55a738e..db3034b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
@@ -173,6 +173,8 @@
     curPlayerPropDict["EquipShowSwitch"] = curPlayer.GetEquipShowSwitch()
     curPlayerPropDict["EquipShowID"] = __GetEquipShowIDList(curPlayer)
     curPlayerPropDict["ServerGroupID"] = PlayerControl.GetPlayerServerGroupID(curPlayer)
+    curPlayerPropDict["LingGenPoint"] = [PlayerControl.GetMetal(curPlayer), PlayerControl.GetWood(curPlayer), PlayerControl.GetWater(curPlayer), 
+                                         PlayerControl.GetFire(curPlayer), PlayerControl.GetEarth(curPlayer)]
     #仙魔之争所需属性
     curPlayerPropDict["MinAtk"] = curPlayer.GetMinAtk()
     curPlayerPropDict["MaxAtk"] = curPlayer.GetMaxAtk()
@@ -210,6 +212,14 @@
             fightPowerDict["%s" % mfpType] = fightPower
     curPlayerPlusDict["FightPowerDict"] = fightPowerDict
     
+    #装备汇总信息
+    curPlayerPlusDict["EquipOrangeCount"] = ChEquip.GetEquipOrangeCount(curPlayer)
+    curPlayerPlusDict["TotalEquipStar"] = ChEquip.GetTotalEquipStars(curPlayer)
+    curPlayerPlusDict["TotalPlusLV"] = ChEquip.GetTotalPlusLV(curPlayer)
+    curPlayerPlusDict["TotalPlusEvolveLV"] = ChEquip.GetTotalPlusEvolveLV(curPlayer)
+    curPlayerPlusDict["TotalStoneLV"] = Operate_EquipStone.GetTotalStoneLV(curPlayer)
+    curPlayerPlusDict["TotalEquipWashLV"] = Operate_EquipWash.GetTotalEquipWashLV(curPlayer)
+    
     #灵宠数据
     curPlayerPlusDict["Pet"] = __GetPetInfo(curPlayer)
     

--
Gitblit v1.8.0