From ec19547ca0985de3f1c4045411ee6c171204e535 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 21 十月 2025 19:00:45 +0800
Subject: [PATCH] 297 【常规】坊市系统-服务端(坊市、公会、将魂)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 406 ++++++++++++++-------------------------------------------
1 files changed, 104 insertions(+), 302 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 6366384..5938ce6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -16001,281 +16001,6 @@
#------------------------------------------------------
-# A8 11 商店购买结果 #tagMCShoppingResult
-
-class tagMCShoppingResult(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("ItemIndex", c_int),
- ("ItemCnt", c_int), #购买数量
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xA8
- self.SubCmd = 0x11
- 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 = 0xA8
- self.SubCmd = 0x11
- self.ItemIndex = 0
- self.ItemCnt = 0
- return
-
- def GetLength(self):
- return sizeof(tagMCShoppingResult)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// A8 11 商店购买结果 //tagMCShoppingResult:
- Cmd:%s,
- SubCmd:%s,
- ItemIndex:%d,
- ItemCnt:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.ItemIndex,
- self.ItemCnt
- )
- return DumpString
-
-
-m_NAtagMCShoppingResult=tagMCShoppingResult()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCShoppingResult.Cmd,m_NAtagMCShoppingResult.SubCmd))] = m_NAtagMCShoppingResult
-
-
-#------------------------------------------------------
-# A8 16 神秘商店商品信息 #tagMCMysticalShopInfo
-
-class tagMCMysticalShopGoods(Structure):
- _pack_ = 1
- _fields_ = [
- ("GoodsID", c_int), # 商品ID
- ]
-
- 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.GoodsID = 0
- return
-
- def GetLength(self):
- return sizeof(tagMCMysticalShopGoods)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// A8 16 神秘商店商品信息 //tagMCMysticalShopInfo:
- GoodsID:%d
- '''\
- %(
- self.GoodsID
- )
- return DumpString
-
-
-class tagMCMysticalShopInfo(Structure):
- Head = tagHead()
- RefreshCnt = 0 #(WORD RefreshCnt)// 刷新次数
- Count = 0 #(BYTE Count)// 商品数
- GoodsList = list() #(vector<tagMCMysticalShopGoods> GoodsList)// 商品信息
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xA8
- self.Head.SubCmd = 0x16
- return
-
- def ReadData(self, _lpData, _pos=0, _Len=0):
- self.Clear()
- _pos = self.Head.ReadData(_lpData, _pos)
- self.RefreshCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
- self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- for i in range(self.Count):
- temGoodsList = tagMCMysticalShopGoods()
- _pos = temGoodsList.ReadData(_lpData, _pos)
- self.GoodsList.append(temGoodsList)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xA8
- self.Head.SubCmd = 0x16
- self.RefreshCnt = 0
- self.Count = 0
- self.GoodsList = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 2
- length += 1
- for i in range(self.Count):
- length += self.GoodsList[i].GetLength()
-
- return length
-
- def GetBuffer(self):
- data = ''
- data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
- data = CommFunc.WriteWORD(data, self.RefreshCnt)
- data = CommFunc.WriteBYTE(data, self.Count)
- for i in range(self.Count):
- data = CommFunc.WriteString(data, self.GoodsList[i].GetLength(), self.GoodsList[i].GetBuffer())
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- RefreshCnt:%d,
- Count:%d,
- GoodsList:%s
- '''\
- %(
- self.Head.OutputString(),
- self.RefreshCnt,
- self.Count,
- "..."
- )
- return DumpString
-
-
-m_NAtagMCMysticalShopInfo=tagMCMysticalShopInfo()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMysticalShopInfo.Head.Cmd,m_NAtagMCMysticalShopInfo.Head.SubCmd))] = m_NAtagMCMysticalShopInfo
-
-
-#------------------------------------------------------
-# A8 06 通知神秘限购商品时间 #tagMCMysticalShopTimeInfo
-
-class tagMCMysticalShopTime(Structure):
- _pack_ = 1
- _fields_ = [
- ("GoodsID", c_int), # 商品ID
- ("StartTime", 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.GoodsID = 0
- self.StartTime = 0
- return
-
- def GetLength(self):
- return sizeof(tagMCMysticalShopTime)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// A8 06 通知神秘限购商品时间 //tagMCMysticalShopTimeInfo:
- GoodsID:%d,
- StartTime:%d
- '''\
- %(
- self.GoodsID,
- self.StartTime
- )
- return DumpString
-
-
-class tagMCMysticalShopTimeInfo(Structure):
- Head = tagHead()
- Count = 0 #(WORD Count)// 商品数
- ShopTimeList = list() #(vector<tagMCMysticalShopTime> ShopTimeList)// 商品开卖信息
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xA8
- self.Head.SubCmd = 0x06
- return
-
- def ReadData(self, _lpData, _pos=0, _Len=0):
- self.Clear()
- _pos = self.Head.ReadData(_lpData, _pos)
- self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
- for i in range(self.Count):
- temShopTimeList = tagMCMysticalShopTime()
- _pos = temShopTimeList.ReadData(_lpData, _pos)
- self.ShopTimeList.append(temShopTimeList)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xA8
- self.Head.SubCmd = 0x06
- self.Count = 0
- self.ShopTimeList = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 2
- for i in range(self.Count):
- length += self.ShopTimeList[i].GetLength()
-
- return length
-
- def GetBuffer(self):
- data = ''
- data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
- data = CommFunc.WriteWORD(data, self.Count)
- for i in range(self.Count):
- data = CommFunc.WriteString(data, self.ShopTimeList[i].GetLength(), self.ShopTimeList[i].GetBuffer())
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- Count:%d,
- ShopTimeList:%s
- '''\
- %(
- self.Head.OutputString(),
- self.Count,
- "..."
- )
- return DumpString
-
-
-m_NAtagMCMysticalShopTimeInfo=tagMCMysticalShopTimeInfo()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMysticalShopTimeInfo.Head.Cmd,m_NAtagMCMysticalShopTimeInfo.Head.SubCmd))] = m_NAtagMCMysticalShopTimeInfo
-
-
-#------------------------------------------------------
# A8 10 通知获得物品 #tagMCNotifyUseItemGetItem
class tagMCNotifyUseItemGetItem(Structure):
@@ -16445,14 +16170,13 @@
#------------------------------------------------------
-# A8 02 通知NPC商店物品今日已购买次数 #tagMCShopItemDayBuyCntInfo
+# A8 02 商店物品已购买次数 #tagSCShopItemBuyCntInfo
-class tagMCShopItemDayBuyCnt(Structure):
+class tagSCShopItemBuyCnt(Structure):
_pack_ = 1
_fields_ = [
- ("ItemIndex", c_int),
- ("BuyCnt", c_int), # 今日已购买次数
- ("IsReset", c_ubyte), #是否重置
+ ("ShopID", c_int), # 商品ID
+ ("BuyCnt", c_int), # 已购买次数
]
def __init__(self):
@@ -16465,35 +16189,32 @@
return _pos + self.GetLength()
def Clear(self):
- self.ItemIndex = 0
+ self.ShopID = 0
self.BuyCnt = 0
- self.IsReset = 0
return
def GetLength(self):
- return sizeof(tagMCShopItemDayBuyCnt)
+ return sizeof(tagSCShopItemBuyCnt)
def GetBuffer(self):
return string_at(addressof(self), self.GetLength())
def OutputString(self):
- DumpString = '''// A8 02 通知NPC商店物品今日已购买次数 //tagMCShopItemDayBuyCntInfo:
- ItemIndex:%d,
- BuyCnt:%d,
- IsReset:%d
+ DumpString = '''// A8 02 商店物品已购买次数 //tagSCShopItemBuyCntInfo:
+ ShopID:%d,
+ BuyCnt:%d
'''\
%(
- self.ItemIndex,
- self.BuyCnt,
- self.IsReset
+ self.ShopID,
+ self.BuyCnt
)
return DumpString
-class tagMCShopItemDayBuyCntInfo(Structure):
+class tagSCShopItemBuyCntInfo(Structure):
Head = tagHead()
- Count = 0 #(WORD Count)//通知个数,注意不限制每日购买次数的默认不通知
- DayBuyCntList = list() #(vector<tagMCShopItemDayBuyCnt> DayBuyCntList)
+ Count = 0 #(WORD Count)
+ BuyCntList = list() #(vector<tagSCShopItemBuyCnt> BuyCntList)//仅通知有限购次数的商品
data = None
def __init__(self):
@@ -16507,9 +16228,9 @@
_pos = self.Head.ReadData(_lpData, _pos)
self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
for i in range(self.Count):
- temDayBuyCntList = tagMCShopItemDayBuyCnt()
- _pos = temDayBuyCntList.ReadData(_lpData, _pos)
- self.DayBuyCntList.append(temDayBuyCntList)
+ temBuyCntList = tagSCShopItemBuyCnt()
+ _pos = temBuyCntList.ReadData(_lpData, _pos)
+ self.BuyCntList.append(temBuyCntList)
return _pos
def Clear(self):
@@ -16518,7 +16239,7 @@
self.Head.Cmd = 0xA8
self.Head.SubCmd = 0x02
self.Count = 0
- self.DayBuyCntList = list()
+ self.BuyCntList = list()
return
def GetLength(self):
@@ -16526,7 +16247,7 @@
length += self.Head.GetLength()
length += 2
for i in range(self.Count):
- length += self.DayBuyCntList[i].GetLength()
+ length += self.BuyCntList[i].GetLength()
return length
@@ -16535,14 +16256,14 @@
data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
data = CommFunc.WriteWORD(data, self.Count)
for i in range(self.Count):
- data = CommFunc.WriteString(data, self.DayBuyCntList[i].GetLength(), self.DayBuyCntList[i].GetBuffer())
+ data = CommFunc.WriteString(data, self.BuyCntList[i].GetLength(), self.BuyCntList[i].GetBuffer())
return data
def OutputString(self):
DumpString = '''
Head:%s,
Count:%d,
- DayBuyCntList:%s
+ BuyCntList:%s
'''\
%(
self.Head.OutputString(),
@@ -16552,8 +16273,89 @@
return DumpString
-m_NAtagMCShopItemDayBuyCntInfo=tagMCShopItemDayBuyCntInfo()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCShopItemDayBuyCntInfo.Head.Cmd,m_NAtagMCShopItemDayBuyCntInfo.Head.SubCmd))] = m_NAtagMCShopItemDayBuyCntInfo
+m_NAtagSCShopItemBuyCntInfo=tagSCShopItemBuyCntInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCShopItemBuyCntInfo.Head.Cmd,m_NAtagSCShopItemBuyCntInfo.Head.SubCmd))] = m_NAtagSCShopItemBuyCntInfo
+
+
+#------------------------------------------------------
+# A8 03 商店刷新解锁的商品信息 #tagSCShopRefreshItemInfo
+
+class tagSCShopRefreshItemInfo(Structure):
+ Head = tagHead()
+ ShopType = 0 #(WORD ShopType)// 商店类型
+ RefreshCnt = 0 #(BYTE RefreshCnt)// 今日已刷新次数
+ Count = 0 #(BYTE Count)
+ ShopIDList = list() #(vector<DWORD> ShopIDList)// 对应刷新出来的商店表商品ID列表
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA8
+ self.Head.SubCmd = 0x03
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.ShopType,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.RefreshCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.Count):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.ShopIDList.append(value)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA8
+ self.Head.SubCmd = 0x03
+ self.ShopType = 0
+ self.RefreshCnt = 0
+ self.Count = 0
+ self.ShopIDList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 2
+ length += 1
+ length += 1
+ length += 4 * self.Count
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteWORD(data, self.ShopType)
+ data = CommFunc.WriteBYTE(data, self.RefreshCnt)
+ data = CommFunc.WriteBYTE(data, self.Count)
+ for i in range(self.Count):
+ data = CommFunc.WriteDWORD(data, self.ShopIDList[i])
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ShopType:%d,
+ RefreshCnt:%d,
+ Count:%d,
+ ShopIDList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ShopType,
+ self.RefreshCnt,
+ self.Count,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagSCShopRefreshItemInfo=tagSCShopRefreshItemInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCShopRefreshItemInfo.Head.Cmd,m_NAtagSCShopRefreshItemInfo.Head.SubCmd))] = m_NAtagSCShopRefreshItemInfo
#------------------------------------------------------
--
Gitblit v1.8.0