From c7de89ae0c2999d9d2585dc63df28eac36a443e1 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 04 九月 2024 19:09:09 +0800 Subject: [PATCH] 10249 【越南】【砍树】仙宫(增加累计消耗货币值同步;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 108 insertions(+), 0 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index a84b273..54a6785 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -51088,6 +51088,114 @@ #------------------------------------------------------ +# B1 16 累计消耗货币信息 #tagMCUseMoneyTotalInfo + +class tagMCUseMoneyTotal(Structure): + _pack_ = 1 + _fields_ = [ + ("MoneyType", c_ubyte), # 货币类型,仅同步需要记录的货币类型 + ("UseTotal", 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.MoneyType = 0 + self.UseTotal = 0 + return + + def GetLength(self): + return sizeof(tagMCUseMoneyTotal) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B1 16 累计消耗货币信息 //tagMCUseMoneyTotalInfo: + MoneyType:%d, + UseTotal:%d + '''\ + %( + self.MoneyType, + self.UseTotal + ) + return DumpString + + +class tagMCUseMoneyTotalInfo(Structure): + Head = tagHead() + Count = 0 #(BYTE Count) + InfoList = list() #(vector<tagMCUseMoneyTotal> InfoList) + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x16 + 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): + temInfoList = tagMCUseMoneyTotal() + _pos = temInfoList.ReadData(_lpData, _pos) + self.InfoList.append(temInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x16 + self.Count = 0 + self.InfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.Count): + length += self.InfoList[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.InfoList[i].GetLength(), self.InfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Count:%d, + InfoList:%s + '''\ + %( + self.Head.OutputString(), + self.Count, + "..." + ) + return DumpString + + +m_NAtagMCUseMoneyTotalInfo=tagMCUseMoneyTotalInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCUseMoneyTotalInfo.Head.Cmd,m_NAtagMCUseMoneyTotalInfo.Head.SubCmd))] = m_NAtagMCUseMoneyTotalInfo + + +#------------------------------------------------------ # B1 14 仙宫信息 #tagMCXiangongInfo class tagMCXiangong(Structure): -- Gitblit v1.8.0