| | |
| | | # C0 15 跨服排位分区分组信息 #tagGCCrossChampionshipPKZoneGroupInfo
|
| | |
|
| | | class tagGCCrossChampionshipPKBattle(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("BattleNum", c_ubyte), # 对战组编号 1~n
|
| | | ("WinPlayerID", c_int), # 获胜玩家ID
|
| | | ("PlayerIDA", c_int), # 玩家IDA
|
| | | ("PlayerIDB", c_int), # 玩家IDB
|
| | | ]
|
| | | BattleNum = 0 #(BYTE BattleNum)// 对战组编号 1~n
|
| | | WinPlayerID = 0 #(DWORD WinPlayerID)// 获胜玩家ID
|
| | | PlayerIDA = 0 #(DWORD PlayerIDA)// 玩家IDA
|
| | | PlayerIDB = 0 #(DWORD PlayerIDB)// 玩家IDB
|
| | | BattleRetLen = 0 #(BYTE BattleRetLen)
|
| | | BattleRet = "" #(String BattleRet)// 战斗结果明细 {"playerID":[[第1局胜负,第1局总积分,胜负基础分,hp分,时间分], ...], ...}
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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()
|
| | | self.BattleNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.WinPlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PlayerIDA,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PlayerIDB,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.BattleRetLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.BattleRet,_pos = CommFunc.ReadString(_lpData, _pos,self.BattleRetLen)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.BattleNum = 0
|
| | | self.WinPlayerID = 0
|
| | | self.PlayerIDA = 0
|
| | | self.PlayerIDB = 0
|
| | | self.BattleRetLen = 0
|
| | | self.BattleRet = ""
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagGCCrossChampionshipPKBattle)
|
| | | length = 0
|
| | | length += 1
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | | length += len(self.BattleRet)
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.BattleNum)
|
| | | data = CommFunc.WriteDWORD(data, self.WinPlayerID)
|
| | | data = CommFunc.WriteDWORD(data, self.PlayerIDA)
|
| | | data = CommFunc.WriteDWORD(data, self.PlayerIDB)
|
| | | data = CommFunc.WriteBYTE(data, self.BattleRetLen)
|
| | | data = CommFunc.WriteString(data, self.BattleRetLen, self.BattleRet)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// C0 15 跨服排位分区分组信息 //tagGCCrossChampionshipPKZoneGroupInfo:
|
| | | DumpString = '''
|
| | | BattleNum:%d,
|
| | | WinPlayerID:%d,
|
| | | PlayerIDA:%d,
|
| | | PlayerIDB:%d
|
| | | PlayerIDB:%d,
|
| | | BattleRetLen:%d,
|
| | | BattleRet:%s
|
| | | '''\
|
| | | %(
|
| | | self.BattleNum,
|
| | | self.WinPlayerID,
|
| | | self.PlayerIDA,
|
| | | self.PlayerIDB
|
| | | self.PlayerIDB,
|
| | | self.BattleRetLen,
|
| | | self.BattleRet
|
| | | )
|
| | | return DumpString
|
| | |
|