From 9b1eca8955321ce7ba8a8151f7c5c169da5fbff6 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 06 八月 2025 15:25:29 +0800
Subject: [PATCH] 80 【常规】背包-服务端(去除使用物品多余验证;同步使用物品封包;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
index 872e5f6..e51d59f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
@@ -62,7 +62,7 @@
         self.fightPower = 0 # 阵容总战力
         return
     
-    def UpdLineup(self, heroItemDict, shapeType=0, refreshForce=False):
+    def UpdLineup(self, heroItemDict, shapeType=0, refreshForce=False, syncLineup=True):
         '''变更阵容时更新
         @param heroItemDict: 武将背包索引信息  {itemIndex:posNum, ...}
         @param shapeType: 阵型
@@ -72,6 +72,8 @@
         self.heroItemDict = heroItemDict
         GameWorld.DebugLog("更新阵容: lineupID=%s,%s" % (self.lineupID, heroItemDict), self.playerID)
         self.RefreshLineupAttr(refreshForce)
+        if syncLineup and self.olPlayer.curPlayer:
+            PlayerHero.Sync_Lineup(self.olPlayer.curPlayer, self.lineupID)
         return
     
     def FreeLineupHero(self):
@@ -97,11 +99,14 @@
         return lineupHero
     
     def GetLineupHeroByID(self, heroID):
+        lineupHero = None
         for posNum in self.lineupHeroDict.keys():
-            lineup = self.GetLineupHero(posNum)
-            if lineup.heroID == heroID:
-                return lineup
-        return
+            lineupHero = self.GetLineupHero(posNum)
+            if lineupHero.heroID == heroID:
+                return lineupHero
+        if False:
+            lineupHero = LineupHero()
+        return lineupHero
     
     def GetLineupInfo(self):
         ## 获取阵容信息,即要用到该阵容了,如战斗或者保存缓存信息等
@@ -381,8 +386,9 @@
         # 获取其他绑定该阵容的功能,如红颜、灵兽等
         
         shapeType = lineShapeTypeDict.get(lineupID, 0)
-        lineup.UpdLineup(heroItemDict, shapeType)
+        lineup.UpdLineup(heroItemDict, shapeType, syncLineup=False)
         
+    PlayerHero.Sync_Lineup(curPlayer)
     return
 
 def doCalcAllAttr(curPlayer):

--
Gitblit v1.8.0