From a7ab0247c7b8eff06ad104bee39bc035384ca43e Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 23 七月 2025 12:08:22 +0800 Subject: [PATCH] 80 【常规】背包-服务端(增加背包购买格子;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 1056 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 827 insertions(+), 229 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index bad86e4..4ddf44f 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -3252,6 +3252,114 @@ #------------------------------------------------------ +# A2 07 背包购买格子信息 #tagSCPackBuyInfo + +class tagSCPackBuy(Structure): + _pack_ = 1 + _fields_ = [ + ("PackType", c_ubyte), # 背包类型 + ("BuyCnt", c_ushort), # 已购买次数 + ] + + 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.PackType = 0 + self.BuyCnt = 0 + return + + def GetLength(self): + return sizeof(tagSCPackBuy) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A2 07 背包购买格子信息 //tagSCPackBuyInfo: + PackType:%d, + BuyCnt:%d + '''\ + %( + self.PackType, + self.BuyCnt + ) + return DumpString + + +class tagSCPackBuyInfo(Structure): + Head = tagHead() + Count = 0 #(BYTE Count) + BuyInfoList = list() #(vector<tagSCPackBuy> BuyInfoList) + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA2 + self.Head.SubCmd = 0x07 + 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): + temBuyInfoList = tagSCPackBuy() + _pos = temBuyInfoList.ReadData(_lpData, _pos) + self.BuyInfoList.append(temBuyInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA2 + self.Head.SubCmd = 0x07 + self.Count = 0 + self.BuyInfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.Count): + length += self.BuyInfoList[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.BuyInfoList[i].GetLength(), self.BuyInfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Count:%d, + BuyInfoList:%s + '''\ + %( + self.Head.OutputString(), + self.Count, + "..." + ) + return DumpString + + +m_NAtagSCPackBuyInfo=tagSCPackBuyInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCPackBuyInfo.Head.Cmd,m_NAtagSCPackBuyInfo.Head.SubCmd))] = m_NAtagSCPackBuyInfo + + +#------------------------------------------------------ # A2 05 虚拟背包物品清空 #tagMCVPackClear class tagMCVPackClear(Structure): @@ -3870,122 +3978,6 @@ m_NAtagMCArrestTaskInfo=tagMCArrestTaskInfo() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCArrestTaskInfo.Head.Cmd,m_NAtagMCArrestTaskInfo.Head.SubCmd))] = m_NAtagMCArrestTaskInfo - - -#------------------------------------------------------ -# A3 39 玩家属性果实已使用个数信息#tagMCAttrFruitEatCntList - -class tagMCAttrFruitEatCnt(Structure): - _pack_ = 1 - _fields_ = [ - ("ItemID", c_int), #果实物品ID - ("EatCnt", c_int), #已使用个数 - ("ItemAddCnt", c_int), #增幅丹增加上限 - ("ItemBreakCnt", 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.ItemID = 0 - self.EatCnt = 0 - self.ItemAddCnt = 0 - self.ItemBreakCnt = 0 - return - - def GetLength(self): - return sizeof(tagMCAttrFruitEatCnt) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// A3 39 玩家属性果实已使用个数信息//tagMCAttrFruitEatCntList: - ItemID:%d, - EatCnt:%d, - ItemAddCnt:%d, - ItemBreakCnt:%d - '''\ - %( - self.ItemID, - self.EatCnt, - self.ItemAddCnt, - self.ItemBreakCnt - ) - return DumpString - - -class tagMCAttrFruitEatCntList(Structure): - Head = tagHead() - count = 0 #(BYTE count)//信息个数 - EatCntList = list() #(vector<tagMCAttrFruitEatCnt> EatCntList) - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xA3 - self.Head.SubCmd = 0x39 - 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): - temEatCntList = tagMCAttrFruitEatCnt() - _pos = temEatCntList.ReadData(_lpData, _pos) - self.EatCntList.append(temEatCntList) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xA3 - self.Head.SubCmd = 0x39 - self.count = 0 - self.EatCntList = list() - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - for i in range(self.count): - length += self.EatCntList[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.EatCntList[i].GetLength(), self.EatCntList[i].GetBuffer()) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - count:%d, - EatCntList:%s - '''\ - %( - self.Head.OutputString(), - self.count, - "..." - ) - return DumpString - - -m_NAtagMCAttrFruitEatCntList=tagMCAttrFruitEatCntList() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCAttrFruitEatCntList.Head.Cmd,m_NAtagMCAttrFruitEatCntList.Head.SubCmd))] = m_NAtagMCAttrFruitEatCntList #------------------------------------------------------ @@ -43549,6 +43541,114 @@ #------------------------------------------------------ +# B1 23 每日掉落战利品信息 #tagSCDropBootyInfo + +class tagSCDropBooty(Structure): + _pack_ = 1 + _fields_ = [ + ("ItemID", c_int), # 战利品ID + ("TodayDropCnt", 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.ItemID = 0 + self.TodayDropCnt = 0 + return + + def GetLength(self): + return sizeof(tagSCDropBooty) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B1 23 每日掉落战利品信息 //tagSCDropBootyInfo: + ItemID:%d, + TodayDropCnt:%d + '''\ + %( + self.ItemID, + self.TodayDropCnt + ) + return DumpString + + +class tagSCDropBootyInfo(Structure): + Head = tagHead() + Count = 0 #(WORD Count) + DropBootyList = list() #(vector<tagSCDropBooty> DropBootyList)//每日已掉落战利品信息列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x23 + 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): + temDropBootyList = tagSCDropBooty() + _pos = temDropBootyList.ReadData(_lpData, _pos) + self.DropBootyList.append(temDropBootyList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x23 + self.Count = 0 + self.DropBootyList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 2 + for i in range(self.Count): + length += self.DropBootyList[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.DropBootyList[i].GetLength(), self.DropBootyList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Count:%d, + DropBootyList:%s + '''\ + %( + self.Head.OutputString(), + self.Count, + "..." + ) + return DumpString + + +m_NAtagSCDropBootyInfo=tagSCDropBootyInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCDropBootyInfo.Head.Cmd,m_NAtagSCDropBootyInfo.Head.SubCmd))] = m_NAtagSCDropBootyInfo + + +#------------------------------------------------------ # B1 17 头像信息 #tagMCFaceInfo class tagMCFace(Structure): @@ -46528,94 +46628,6 @@ m_NAtagMCHelpBattleRecordList=tagMCHelpBattleRecordList() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCHelpBattleRecordList.Head.Cmd,m_NAtagMCHelpBattleRecordList.Head.SubCmd))] = m_NAtagMCHelpBattleRecordList - - -#------------------------------------------------------ -# B2 04 冰晶矿脉信息通知 #tagMCIceLodeInfo - -class tagMCIceLodeInfo(Structure): - Head = tagHead() - Cnt = 0 #(BYTE Cnt)// 今日玩法数量 - LineList = list() #(vector<BYTE> LineList)// 玩法列表 - AwardRecord = 0 #(DWORD AwardRecord)// 领奖记录 - HasSweep = 0 #(BYTE HasSweep)// 是否已扫荡 - DayLV = 0 #(WORD DayLV)// 今日等级 - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x04 - 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): - value,_pos=CommFunc.ReadBYTE(_lpData,_pos) - self.LineList.append(value) - self.AwardRecord,_pos = CommFunc.ReadDWORD(_lpData, _pos) - self.HasSweep,_pos = CommFunc.ReadBYTE(_lpData, _pos) - self.DayLV,_pos = CommFunc.ReadWORD(_lpData, _pos) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x04 - self.Cnt = 0 - self.LineList = list() - self.AwardRecord = 0 - self.HasSweep = 0 - self.DayLV = 0 - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - length += 1 * self.Cnt - length += 4 - length += 1 - length += 2 - - 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.WriteBYTE(data, self.LineList[i]) - data = CommFunc.WriteDWORD(data, self.AwardRecord) - data = CommFunc.WriteBYTE(data, self.HasSweep) - data = CommFunc.WriteWORD(data, self.DayLV) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - Cnt:%d, - LineList:%s, - AwardRecord:%d, - HasSweep:%d, - DayLV:%d - '''\ - %( - self.Head.OutputString(), - self.Cnt, - "...", - self.AwardRecord, - self.HasSweep, - self.DayLV - ) - return DumpString - - -m_NAtagMCIceLodeInfo=tagMCIceLodeInfo() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCIceLodeInfo.Head.Cmd,m_NAtagMCIceLodeInfo.Head.SubCmd))] = m_NAtagMCIceLodeInfo #------------------------------------------------------ @@ -50727,17 +50739,621 @@ #------------------------------------------------------ +# B4 24 回合战斗初始化 #tagSCTurnFightInit + +class tagSCTurnFightObj(Structure): + _pack_ = 1 + _fields_ = [ + ("ObjID", c_int), # 战斗单位唯一ID + ("NPCID", c_int), # 战斗NPCID,不同的实例ID对应的NPCID可能一样 + ("HeroID", c_int), # 玩家武将ID,仅玩家阵容有 + ("SkinID", c_int), # 玩家武将皮肤ID,仅玩家阵容有 + ("HP", c_int), # 当前血量,求余20亿部分 + ("HPEx", c_int), # 当前血量,整除20亿部分 + ("MaxHP", c_int), # 最大血量,求余20亿部分 + ("MaxHPEx", c_int), # 最大血量,整除20亿部分 + ("LV", c_ushort), # 等级 + ("PosNum", c_ubyte), # 在本阵容中的站位,从1开始,非主战斗武将为0,如红颜 + ("AngreXP", c_ushort), # 当前怒气值 + ] + + 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.ObjID = 0 + self.NPCID = 0 + self.HeroID = 0 + self.SkinID = 0 + self.HP = 0 + self.HPEx = 0 + self.MaxHP = 0 + self.MaxHPEx = 0 + self.LV = 0 + self.PosNum = 0 + self.AngreXP = 0 + return + + def GetLength(self): + return sizeof(tagSCTurnFightObj) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 24 回合战斗初始化 //tagSCTurnFightInit: + ObjID:%d, + NPCID:%d, + HeroID:%d, + SkinID:%d, + HP:%d, + HPEx:%d, + MaxHP:%d, + MaxHPEx:%d, + LV:%d, + PosNum:%d, + AngreXP:%d + '''\ + %( + self.ObjID, + self.NPCID, + self.HeroID, + self.SkinID, + self.HP, + self.HPEx, + self.MaxHP, + self.MaxHPEx, + self.LV, + self.PosNum, + self.AngreXP + ) + return DumpString + + +class tagSCTurnFightLineup(Structure): + Num = 0 #(BYTE Num)// 该阵容在本阵营的编号,不同阵营的阵容编号可能相同,都是从1开始,一般1V1时每个阵营为1个阵容,多V多时则每个阵营为多个阵容 + OwnerID = 0 #(DWORD OwnerID)// 阵容所属的玩家ID,可能为0,0代表非玩家阵容 + ShapeType = 0 #(BYTE ShapeType)// 本阵容阵型,0为默认阵型,可扩展不同的阵型,如boss特殊战斗阵型,或者其他不同站位的阵型 + ObjCnt = 0 #(BYTE ObjCnt) + ObjList = list() #(vector<tagSCTurnFightObj> ObjList)// 本阵容战斗单位列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.Num,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.OwnerID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.ShapeType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.ObjCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.ObjCnt): + temObjList = tagSCTurnFightObj() + _pos = temObjList.ReadData(_lpData, _pos) + self.ObjList.append(temObjList) + return _pos + + def Clear(self): + self.Num = 0 + self.OwnerID = 0 + self.ShapeType = 0 + self.ObjCnt = 0 + self.ObjList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 4 + length += 1 + length += 1 + for i in range(self.ObjCnt): + length += self.ObjList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.Num) + data = CommFunc.WriteDWORD(data, self.OwnerID) + data = CommFunc.WriteBYTE(data, self.ShapeType) + data = CommFunc.WriteBYTE(data, self.ObjCnt) + for i in range(self.ObjCnt): + data = CommFunc.WriteString(data, self.ObjList[i].GetLength(), self.ObjList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Num:%d, + OwnerID:%d, + ShapeType:%d, + ObjCnt:%d, + ObjList:%s + '''\ + %( + self.Num, + self.OwnerID, + self.ShapeType, + self.ObjCnt, + "..." + ) + return DumpString + + +class tagSCTurnFightFaction(Structure): + Faction = 0 #(BYTE Faction)//阵营编号,1或2,1为发起方的阵营编号 + LineupCnt = 0 #(BYTE LineupCnt) + LineupList = list() #(vector<tagSCTurnFightLineup> LineupList)// 本阵营所有阵容列表,为支持多V多扩展用,通常情况下每个阵营只有一个阵容 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.Faction,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.LineupCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.LineupCnt): + temLineupList = tagSCTurnFightLineup() + _pos = temLineupList.ReadData(_lpData, _pos) + self.LineupList.append(temLineupList) + return _pos + + def Clear(self): + self.Faction = 0 + self.LineupCnt = 0 + self.LineupList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 1 + for i in range(self.LineupCnt): + length += self.LineupList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.Faction) + data = CommFunc.WriteBYTE(data, self.LineupCnt) + for i in range(self.LineupCnt): + data = CommFunc.WriteString(data, self.LineupList[i].GetLength(), self.LineupList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Faction:%d, + LineupCnt:%d, + LineupList:%s + '''\ + %( + self.Faction, + self.LineupCnt, + "..." + ) + return DumpString + + +class tagSCTurnFightInit(Structure): + Head = tagHead() + MapID = 0 #(DWORD MapID)// 自定义地图ID,可用于绑定战斗地图场景功能(如主线关卡、主线boss、爬塔、竞技场等) + FuncLineID = 0 #(DWORD FuncLineID)// MapID对应的扩展值,如具体某个关卡等 + TurnMax = 0 #(BYTE TurnMax)// 最大轮次 + Len = 0 #(WORD Len) + Msg = "" #(String Msg)// 本场战斗扩展信息,一般为json格式,具体内容由MapID决定 + FactionCnt = 0 #(BYTE FactionCnt) + FactionList = list() #(vector<tagSCTurnFightFaction> FactionList)// 阵营列表,通常固定只有两个阵营 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x24 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.FuncLineID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.TurnMax,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.Len,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.Msg,_pos = CommFunc.ReadString(_lpData, _pos,self.Len) + self.FactionCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.FactionCnt): + temFactionList = tagSCTurnFightFaction() + _pos = temFactionList.ReadData(_lpData, _pos) + self.FactionList.append(temFactionList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x24 + self.MapID = 0 + self.FuncLineID = 0 + self.TurnMax = 0 + self.Len = 0 + self.Msg = "" + self.FactionCnt = 0 + self.FactionList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 4 + length += 4 + length += 1 + length += 2 + length += len(self.Msg) + length += 1 + for i in range(self.FactionCnt): + length += self.FactionList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteDWORD(data, self.MapID) + data = CommFunc.WriteDWORD(data, self.FuncLineID) + data = CommFunc.WriteBYTE(data, self.TurnMax) + data = CommFunc.WriteWORD(data, self.Len) + data = CommFunc.WriteString(data, self.Len, self.Msg) + data = CommFunc.WriteBYTE(data, self.FactionCnt) + for i in range(self.FactionCnt): + data = CommFunc.WriteString(data, self.FactionList[i].GetLength(), self.FactionList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + MapID:%d, + FuncLineID:%d, + TurnMax:%d, + Len:%d, + Msg:%s, + FactionCnt:%d, + FactionList:%s + '''\ + %( + self.Head.OutputString(), + self.MapID, + self.FuncLineID, + self.TurnMax, + self.Len, + self.Msg, + self.FactionCnt, + "..." + ) + return DumpString + + +m_NAtagSCTurnFightInit=tagSCTurnFightInit() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCTurnFightInit.Head.Cmd,m_NAtagSCTurnFightInit.Head.SubCmd))] = m_NAtagSCTurnFightInit + + +#------------------------------------------------------ +# B4 21 回合战斗对象开始行动 #tagMCTurnFightObjAction + +class tagMCTurnFightObjAction(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("TurnNum", c_ubyte), # 当前轮次 + ("ObjID", c_int), + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x21 + 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 = 0xB4 + self.SubCmd = 0x21 + self.TurnNum = 0 + self.ObjID = 0 + return + + def GetLength(self): + return sizeof(tagMCTurnFightObjAction) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 21 回合战斗对象开始行动 //tagMCTurnFightObjAction: + Cmd:%s, + SubCmd:%s, + TurnNum:%d, + ObjID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.TurnNum, + self.ObjID + ) + return DumpString + + +m_NAtagMCTurnFightObjAction=tagMCTurnFightObjAction() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightObjAction.Cmd,m_NAtagMCTurnFightObjAction.SubCmd))] = m_NAtagMCTurnFightObjAction + + +#------------------------------------------------------ +# B4 22 回合战斗对象死亡 #tagMCTurnFightObjDead + +class tagMCTurnFightObjDead(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ObjID", c_int), + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x22 + 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 = 0xB4 + self.SubCmd = 0x22 + self.ObjID = 0 + return + + def GetLength(self): + return sizeof(tagMCTurnFightObjDead) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 22 回合战斗对象死亡 //tagMCTurnFightObjDead: + Cmd:%s, + SubCmd:%s, + ObjID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID + ) + return DumpString + + +m_NAtagMCTurnFightObjDead=tagMCTurnFightObjDead() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightObjDead.Cmd,m_NAtagMCTurnFightObjDead.SubCmd))] = m_NAtagMCTurnFightObjDead + + +#------------------------------------------------------ +# B4 23 回合战斗对象复活 #tagMCTurnFightObjReborn + +class tagMCTurnFightObjReborn(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ObjID", c_int), + ("HP", c_int), # 复活后血量,求余亿部分 + ("HPEx", c_int), # 复活后血量,整除亿部分 + ("RebornType", c_ubyte), # 复活方式:1-灵宠技能复活;2-待扩展 + ("RebornValue1", c_int), # 复活方式对应值1,由复活方式决定其值意义 + ("RebornValue2", c_int), # 复活方式对应值2 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x23 + 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 = 0xB4 + self.SubCmd = 0x23 + self.ObjID = 0 + self.HP = 0 + self.HPEx = 0 + self.RebornType = 0 + self.RebornValue1 = 0 + self.RebornValue2 = 0 + return + + def GetLength(self): + return sizeof(tagMCTurnFightObjReborn) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 23 回合战斗对象复活 //tagMCTurnFightObjReborn: + Cmd:%s, + SubCmd:%s, + ObjID:%d, + HP:%d, + HPEx:%d, + RebornType:%d, + RebornValue1:%d, + RebornValue2:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID, + self.HP, + self.HPEx, + self.RebornType, + self.RebornValue1, + self.RebornValue2 + ) + return DumpString + + +m_NAtagMCTurnFightObjReborn=tagMCTurnFightObjReborn() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightObjReborn.Cmd,m_NAtagMCTurnFightObjReborn.SubCmd))] = m_NAtagMCTurnFightObjReborn + + +#------------------------------------------------------ +# B4 30 查看战报结果 #tagSCTurnFightReportRet + +class tagSCTurnFightReport(Structure): + Head = tagHead() + GUID = "" #(char GUID[40])//该战报guid + Len = 0 #(DWORD Len) + Report = "" #(String Report)//完整战报 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x30 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.GUID,_pos = CommFunc.ReadString(_lpData, _pos,40) + self.Len,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.Report,_pos = CommFunc.ReadString(_lpData, _pos,self.Len) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x30 + self.GUID = "" + self.Len = 0 + self.Report = "" + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 40 + length += 4 + length += len(self.Report) + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteString(data, 40, self.GUID) + data = CommFunc.WriteDWORD(data, self.Len) + data = CommFunc.WriteString(data, self.Len, self.Report) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + GUID:%s, + Len:%d, + Report:%s + '''\ + %( + self.Head.OutputString(), + self.GUID, + self.Len, + self.Report + ) + return DumpString + + + +#------------------------------------------------------ +# B4 25 回合战斗战报片段标记 #tagSCTurnFightReportSign + +class tagSCTurnFightReportSign(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("Sign", c_ubyte), # 0-战报片段开始;1-战报片段结束; + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x25 + 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 = 0xB4 + self.SubCmd = 0x25 + self.Sign = 0 + return + + def GetLength(self): + return sizeof(tagSCTurnFightReportSign) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 25 回合战斗战报片段标记 //tagSCTurnFightReportSign: + Cmd:%s, + SubCmd:%s, + Sign:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.Sign + ) + return DumpString + + +m_NAtagSCTurnFightReportSign=tagSCTurnFightReportSign() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCTurnFightReportSign.Cmd,m_NAtagSCTurnFightReportSign.SubCmd))] = m_NAtagSCTurnFightReportSign + + +#------------------------------------------------------ # B4 20 回合制战斗状态 #tagMCTurnFightState class tagMCTurnFightState(Structure): Head = tagHead() - MapID = 0 #(DWORD MapID)// 自定义地图ID,可用于绑定战斗场景功能(如野外关卡,爬塔功能,竞技场等) - FuncLineID = 0 #(WORD FuncLineID) - TagType = 0 #(BYTE TagType)// 战斗目标类型,0-NPC,1-玩家,2-队伍 - TagID = 0 #(DWORD TagID)// 战斗目标类型对应的ID + MapID = 0 #(DWORD MapID)// 自定义地图ID,可用于绑定战斗地图场景功能(如主线关卡、主线boss、爬塔、竞技场等) + FuncLineID = 0 #(DWORD FuncLineID)// MapID对应的扩展值,如具体某个关卡等 State = 0 #(BYTE State)// 0-起始状态标记;1-准备完毕;2-战斗中;3-战斗结束;4-结算奖励;5-结束状态标记 TurnNum = 0 #(BYTE TurnNum)// 当前轮次 - TurnMax = 0 #(BYTE TurnMax)// 最大轮次 Len = 0 #(WORD Len) Msg = "" #(String Msg)//size = Len data = None @@ -50752,12 +51368,9 @@ self.Clear() _pos = self.Head.ReadData(_lpData, _pos) self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos) - self.FuncLineID,_pos = CommFunc.ReadWORD(_lpData, _pos) - self.TagType,_pos = CommFunc.ReadBYTE(_lpData, _pos) - self.TagID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.FuncLineID,_pos = CommFunc.ReadDWORD(_lpData, _pos) self.State,_pos = CommFunc.ReadBYTE(_lpData, _pos) self.TurnNum,_pos = CommFunc.ReadBYTE(_lpData, _pos) - self.TurnMax,_pos = CommFunc.ReadBYTE(_lpData, _pos) self.Len,_pos = CommFunc.ReadWORD(_lpData, _pos) self.Msg,_pos = CommFunc.ReadString(_lpData, _pos,self.Len) return _pos @@ -50769,11 +51382,8 @@ self.Head.SubCmd = 0x20 self.MapID = 0 self.FuncLineID = 0 - self.TagType = 0 - self.TagID = 0 self.State = 0 self.TurnNum = 0 - self.TurnMax = 0 self.Len = 0 self.Msg = "" return @@ -50782,10 +51392,7 @@ length = 0 length += self.Head.GetLength() length += 4 - length += 2 - length += 1 length += 4 - length += 1 length += 1 length += 1 length += 2 @@ -50797,12 +51404,9 @@ data = '' data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) data = CommFunc.WriteDWORD(data, self.MapID) - data = CommFunc.WriteWORD(data, self.FuncLineID) - data = CommFunc.WriteBYTE(data, self.TagType) - data = CommFunc.WriteDWORD(data, self.TagID) + data = CommFunc.WriteDWORD(data, self.FuncLineID) data = CommFunc.WriteBYTE(data, self.State) data = CommFunc.WriteBYTE(data, self.TurnNum) - data = CommFunc.WriteBYTE(data, self.TurnMax) data = CommFunc.WriteWORD(data, self.Len) data = CommFunc.WriteString(data, self.Len, self.Msg) return data @@ -50812,11 +51416,8 @@ Head:%s, MapID:%d, FuncLineID:%d, - TagType:%d, - TagID:%d, State:%d, TurnNum:%d, - TurnMax:%d, Len:%d, Msg:%s '''\ @@ -50824,11 +51425,8 @@ self.Head.OutputString(), self.MapID, self.FuncLineID, - self.TagType, - self.TagID, self.State, self.TurnNum, - self.TurnMax, self.Len, self.Msg ) -- Gitblit v1.8.0