From 1a9aa08e61a036b6c051cb072f7b4c8c746662b3 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 03 十二月 2025 19:55:26 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(优化战斗与结算逻辑分离;优化战斗结果同步及战报;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 144 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 144 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 b8f7b67..e027efd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -38075,6 +38075,150 @@
#------------------------------------------------------
+# B4 31 战斗战报结果 #tagSCTurnFightRet
+
+class tagSCTurnFightRet(Structure):
+ Head = tagHead()
+ MapID = 0 #(DWORD MapID)// 自定义地图ID,可用于绑定战斗地图场景功能(如主线boss、爬塔、竞技场等)
+ FuncLineID = 0 #(DWORD FuncLineID)// MapID对应的扩展值,如具体某个关卡等
+ TagType = 0 #(BYTE TagType)// 目标类型,0-NPC阵容,1-玩家
+ TagID = 0 #(DWORD TagID)// 目标类型对应的ID,如玩家ID
+ ValueCount = 0 #(BYTE ValueCount)
+ ValueList = list() #(vector<DWORD> ValueList)// 附加值列表,可选,具体含义由MapID决定
+ IsWin = 0 #(BYTE IsWin)//是否获胜
+ AwardLen = 0 #(WORD AwardLen)
+ AwardMsg = "" #(String AwardMsg)//功能结算奖励信息,不含战斗相关统计信息
+ BatLen = 0 #(WORD BatLen)
+ BatStatMsg = "" #(String BatStatMsg)//战斗相关统计信息
+ PathDate = "" #(char PathDate[8])//战报路径日期, yyyyMMdd, 为空时代表公共类的战报,不为空时为玩家个人类战报
+ GUID = "" #(char GUID[40])//战报guid,前端根据功能MapID判断是否跨服功能,是的话从跨服服务器下载战报,否的话从本机下载
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xB4
+ self.Head.SubCmd = 0x31
+ 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.TagType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.TagID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.ValueCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.ValueCount):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.ValueList.append(value)
+ self.IsWin,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.AwardLen,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.AwardMsg,_pos = CommFunc.ReadString(_lpData, _pos,self.AwardLen)
+ self.BatLen,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.BatStatMsg,_pos = CommFunc.ReadString(_lpData, _pos,self.BatLen)
+ self.PathDate,_pos = CommFunc.ReadString(_lpData, _pos,8)
+ self.GUID,_pos = CommFunc.ReadString(_lpData, _pos,40)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xB4
+ self.Head.SubCmd = 0x31
+ self.MapID = 0
+ self.FuncLineID = 0
+ self.TagType = 0
+ self.TagID = 0
+ self.ValueCount = 0
+ self.ValueList = list()
+ self.IsWin = 0
+ self.AwardLen = 0
+ self.AwardMsg = ""
+ self.BatLen = 0
+ self.BatStatMsg = ""
+ self.PathDate = ""
+ self.GUID = ""
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 4
+ length += 4
+ length += 1
+ length += 4
+ length += 1
+ length += 4 * self.ValueCount
+ length += 1
+ length += 2
+ length += len(self.AwardMsg)
+ length += 2
+ length += len(self.BatStatMsg)
+ length += 8
+ length += 40
+
+ 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.TagType)
+ data = CommFunc.WriteDWORD(data, self.TagID)
+ data = CommFunc.WriteBYTE(data, self.ValueCount)
+ for i in range(self.ValueCount):
+ data = CommFunc.WriteDWORD(data, self.ValueList[i])
+ data = CommFunc.WriteBYTE(data, self.IsWin)
+ data = CommFunc.WriteWORD(data, self.AwardLen)
+ data = CommFunc.WriteString(data, self.AwardLen, self.AwardMsg)
+ data = CommFunc.WriteWORD(data, self.BatLen)
+ data = CommFunc.WriteString(data, self.BatLen, self.BatStatMsg)
+ data = CommFunc.WriteString(data, 8, self.PathDate)
+ data = CommFunc.WriteString(data, 40, self.GUID)
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ MapID:%d,
+ FuncLineID:%d,
+ TagType:%d,
+ TagID:%d,
+ ValueCount:%d,
+ ValueList:%s,
+ IsWin:%d,
+ AwardLen:%d,
+ AwardMsg:%s,
+ BatLen:%d,
+ BatStatMsg:%s,
+ PathDate:%s,
+ GUID:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.MapID,
+ self.FuncLineID,
+ self.TagType,
+ self.TagID,
+ self.ValueCount,
+ "...",
+ self.IsWin,
+ self.AwardLen,
+ self.AwardMsg,
+ self.BatLen,
+ self.BatStatMsg,
+ self.PathDate,
+ self.GUID
+ )
+ return DumpString
+
+
+m_NAtagSCTurnFightRet=tagSCTurnFightRet()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCTurnFightRet.Head.Cmd,m_NAtagSCTurnFightRet.Head.SubCmd))] = m_NAtagSCTurnFightRet
+
+
+#------------------------------------------------------
# B4 20 回合制战斗状态 #tagMCTurnFightState
class tagMCTurnFightState(Structure):
--
Gitblit v1.8.0