From 0a6ffef4ba4593b8a112981b3e0be438889202e1 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 29 九月 2025 15:53:55 +0800 Subject: [PATCH] 16 卡牌服务端(修改GM命令Mail中物品,包含货币、装备、武将、常规物品;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 868 +++------------------------------------------------------ 1 files changed, 55 insertions(+), 813 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index fd93a81..45da1bb 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -5370,114 +5370,6 @@ #------------------------------------------------------ -#A3 0A 副本鼓舞信息通知 #tagMCFBEncourageInfo - -class tagMCFBEncourageCnt(Structure): - _pack_ = 1 - _fields_ = [ - ("MoneyType", c_ubyte), # 金钱类型 - ("EncourageCnt", c_ubyte), # 当前鼓舞次数 - ] - - 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.EncourageCnt = 0 - return - - def GetLength(self): - return sizeof(tagMCFBEncourageCnt) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''//A3 0A 副本鼓舞信息通知 //tagMCFBEncourageInfo: - MoneyType:%d, - EncourageCnt:%d - '''\ - %( - self.MoneyType, - self.EncourageCnt - ) - return DumpString - - -class tagMCFBEncourageInfo(Structure): - Head = tagHead() - Cnt = 0 #(BYTE Cnt)// - InfoList = list() #(vector<tagMCFBEncourageCnt> InfoList)// 次数信息 - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xA3 - self.Head.SubCmd = 0x0A - return - - def ReadData(self, _lpData, _pos=0, _Len=0): - self.Clear() - _pos = self.Head.ReadData(_lpData, _pos) - self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) - for i in range(self.Cnt): - temInfoList = tagMCFBEncourageCnt() - _pos = temInfoList.ReadData(_lpData, _pos) - self.InfoList.append(temInfoList) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xA3 - self.Head.SubCmd = 0x0A - self.Cnt = 0 - self.InfoList = list() - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - for i in range(self.Cnt): - 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.Cnt) - for i in range(self.Cnt): - data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer()) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - Cnt:%d, - InfoList:%s - '''\ - %( - self.Head.OutputString(), - self.Cnt, - "..." - ) - return DumpString - - -m_NAtagMCFBEncourageInfo=tagMCFBEncourageInfo() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBEncourageInfo.Head.Cmd,m_NAtagMCFBEncourageInfo.Head.SubCmd))] = m_NAtagMCFBEncourageInfo - - -#------------------------------------------------------ #A3 04 玩家扫荡信息 #tagMCFBWipeOutData class tagMCFBData(Structure): @@ -8968,130 +8860,6 @@ m_NAtagMCRealmExpInfo=tagMCRealmExpInfo() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCRealmExpInfo.Cmd,m_NAtagMCRealmExpInfo.SubCmd))] = m_NAtagMCRealmExpInfo - - -#------------------------------------------------------ -# A3 49 资源找回次数 #tagMCRecoverNum - -class tagMCRecoverNumInfo(Structure): - _pack_ = 1 - _fields_ = [ - ("Index", c_ubyte), # 找回项索引 - ("RecoverCnt", c_ubyte), # 可找回次数 - ("ExtraCnt", c_ubyte), # VIP额外次数 - ("ExtraData", c_ubyte), # 额外参数1 - ("ExtraData2", c_ubyte), # 额外参数2 - ("HaveRecover", c_ubyte), # 已找回 1-全部已找回 2-非VIP已找回 - ] - - 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.Index = 0 - self.RecoverCnt = 0 - self.ExtraCnt = 0 - self.ExtraData = 0 - self.ExtraData2 = 0 - self.HaveRecover = 0 - return - - def GetLength(self): - return sizeof(tagMCRecoverNumInfo) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// A3 49 资源找回次数 //tagMCRecoverNum: - Index:%d, - RecoverCnt:%d, - ExtraCnt:%d, - ExtraData:%d, - ExtraData2:%d, - HaveRecover:%d - '''\ - %( - self.Index, - self.RecoverCnt, - self.ExtraCnt, - self.ExtraData, - self.ExtraData2, - self.HaveRecover - ) - return DumpString - - -class tagMCRecoverNum(Structure): - Head = tagHead() - Num = 0 #(BYTE Num)// 找回信息数 - NumInfo = list() #(vector<tagMCRecoverNumInfo> NumInfo)// 找回信息列表 - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xA3 - self.Head.SubCmd = 0x49 - return - - def ReadData(self, _lpData, _pos=0, _Len=0): - self.Clear() - _pos = self.Head.ReadData(_lpData, _pos) - self.Num,_pos = CommFunc.ReadBYTE(_lpData, _pos) - for i in range(self.Num): - temNumInfo = tagMCRecoverNumInfo() - _pos = temNumInfo.ReadData(_lpData, _pos) - self.NumInfo.append(temNumInfo) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xA3 - self.Head.SubCmd = 0x49 - self.Num = 0 - self.NumInfo = list() - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - for i in range(self.Num): - length += self.NumInfo[i].GetLength() - - return length - - def GetBuffer(self): - data = '' - data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) - data = CommFunc.WriteBYTE(data, self.Num) - for i in range(self.Num): - data = CommFunc.WriteString(data, self.NumInfo[i].GetLength(), self.NumInfo[i].GetBuffer()) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - Num:%d, - NumInfo:%s - '''\ - %( - self.Head.OutputString(), - self.Num, - "..." - ) - return DumpString - - -m_NAtagMCRecoverNum=tagMCRecoverNum() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCRecoverNum.Head.Cmd,m_NAtagMCRecoverNum.Head.SubCmd))] = m_NAtagMCRecoverNum #------------------------------------------------------ @@ -16243,114 +16011,6 @@ m_NAtagMCEmojiPackInfo=tagMCEmojiPackInfo() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCEmojiPackInfo.Head.Cmd,m_NAtagMCEmojiPackInfo.Head.SubCmd))] = m_NAtagMCEmojiPackInfo - - -#------------------------------------------------------ -# A7 03 通知进入副本时间 #tagMCFBEnterTickList - -class tagMCFBEnterTick(Structure): - _pack_ = 1 - _fields_ = [ - ("MapID", c_int), # 副本地图id - ("LastEnterTick", 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.MapID = 0 - self.LastEnterTick = 0 - return - - def GetLength(self): - return sizeof(tagMCFBEnterTick) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// A7 03 通知进入副本时间 //tagMCFBEnterTickList: - MapID:%d, - LastEnterTick:%d - '''\ - %( - self.MapID, - self.LastEnterTick - ) - return DumpString - - -class tagMCFBEnterTickList(Structure): - Head = tagHead() - Cnt = 0 #(BYTE Cnt)// 信息个数 - EnterTickList = list() #(vector<tagMCFBEnterTick> EnterTickList)// 信息列表 - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xA7 - self.Head.SubCmd = 0x03 - return - - def ReadData(self, _lpData, _pos=0, _Len=0): - self.Clear() - _pos = self.Head.ReadData(_lpData, _pos) - self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) - for i in range(self.Cnt): - temEnterTickList = tagMCFBEnterTick() - _pos = temEnterTickList.ReadData(_lpData, _pos) - self.EnterTickList.append(temEnterTickList) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xA7 - self.Head.SubCmd = 0x03 - self.Cnt = 0 - self.EnterTickList = list() - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - for i in range(self.Cnt): - length += self.EnterTickList[i].GetLength() - - return length - - def GetBuffer(self): - data = '' - data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) - data = CommFunc.WriteBYTE(data, self.Cnt) - for i in range(self.Cnt): - data = CommFunc.WriteString(data, self.EnterTickList[i].GetLength(), self.EnterTickList[i].GetBuffer()) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - Cnt:%d, - EnterTickList:%s - '''\ - %( - self.Head.OutputString(), - self.Cnt, - "..." - ) - return DumpString - - -m_NAtagMCFBEnterTickList=tagMCFBEnterTickList() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBEnterTickList.Head.Cmd,m_NAtagMCFBEnterTickList.Head.SubCmd))] = m_NAtagMCFBEnterTickList #------------------------------------------------------ @@ -30983,22 +30643,17 @@ #------------------------------------------------------ -# AA 02 首充信息 #tagMCFirstGoldInfo +# AA 02 首充信息 #tagSCFirstChargeInfo -class tagMCFirstGoldInfo(Structure): +class tagSCFirstCharge(Structure): _pack_ = 1 _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("FirstGoldRewardState", c_ubyte), #首充奖励领奖记录,按位记录首充第X天是否已领取,第1天为第0索引位 - ("FirstGoldTry", c_ubyte), #首充试用状态0-不可试用 1-可试用 2-已试用 - ("FirstGoldServerDay", c_ushort), #首充时是开服第几天,从1开始,0代表未记录充值 + ("ChargeTime", c_int), #充值该首充的时间戳 + ("AwardRecord", c_ushort), #首充奖励领奖记录,按二进制位记录首充第X天是否已领取 ] def __init__(self): self.Clear() - self.Cmd = 0xAA - self.SubCmd = 0x02 return def ReadData(self, stringData, _pos=0, _len=0): @@ -31007,91 +30662,92 @@ return _pos + self.GetLength() def Clear(self): - self.Cmd = 0xAA - self.SubCmd = 0x02 - self.FirstGoldRewardState = 0 - self.FirstGoldTry = 0 - self.FirstGoldServerDay = 0 + self.ChargeTime = 0 + self.AwardRecord = 0 return def GetLength(self): - return sizeof(tagMCFirstGoldInfo) + return sizeof(tagSCFirstCharge) def GetBuffer(self): return string_at(addressof(self), self.GetLength()) def OutputString(self): - DumpString = '''// AA 02 首充信息 //tagMCFirstGoldInfo: - Cmd:%s, - SubCmd:%s, - FirstGoldRewardState:%d, - FirstGoldTry:%d, - FirstGoldServerDay:%d + DumpString = '''// AA 02 首充信息 //tagSCFirstChargeInfo: + ChargeTime:%d, + AwardRecord:%d '''\ %( - self.Cmd, - self.SubCmd, - self.FirstGoldRewardState, - self.FirstGoldTry, - self.FirstGoldServerDay + self.ChargeTime, + self.AwardRecord ) return DumpString -m_NAtagMCFirstGoldInfo=tagMCFirstGoldInfo() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFirstGoldInfo.Cmd,m_NAtagMCFirstGoldInfo.SubCmd))] = m_NAtagMCFirstGoldInfo - - -#------------------------------------------------------ -# AA 08 首充提示剩余时间 #tagMCFirstGoldTime - -class tagMCFirstGoldTime(Structure): - _pack_ = 1 - _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("FirstGoldRemainTime", c_int), #首充提示剩余时间 - ] +class tagSCFirstChargeInfo(Structure): + Head = tagHead() + Count = 0 #(BYTE Count) + FirstChargeList = list() #(vector<tagSCFirstCharge> FirstChargeList) + data = None def __init__(self): self.Clear() - self.Cmd = 0xAA - self.SubCmd = 0x08 + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x02 return - def ReadData(self, stringData, _pos=0, _len=0): + def ReadData(self, _lpData, _pos=0, _Len=0): self.Clear() - memmove(addressof(self), stringData[_pos:], self.GetLength()) - return _pos + self.GetLength() + _pos = self.Head.ReadData(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temFirstChargeList = tagSCFirstCharge() + _pos = temFirstChargeList.ReadData(_lpData, _pos) + self.FirstChargeList.append(temFirstChargeList) + return _pos def Clear(self): - self.Cmd = 0xAA - self.SubCmd = 0x08 - self.FirstGoldRemainTime = 0 + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x02 + self.Count = 0 + self.FirstChargeList = list() return def GetLength(self): - return sizeof(tagMCFirstGoldTime) + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.Count): + length += self.FirstChargeList[i].GetLength() + + return length def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) + 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.FirstChargeList[i].GetLength(), self.FirstChargeList[i].GetBuffer()) + return data def OutputString(self): - DumpString = '''// AA 08 首充提示剩余时间 //tagMCFirstGoldTime: - Cmd:%s, - SubCmd:%s, - FirstGoldRemainTime:%d + DumpString = ''' + Head:%s, + Count:%d, + FirstChargeList:%s '''\ %( - self.Cmd, - self.SubCmd, - self.FirstGoldRemainTime + self.Head.OutputString(), + self.Count, + "..." ) return DumpString -m_NAtagMCFirstGoldTime=tagMCFirstGoldTime() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFirstGoldTime.Cmd,m_NAtagMCFirstGoldTime.SubCmd))] = m_NAtagMCFirstGoldTime +m_NAtagSCFirstChargeInfo=tagSCFirstChargeInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCFirstChargeInfo.Head.Cmd,m_NAtagSCFirstChargeInfo.Head.SubCmd))] = m_NAtagSCFirstChargeInfo #------------------------------------------------------ @@ -39174,230 +38830,6 @@ #------------------------------------------------------ -# B2 15 副本买buff信息通知 #tagMCFBBuyBuffInfo - -class tagMCFBBuyBuffTime(Structure): - _pack_ = 1 - _fields_ = [ - ("MapID", c_int), - ("MoneyCnt", c_ushort), - ("BuyTime", 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.MapID = 0 - self.MoneyCnt = 0 - self.BuyTime = 0 - return - - def GetLength(self): - return sizeof(tagMCFBBuyBuffTime) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// B2 15 副本买buff信息通知 //tagMCFBBuyBuffInfo: - MapID:%d, - MoneyCnt:%d, - BuyTime:%d - '''\ - %( - self.MapID, - self.MoneyCnt, - self.BuyTime - ) - return DumpString - - -class tagMCFBBuyBuffInfo(Structure): - Head = tagHead() - Cnt = 0 #(BYTE Cnt) - InfoList = list() #(vector<tagMCFBBuyBuffTime> InfoList) - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x15 - return - - def ReadData(self, _lpData, _pos=0, _Len=0): - self.Clear() - _pos = self.Head.ReadData(_lpData, _pos) - self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) - for i in range(self.Cnt): - temInfoList = tagMCFBBuyBuffTime() - _pos = temInfoList.ReadData(_lpData, _pos) - self.InfoList.append(temInfoList) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x15 - self.Cnt = 0 - self.InfoList = list() - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - for i in range(self.Cnt): - 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.Cnt) - for i in range(self.Cnt): - data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer()) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - Cnt:%d, - InfoList:%s - '''\ - %( - self.Head.OutputString(), - self.Cnt, - "..." - ) - return DumpString - - -m_NAtagMCFBBuyBuffInfo=tagMCFBBuyBuffInfo() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBBuyBuffInfo.Head.Cmd,m_NAtagMCFBBuyBuffInfo.Head.SubCmd))] = m_NAtagMCFBBuyBuffInfo - - -#------------------------------------------------------ -# B2 09 副本次数恢复剩余时间 #tagMCFBCntRegainRemainTime - -class tagMCFBCntRegain(Structure): - _pack_ = 1 - _fields_ = [ - ("DataMapID", c_int), # 地图ID - ("RemainTime", c_int), # 剩余时间秒 - ("RegainCnt", c_ubyte), # 今日已恢复次数 - ] - - 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.DataMapID = 0 - self.RemainTime = 0 - self.RegainCnt = 0 - return - - def GetLength(self): - return sizeof(tagMCFBCntRegain) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// B2 09 副本次数恢复剩余时间 //tagMCFBCntRegainRemainTime: - DataMapID:%d, - RemainTime:%d, - RegainCnt:%d - '''\ - %( - self.DataMapID, - self.RemainTime, - self.RegainCnt - ) - return DumpString - - -class tagMCFBCntRegainRemainTime(Structure): - Head = tagHead() - Cnt = 0 #(BYTE Cnt)// 信息数 - InfoList = list() #(vector<tagMCFBCntRegain> InfoList)// 信息列表 - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x09 - return - - def ReadData(self, _lpData, _pos=0, _Len=0): - self.Clear() - _pos = self.Head.ReadData(_lpData, _pos) - self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) - for i in range(self.Cnt): - temInfoList = tagMCFBCntRegain() - _pos = temInfoList.ReadData(_lpData, _pos) - self.InfoList.append(temInfoList) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x09 - self.Cnt = 0 - self.InfoList = list() - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - for i in range(self.Cnt): - 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.Cnt) - for i in range(self.Cnt): - data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer()) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - Cnt:%d, - InfoList:%s - '''\ - %( - self.Head.OutputString(), - self.Cnt, - "..." - ) - return DumpString - - -m_NAtagMCFBCntRegainRemainTime=tagMCFBCntRegainRemainTime() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBCntRegainRemainTime.Head.Cmd,m_NAtagMCFBCntRegainRemainTime.Head.SubCmd))] = m_NAtagMCFBCntRegainRemainTime - - -#------------------------------------------------------ # B2 01 通知封魔坛双倍击杀状态 #tagMCFMTDoubleState class tagMCFMTDoubleState(Structure): @@ -39451,196 +38883,6 @@ m_NAtagMCFMTDoubleState=tagMCFMTDoubleState() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFMTDoubleState.Cmd,m_NAtagMCFMTDoubleState.SubCmd))] = m_NAtagMCFMTDoubleState - - -#------------------------------------------------------ -# B2 03 公共副本扫荡信息 #tagMCPubFBSweepData - -class tagMCPubFBSweep(Structure): - _pack_ = 1 - _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("PubNum", c_ubyte), # 公共组编号 - ("FBMapID", c_int), # 当前扫荡的副本地图ID - ("LineID", c_ushort), # lineID - ("SweepTime", c_int), # 开始扫荡的时间 - ("SweepCnt", c_ubyte), # 扫荡次数 - ] - - def __init__(self): - self.Clear() - self.Cmd = 0xB2 - self.SubCmd = 0x03 - 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 = 0xB2 - self.SubCmd = 0x03 - self.PubNum = 0 - self.FBMapID = 0 - self.LineID = 0 - self.SweepTime = 0 - self.SweepCnt = 0 - return - - def GetLength(self): - return sizeof(tagMCPubFBSweep) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// B2 03 公共副本扫荡信息 //tagMCPubFBSweepData: - Cmd:%s, - SubCmd:%s, - PubNum:%d, - FBMapID:%d, - LineID:%d, - SweepTime:%d, - SweepCnt:%d - '''\ - %( - self.Cmd, - self.SubCmd, - self.PubNum, - self.FBMapID, - self.LineID, - self.SweepTime, - self.SweepCnt - ) - return DumpString - - -class tagMCPubFBSweepData(Structure): - Head = tagHead() - Cnt = 0 #(BYTE Cnt)// 信息数 - SweepDatList = list() #(vector<tagMCPubFBSweep> SweepDatList)// 信息列表 - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x03 - return - - def ReadData(self, _lpData, _pos=0, _Len=0): - self.Clear() - _pos = self.Head.ReadData(_lpData, _pos) - self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) - for i in range(self.Cnt): - temSweepDatList = tagMCPubFBSweep() - _pos = temSweepDatList.ReadData(_lpData, _pos) - self.SweepDatList.append(temSweepDatList) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x03 - self.Cnt = 0 - self.SweepDatList = list() - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - for i in range(self.Cnt): - length += self.SweepDatList[i].GetLength() - - return length - - def GetBuffer(self): - data = '' - data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) - data = CommFunc.WriteBYTE(data, self.Cnt) - for i in range(self.Cnt): - data = CommFunc.WriteString(data, self.SweepDatList[i].GetLength(), self.SweepDatList[i].GetBuffer()) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - Cnt:%d, - SweepDatList:%s - '''\ - %( - self.Head.OutputString(), - self.Cnt, - "..." - ) - return DumpString - - -m_NAtagMCPubFBSweepData=tagMCPubFBSweepData() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPubFBSweepData.Head.Cmd,m_NAtagMCPubFBSweepData.Head.SubCmd))] = m_NAtagMCPubFBSweepData - - -#------------------------------------------------------ -# B2 16 开始自定义场景结果 #tagMCStartCustomSceneResult - -class tagMCStartCustomSceneResult(Structure): - _pack_ = 1 - _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("MapID", c_int), - ("FuncLineID", c_ushort), - ("Result", c_ubyte), #是否允许 - ] - - def __init__(self): - self.Clear() - self.Cmd = 0xB2 - self.SubCmd = 0x16 - 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 = 0xB2 - self.SubCmd = 0x16 - self.MapID = 0 - self.FuncLineID = 0 - self.Result = 0 - return - - def GetLength(self): - return sizeof(tagMCStartCustomSceneResult) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// B2 16 开始自定义场景结果 //tagMCStartCustomSceneResult: - Cmd:%s, - SubCmd:%s, - MapID:%d, - FuncLineID:%d, - Result:%d - '''\ - %( - self.Cmd, - self.SubCmd, - self.MapID, - self.FuncLineID, - self.Result - ) - return DumpString - - -m_NAtagMCStartCustomSceneResult=tagMCStartCustomSceneResult() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCStartCustomSceneResult.Cmd,m_NAtagMCStartCustomSceneResult.SubCmd))] = m_NAtagMCStartCustomSceneResult #------------------------------------------------------ -- Gitblit v1.8.0