| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 09 激活功能系统特权奖励 #tagMCActivateFuncSysPrivilege
|
| | |
|
| | | class tagMCActivateFuncSysPrivilege(Structure):
|
| | | Head = tagHead()
|
| | | ActivateCount = 0 #(BYTE ActivateCount)// 激活个数
|
| | | ActivateFuncSysIDList = list() #(vector<BYTE> ActivateFuncSysIDList)// 激活功能系统ID列表,全部激活则需要发所有ID列表
|
| | | 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.ActivateCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.ActivateCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.ActivateFuncSysIDList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x09
|
| | | self.ActivateCount = 0
|
| | | self.ActivateFuncSysIDList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1 * self.ActivateCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.ActivateCount)
|
| | | for i in range(self.ActivateCount):
|
| | | data = CommFunc.WriteBYTE(data, self.ActivateFuncSysIDList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ActivateCount:%d,
|
| | | ActivateFuncSysIDList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ActivateCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActivateFuncSysPrivilege=tagMCActivateFuncSysPrivilege()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActivateFuncSysPrivilege.Head.Cmd,m_NAtagMCActivateFuncSysPrivilege.Head.SubCmd))] = m_NAtagMCActivateFuncSysPrivilege
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 06 玩家加点 #tagCMAddPoint
|
| | |
|
| | | class tagCMAddPoint(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 10 领取功能系统特权奖励 #tagCMGetFuncSysPrivilegeAward
|
| | |
|
| | | class tagCMGetFuncSysPrivilegeAward(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("FuncSysID", c_ubyte), # 功能系统ID
|
| | | ("DayNum", c_ubyte), # 第X天,1为第1天
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x10
|
| | | 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 = 0x10
|
| | | self.FuncSysID = 0
|
| | | self.DayNum = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMGetFuncSysPrivilegeAward)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 10 领取功能系统特权奖励 //tagCMGetFuncSysPrivilegeAward:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | FuncSysID:%d,
|
| | | DayNum:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.FuncSysID,
|
| | | self.DayNum
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMGetFuncSysPrivilegeAward=tagCMGetFuncSysPrivilegeAward()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGetFuncSysPrivilegeAward.Cmd,m_NAtagCMGetFuncSysPrivilegeAward.SubCmd))] = m_NAtagCMGetFuncSysPrivilegeAward
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 07 重置加点 #tagCMResetAttrPoint
|
| | |
|
| | | class tagCMResetAttrPoint(Structure):
|