From 7082741f5912f9e583031d0c2f2bd7f6a75915b2 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 29 六月 2023 17:01:47 +0800
Subject: [PATCH] 9802 9762 【BT9】【后端】藏宝阁修改(古宝碎片支持配置物品效果ID270,获得时自动转化为对应古宝ID碎片个数值; 古宝激活、升星、升级支持配置所需物品存在碎片效果ID时扣除对应碎片)

---
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py |  108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 108 insertions(+), 0 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index b8a04cc..0427aa5 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -20969,6 +20969,114 @@
 
 
 #------------------------------------------------------
+# 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):

--
Gitblit v1.8.0