129 【战斗】战斗系统-服务端(A922同步等级信息)
| | |
| | | class tagSCArenaMatchInfo(Structure):
|
| | | PlayerID = 0 #(DWORD PlayerID)//目标玩家ID
|
| | | PlayerName = "" #(char PlayerName[33])
|
| | | LV = 0 #(WORD LV)// 玩家等级
|
| | | RealmLV = 0 #(WORD RealmLV)//境界,机器人读境界表取等级对应境界
|
| | | FightPower = 0 #(DWORD FightPower)//战力求余亿部分
|
| | | FightPowerEx = 0 #(DWORD FightPowerEx)//战力整除亿部分
|
| | |
| | | self.Clear()
|
| | | self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PlayerName,_pos = CommFunc.ReadString(_lpData, _pos,33)
|
| | | self.LV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.RealmLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.FightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.FightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | |
| | | def Clear(self):
|
| | | self.PlayerID = 0
|
| | | self.PlayerName = ""
|
| | | self.LV = 0
|
| | | self.RealmLV = 0
|
| | | self.FightPower = 0
|
| | | self.FightPowerEx = 0
|
| | |
| | | length += 4
|
| | | length += 33
|
| | | length += 2
|
| | | length += 2
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | |
| | | data = ''
|
| | | data = CommFunc.WriteDWORD(data, self.PlayerID)
|
| | | data = CommFunc.WriteString(data, 33, self.PlayerName)
|
| | | data = CommFunc.WriteWORD(data, self.LV)
|
| | | data = CommFunc.WriteWORD(data, self.RealmLV)
|
| | | data = CommFunc.WriteDWORD(data, self.FightPower)
|
| | | data = CommFunc.WriteDWORD(data, self.FightPowerEx)
|
| | |
| | | DumpString = '''
|
| | | PlayerID:%d,
|
| | | PlayerName:%s,
|
| | | LV:%d,
|
| | | RealmLV:%d,
|
| | | FightPower:%d,
|
| | | FightPowerEx:%d,
|
| | |
| | | %(
|
| | | self.PlayerID,
|
| | | self.PlayerName,
|
| | | self.LV,
|
| | | self.RealmLV,
|
| | | self.FightPower,
|
| | | self.FightPowerEx,
|
| | |
| | | import PyGameData
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import ObjPool
|
| | | import random
|
| | |
|
| | | # 记录攻击类型
|
| | |
| | |
|
| | | def __SyncMatchList(curPlayer, matchIDList):
|
| | | ## 同步匹配列表
|
| | | clientPack = ChPyNetSendPack.tagSCArenaMatchList()
|
| | | objPool = ObjPool.GetPoolMgr()
|
| | | clientPack = objPool.acquire(ChPyNetSendPack.tagSCArenaMatchList)
|
| | | clientPack.MatchList = []
|
| | | for matchID in matchIDList:
|
| | | viewCache = PlayerViewCache.FindViewCache(matchID)
|
| | | matchInfo = ChPyNetSendPack.tagSCArenaMatchInfo()
|
| | | matchInfo = objPool.acquire(ChPyNetSendPack.tagSCArenaMatchInfo)
|
| | | matchInfo.PlayerID = matchID
|
| | | if viewCache:
|
| | | matchInfo.PlayerName = viewCache.GetPlayerName()
|
| | | matchInfo.RealmLV = viewCache.GetRealmLV()
|
| | | matchInfo.LV = viewCache.GetLV()
|
| | | matchInfo.Face = viewCache.GetFace()
|
| | | matchInfo.FacePic = viewCache.GetFacePic()
|
| | | matchInfo.FightPower = viewCache.GetFightPower()
|
| | |
| | | return
|
| | |
|
| | | def Sync_ArenaInfo(curPlayer):
|
| | | clientPack = ChPyNetSendPack.tagSCArenaPlayerInfo()
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCArenaPlayerInfo)
|
| | | clientPack.Score = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaScore)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|