From ec68dabc97521a7706344e7d038e9f08462f4fe8 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 16 十二月 2025 10:26:34 +0800
Subject: [PATCH] 16 卡牌服务端(删除多余备档报错防范;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 259 +++++++++++++++++++++++++++++++--------------------
1 files changed, 155 insertions(+), 104 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 470ff06..07fd443 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -6834,54 +6834,6 @@
#------------------------------------------------------
-# A5 69 刷新寻宝免费次数 #tagCMRefreshTreasureFreeCnt
-
-class tagCMRefreshTreasureFreeCnt(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xA5
- self.SubCmd = 0x69
- 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.Cmd = 0xA5
- self.SubCmd = 0x69
- return
-
- def GetLength(self):
- return sizeof(tagCMRefreshTreasureFreeCnt)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// A5 69 刷新寻宝免费次数 //tagCMRefreshTreasureFreeCnt:
- Cmd:%s,
- SubCmd:%s
- '''\
- %(
- self.Cmd,
- self.SubCmd
- )
- return DumpString
-
-
-m_NAtagCMRefreshTreasureFreeCnt=tagCMRefreshTreasureFreeCnt()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRefreshTreasureFreeCnt.Cmd,m_NAtagCMRefreshTreasureFreeCnt.SubCmd))] = m_NAtagCMRefreshTreasureFreeCnt
-
-
-#------------------------------------------------------
# A5 37 请求邮件操作 #tagCMRequestMail
class tagCMRequestMail(Structure):
@@ -7328,6 +7280,80 @@
m_NAtagCMTakeOutRealmExp=tagCMTakeOutRealmExp()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTakeOutRealmExp.Cmd,m_NAtagCMTakeOutRealmExp.SubCmd))] = m_NAtagCMTakeOutRealmExp
+
+
+#------------------------------------------------------
+# A5 69 寻宝心愿物品选择 #tagCSTreasureWishSelect
+
+class tagCSTreasureWishSelect(Structure):
+ Head = tagHead()
+ TreasureType = 0 #(BYTE TreasureType)//寻宝类型
+ WishCnt = 0 #(BYTE WishCnt)
+ WishIDList = list() #(vector<DWORD> WishIDList)// 选择的寻宝物品库中的数据ID,注意不是库ID
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA5
+ self.Head.SubCmd = 0x69
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.TreasureType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.WishCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.WishCnt):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.WishIDList.append(value)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA5
+ self.Head.SubCmd = 0x69
+ self.TreasureType = 0
+ self.WishCnt = 0
+ self.WishIDList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 1
+ length += 4 * self.WishCnt
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.TreasureType)
+ data = CommFunc.WriteBYTE(data, self.WishCnt)
+ for i in range(self.WishCnt):
+ data = CommFunc.WriteDWORD(data, self.WishIDList[i])
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ TreasureType:%d,
+ WishCnt:%d,
+ WishIDList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.TreasureType,
+ self.WishCnt,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagCSTreasureWishSelect=tagCSTreasureWishSelect()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSTreasureWishSelect.Head.Cmd,m_NAtagCSTreasureWishSelect.Head.SubCmd))] = m_NAtagCSTreasureWishSelect
#------------------------------------------------------
@@ -8958,62 +8984,6 @@
m_NAtagCGFuzzySearchPlayer=tagCGFuzzySearchPlayer()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGFuzzySearchPlayer.Head.Cmd,m_NAtagCGFuzzySearchPlayer.Head.SubCmd))] = m_NAtagCGFuzzySearchPlayer
-
-
-#------------------------------------------------------
-# A9 01 获取Boss首杀奖励 #tagCGGetBossFirstKillAward
-
-class tagCGGetBossFirstKillAward(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("NPCID", c_int),
- ("AwardType", c_ubyte), # 0-首杀红包奖励;1-个人首杀奖励
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xA9
- self.SubCmd = 0x01
- 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.Cmd = 0xA9
- self.SubCmd = 0x01
- self.NPCID = 0
- self.AwardType = 0
- return
-
- def GetLength(self):
- return sizeof(tagCGGetBossFirstKillAward)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// A9 01 获取Boss首杀奖励 //tagCGGetBossFirstKillAward:
- Cmd:%s,
- SubCmd:%s,
- NPCID:%d,
- AwardType:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.NPCID,
- self.AwardType
- )
- return DumpString
-
-
-m_NAtagCGGetBossFirstKillAward=tagCGGetBossFirstKillAward()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGGetBossFirstKillAward.Cmd,m_NAtagCGGetBossFirstKillAward.SubCmd))] = m_NAtagCGGetBossFirstKillAward
#------------------------------------------------------
@@ -11916,6 +11886,87 @@
#------------------------------------------------------
+# B2 41 武将宿缘 #tagCSHeroFates
+
+class tagCSHeroFates(Structure):
+ Head = tagHead()
+ FatesID = 0 #(BYTE FatesID)// 宿缘ID
+ OPType = 0 #(BYTE OPType)// 0-激活领奖;1-升级
+ IndexCnt = 0 #(BYTE IndexCnt)
+ ItemIndexList = list() #(vector<WORD> ItemIndexList)// 升级时消耗的材料卡在武将背包索引列表,升级时才发
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xB2
+ self.Head.SubCmd = 0x41
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.FatesID,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.OPType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.IndexCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.IndexCnt):
+ value,_pos=CommFunc.ReadWORD(_lpData,_pos)
+ self.ItemIndexList.append(value)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xB2
+ self.Head.SubCmd = 0x41
+ self.FatesID = 0
+ self.OPType = 0
+ self.IndexCnt = 0
+ self.ItemIndexList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 1
+ length += 1
+ length += 2 * self.IndexCnt
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.FatesID)
+ data = CommFunc.WriteBYTE(data, self.OPType)
+ data = CommFunc.WriteBYTE(data, self.IndexCnt)
+ for i in range(self.IndexCnt):
+ data = CommFunc.WriteWORD(data, self.ItemIndexList[i])
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ FatesID:%d,
+ OPType:%d,
+ IndexCnt:%d,
+ ItemIndexList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.FatesID,
+ self.OPType,
+ self.IndexCnt,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagCSHeroFates=tagCSHeroFates()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroFates.Head.Cmd,m_NAtagCSHeroFates.Head.SubCmd))] = m_NAtagCSHeroFates
+
+
+#------------------------------------------------------
# B2 38 武将锁定 #tagCSHeroLock
class tagCSHeroLock(Structure):
--
Gitblit v1.8.0