From a166d721a3d7ff6cd2339983214e718c7a6a0ffe Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 11 六月 2025 11:00:36 +0800 Subject: [PATCH] 121 【武将】武将系统-服务端(武将招募;武将背包;武将养成系统;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 112 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 0b5955d..50f951f 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -44094,6 +44094,118 @@ #------------------------------------------------------ +# B1 22 武将信息 #tagSCHeroInfo + +class tagSCHero(Structure): + _pack_ = 1 + _fields_ = [ + ("HeroID", c_int), # 武将ID + ("IsActive", c_ubyte), # 是否已激活 + ("SkinState", c_int), # 武将皮肤已解锁状态信息,按皮肤所在索引二进制位运算判断是否解锁,0索引位默认皮肤,不用验证 + ] + + 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.HeroID = 0 + self.IsActive = 0 + self.SkinState = 0 + return + + def GetLength(self): + return sizeof(tagSCHero) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B1 22 武将信息 //tagSCHeroInfo: + HeroID:%d, + IsActive:%d, + SkinState:%d + '''\ + %( + self.HeroID, + self.IsActive, + self.SkinState + ) + return DumpString + + +class tagSCHeroInfo(Structure): + Head = tagHead() + HeroCnt = 0 #(WORD HeroCnt) + HeroInfoList = list() #(vector<tagSCHero> HeroInfoList) + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x22 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.HeroCnt,_pos = CommFunc.ReadWORD(_lpData, _pos) + for i in range(self.HeroCnt): + temHeroInfoList = tagSCHero() + _pos = temHeroInfoList.ReadData(_lpData, _pos) + self.HeroInfoList.append(temHeroInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x22 + self.HeroCnt = 0 + self.HeroInfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 2 + for i in range(self.HeroCnt): + length += self.HeroInfoList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteWORD(data, self.HeroCnt) + for i in range(self.HeroCnt): + data = CommFunc.WriteString(data, self.HeroInfoList[i].GetLength(), self.HeroInfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + HeroCnt:%d, + HeroInfoList:%s + '''\ + %( + self.Head.OutputString(), + self.HeroCnt, + "..." + ) + return DumpString + + +m_NAtagSCHeroInfo=tagSCHeroInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCHeroInfo.Head.Cmd,m_NAtagSCHeroInfo.Head.SubCmd))] = m_NAtagSCHeroInfo + + +#------------------------------------------------------ # B1 06 通知玩家向目标点移动 #tagMCNotifyPlayerMove class tagMCNotifyPlayerMove(Structure): -- Gitblit v1.8.0