9802 9762 【BT9】【后端】藏宝阁修改(古宝碎片支持配置物品效果ID270,获得时自动转化为对应古宝ID碎片个数值; 古宝激活、升星、升级支持配置所需物品存在碎片效果ID时扣除对应碎片)
# Conflicts:
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 CB 古宝碎片信息 #tagMCGubaoPieceInfo
|
| | |
|
| | | class tagMCGubaoPiece(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("GubaoID", c_ushort), |
| | | ("PieceCount", c_int), # 当前碎片个数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.GubaoID = 0
|
| | | self.PieceCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCGubaoPiece)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 CB 古宝碎片信息 //tagMCGubaoPieceInfo:
|
| | | GubaoID:%d,
|
| | | PieceCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.PieceCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCGubaoPieceInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | PieceInfoList = list() #(vector<tagMCGubaoPiece> PieceInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCB
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temPieceInfoList = tagMCGubaoPiece()
|
| | | _pos = temPieceInfoList.ReadData(_lpData, _pos)
|
| | | self.PieceInfoList.append(temPieceInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCB
|
| | | self.Count = 0
|
| | | self.PieceInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.PieceInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.PieceInfoList[i].GetLength(), self.PieceInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | PieceInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCGubaoPieceInfo=tagMCGubaoPieceInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGubaoPieceInfo.Head.Cmd,m_NAtagMCGubaoPieceInfo.Head.SubCmd))] = m_NAtagMCGubaoPieceInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 28 历史累积充值奖励领取记录 #tagMCHistoryReChargeAwardRecord
|
| | |
|
| | | class tagMCHistoryReChargeAwardRecord(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 CB 古宝碎片信息 #tagMCGubaoPieceInfo
|
| | |
|
| | | class tagMCGubaoPiece(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("GubaoID", c_ushort), |
| | | ("PieceCount", c_int), # 当前碎片个数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.GubaoID = 0
|
| | | self.PieceCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCGubaoPiece)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 CB 古宝碎片信息 //tagMCGubaoPieceInfo:
|
| | | GubaoID:%d,
|
| | | PieceCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.PieceCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCGubaoPieceInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | PieceInfoList = list() #(vector<tagMCGubaoPiece> PieceInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCB
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temPieceInfoList = tagMCGubaoPiece()
|
| | | _pos = temPieceInfoList.ReadData(_lpData, _pos)
|
| | | self.PieceInfoList.append(temPieceInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCB
|
| | | self.Count = 0
|
| | | self.PieceInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.PieceInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.PieceInfoList[i].GetLength(), self.PieceInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | PieceInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCGubaoPieceInfo=tagMCGubaoPieceInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGubaoPieceInfo.Head.Cmd,m_NAtagMCGubaoPieceInfo.Head.SubCmd))] = m_NAtagMCGubaoPieceInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 28 历史累积充值奖励领取记录 #tagMCHistoryReChargeAwardRecord
|
| | |
|
| | | class tagMCHistoryReChargeAwardRecord(Structure):
|
| | |
| | | for index in range(ipyDataMgr.GetGubaoCount()): |
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index) |
| | | gubaoID = ipyData.GetGubaoID() |
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gubaoID): |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoPiece % gubaoID, 0) |
| | | if gubaoID not in gubaoIDList: |
| | | gubaoIDList.append(gubaoID) |
| | | _, star = PlayerGubao.GetGubaoLVInfo(curPlayer, gubaoID) |
| | | if not star: |
| | | continue |
| | | gubaoIDList.append(gubaoID) |
| | | if gubaoID not in gubaoIDList: |
| | | gubaoIDList.append(gubaoID) |
| | | PlayerGubao.SetGubaoLVInfo(curPlayer, gubaoID, 0, 0) |
| | | for effType in PlayerGubao.GubaoEffTtemIypeList: |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType), 0) |
| | |
| | | |
| | | PlayerGubao.RefreshGubaoAttr(curPlayer) |
| | | PlayerGubao.Sync_GubaoInfo(curPlayer, gubaoIDList) |
| | | PlayerGubao.Sync_GubaoPieceInfo(curPlayer, gubaoIDList) |
| | | return |
| | | |
| | | |
| | |
| | | import PlayerMagicWeapon
|
| | | import IpyGameDataPY
|
| | | import DataRecordPack
|
| | | import PlayerGubao
|
| | | import EventShell
|
| | | import PlayerVip
|
| | | import ChEquip
|
| | |
| | | tagItem.Clear()
|
| | | return True
|
| | | itemEff = tagItem.GetEffectByIndex(0)
|
| | | #古宝碎片
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_GubaoPiece:
|
| | | gubaoID = itemEff.GetEffectValue(0)
|
| | | if gubaoID:
|
| | | PlayerGubao.AddGubaoPiece(curPlayer, gubaoID, tagItem.GetCount(), itemID)
|
| | | tagItem.Clear()
|
| | | return True
|
| | | #直升VIP
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_VIPLVCard:
|
| | | isAutoUse = itemEff.GetEffectValue(1)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package UseItem.Item_GubaoPiece
|
| | | #
|
| | | # @todo:古宝碎片效果ID
|
| | | # @author hxp
|
| | | # @date 2023-03-31
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 古宝碎片效果ID, A值-古宝ID
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2023-03-31 15:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ItemCommon
|
| | | import PlayerGubao
|
| | | import ChConfig
|
| | |
|
| | | def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
|
| | | ##批量使用物品
|
| | | curEff = curRoleItem.GetEffectByIndex(0)
|
| | | gubaoID = curEff.GetEffectValue(0)
|
| | | curCount, updCount = PlayerGubao.AddGubaoPiece(curPlayer, gubaoID, useCnt, curRoleItem.GetItemTypeID())
|
| | | succCnt = useCnt
|
| | | saveDataDict = {"gubaoID":gubaoID, "curCount":curCount, "updCount":updCount}
|
| | | ItemCommon.DelItem(curPlayer, curRoleItem, succCnt, True, ChConfig.ItemDel_Unknown, saveDataDict, True)
|
| | | return True, succCnt
|
| | |
|
| | |
|
| | |
| | |
|
| | | # 古宝领取物品特殊效果列表
|
| | | GubaoEffTtemIypeList = [GubaoEffType_ActivityPlace, GubaoEffType_Arena, GubaoEffType_KillWorldBoss, GubaoEffType_KillBossHome,
|
| | | GubaoEffType_KillCrossPenglaiBoss, GubaoEffType_KillCrossDemonLandBoss, GubaoEffType_KillSealDemonBoss, |
| | | GubaoEffType_KillCrossPenglaiBoss, GubaoEffType_KillCrossDemonLandBoss, GubaoEffType_KillSealDemonBoss,
|
| | | GubaoEffType_CrossRealmPK,
|
| | | ]
|
| | |
|
| | |
| | | def OnPlayerLogin(curPlayer):
|
| | | Sync_GubaoInfo(curPlayer)
|
| | | Sync_GubaoItemEffInfo(curPlayer)
|
| | | Sync_GubaoPieceInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def AddGubaoPiece(curPlayer, gubaoID, addCount, useItemID):
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gubaoID)
|
| | | updCount = min(curCount + addCount, ChConfig.Def_UpperLimit_DWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoPiece % gubaoID, updCount)
|
| | | Sync_GubaoPieceInfo(curPlayer, [gubaoID])
|
| | | GameWorld.Log("增加古宝碎片: gubaoID=%s,curCount=%s,addCount=%s,updCount=%s,useItemID=%s" |
| | | % (gubaoID, curCount, addCount, updCount, useItemID), curPlayer.GetPlayerID())
|
| | | return curCount, updCount
|
| | |
|
| | | def DelGubaoPiece(curPlayer, gubaoID, delCount, delName):
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gubaoID)
|
| | | if curCount < delCount:
|
| | | return False
|
| | | updCount = curCount - delCount
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoPiece % gubaoID, updCount)
|
| | | Sync_GubaoPieceInfo(curPlayer, [gubaoID])
|
| | | GameWorld.Log("扣除古宝碎片: gubaoID=%s,curCount=%s,delCount=%s,updCount=%s,delName=%s" |
| | | % (gubaoID, curCount, delCount, updCount, delName), curPlayer.GetPlayerID())
|
| | | return True
|
| | |
|
| | | def ParseGubaoNeedItem(curPlayer, needItemList):
|
| | | ## 解析古宝功能所需物品,转化为古宝碎片+物品
|
| | | needPieceInfo, realNeedItemList = {}, []
|
| | | for itemID, itemCount in needItemList:
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | curEff = itemData.GetEffectByIndex(0)
|
| | | effID = curEff.GetEffectID()
|
| | | if effID != ChConfig.Def_Effect_GubaoPiece:
|
| | | realNeedItemList.append([itemID, itemCount])
|
| | | continue
|
| | | gubaoID = curEff.GetEffectValue(0)
|
| | | needPieceInfo[gubaoID] = needPieceInfo.get(gubaoID, 0) + itemCount
|
| | | GameWorld.DebugLog("转化古宝功能所需物品: needItemList=%s,realNeedItemList=%s,needPieceInfo=%s" |
| | | % (needItemList, realNeedItemList, needPieceInfo), curPlayer.GetPlayerID())
|
| | | return needPieceInfo, realNeedItemList
|
| | |
|
| | | #// B2 16 古宝激活 #tagCMGubaoActivate
|
| | | #
|
| | |
| | | GameWorld.DebugLog("古宝已经激活过! gubaoID=%s" % gubaoID, playerID)
|
| | | return
|
| | |
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(needItemID, itemPack, needItemCnt)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog("激活古宝道具不足! needItemID=%s,needItemCnt=%s" % (needItemID, needItemCnt), playerID)
|
| | | return
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemList, needItemCnt, False, "Gubao")
|
| | | |
| | | needPieceInfo, realNeedItemList = ParseGubaoNeedItem(curPlayer, [[needItemID, needItemCnt]])
|
| | | if realNeedItemList:
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(needItemID, itemPack, needItemCnt)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog("激活古宝道具不足! needItemID=%s,needItemCnt=%s" % (needItemID, needItemCnt), playerID)
|
| | | return
|
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gID)
|
| | | if curCount < needPieceCount:
|
| | | GameWorld.DebugLog("激活古宝碎片不足! gubaoID=%s,curCount=%s < needPieceCount=%s" % (gubaoID, curCount, needPieceCount), playerID)
|
| | | return
|
| | | |
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | DelGubaoPiece(curPlayer, gID, needPieceCount, "Activate")
|
| | | if realNeedItemList:
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemList, needItemCnt, False, "Gubao")
|
| | | |
| | | lv, star = 1, 1
|
| | | SetGubaoLVInfo(curPlayer, gubaoID, lv, star)
|
| | | GameWorld.Log("古宝激活成功! gubaoID=%s" % gubaoID, playerID)
|
| | |
| | | if not needItemList:
|
| | | return
|
| | |
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("古宝升星所需物品不足! star=%s,needItemList=%s,lackItemDict=%s" % (star, needItemList, lackItemDict), playerID)
|
| | | return
|
| | | needPieceInfo, realNeedItemList = ParseGubaoNeedItem(curPlayer, needItemList)
|
| | | if realNeedItemList:
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(realNeedItemList, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("古宝升星所需物品不足! star=%s,realNeedItemList=%s,lackItemDict=%s" % (star, realNeedItemList, lackItemDict), playerID)
|
| | | return
|
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gID)
|
| | | if curCount < needPieceCount:
|
| | | GameWorld.DebugLog("古宝升星所需古宝碎片不足! gubaoID=%s,curCount=%s < needPieceCount=%s" % (gubaoID, curCount, needPieceCount), playerID)
|
| | | return
|
| | | |
| | | #扣消耗
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "Gubao")
|
| | | |
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | DelGubaoPiece(curPlayer, gID, needPieceCount, "StarUp")
|
| | | if realNeedItemList:
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "Gubao")
|
| | | |
| | | updStar = star + 1
|
| | | SetGubaoLVInfo(curPlayer, gubaoID, lv, updStar)
|
| | | GameWorld.Log("古宝升星: gubaoID=%s,updStar=%s" % (gubaoID, updStar), playerID)
|
| | |
| | | if not needItemList:
|
| | | return
|
| | |
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("古宝升级所需物品不足! quality=%s,lv=%s,needItemList=%s,lackItemDict=%s" |
| | | % (quality, lv, needItemList, lackItemDict), playerID)
|
| | | return
|
| | | needPieceInfo, realNeedItemList = ParseGubaoNeedItem(curPlayer, needItemList)
|
| | | if realNeedItemList:
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(realNeedItemList, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("古宝升级所需物品不足! quality=%s,lv=%s,realNeedItemList=%s,lackItemDict=%s" |
| | | % (quality, lv, realNeedItemList, lackItemDict), playerID)
|
| | | return
|
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gID)
|
| | | if curCount < needPieceCount:
|
| | | GameWorld.DebugLog("古宝升级所需古宝碎片不足! gubaoID=%s,curCount=%s < needPieceCount=%s" % (gubaoID, curCount, needPieceCount), playerID)
|
| | | return
|
| | | |
| | | #扣消耗
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "Gubao")
|
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | DelGubaoPiece(curPlayer, gID, needPieceCount, "LVUp")
|
| | | if realNeedItemList:
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "Gubao")
|
| | |
|
| | | updLV = lv + 1
|
| | | SetGubaoLVInfo(curPlayer, gubaoID, updLV, star)
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def Sync_GubaoPieceInfo(curPlayer, gubaoIDList=None):
|
| | | if gubaoIDList == None:
|
| | | syncIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in range(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | syncIDList.append(ipyData.GetGubaoID())
|
| | | else:
|
| | | syncIDList = gubaoIDList
|
| | | |
| | | pieceInfoList = []
|
| | | for gubaoID in syncIDList:
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gubaoID)
|
| | | if not curCount and gubaoIDList == None:
|
| | | # 没有指定时只同步有数量的
|
| | | continue
|
| | | gubao = ChPyNetSendPack.tagMCGubaoPiece()
|
| | | gubao.GubaoID = gubaoID
|
| | | gubao.PieceCount = curCount
|
| | | pieceInfoList.append(gubao)
|
| | | |
| | | if not pieceInfoList:
|
| | | return
|
| | | |
| | | clientPack = ChPyNetSendPack.tagMCGubaoPieceInfo()
|
| | | clientPack.PieceInfoList = pieceInfoList
|
| | | clientPack.Count = len(clientPack.PieceInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|