From 0c3ef8a641c968e6a2f51abeb84f890342e4cb0c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 15 十二月 2025 11:42:13 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(优化效果6011可指定检查自己还是检查目标的buff;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py |  127 +++++++++++++++++++++++++-----------------
 1 files changed, 76 insertions(+), 51 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
index 29a05b9..dbbb24a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
@@ -113,18 +113,24 @@
 import ShareDefine
 import PlayerControl
 import PyGameData
+import IpyGameDataPY
 #===============================================================================
 ##发送事件记录给EventShell
 # @param eventTypeStr: 事件类型标识
 # @param dataDict: 事件字典
 # @return None
-def SendEventPack(eventTypeStr, dataDict, curPlayer=None):
-
+def SendEventPack(eventTypeStr, dataDict, curPlayer=None, checkBatServer=True):
+    
+    if checkBatServer and GameWorld.IsBattleServer():
+        GameWorld.DebugLogEx("战斗服务器暂不做流向记录")
+        return
+    
     if curPlayer:
         if not GameWorld.IsNormalPlayer(curPlayer):
             return
         pid = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayerFromPID)
-        dataDict["pid"] = pid
+        if pid:
+            dataDict["pid"] = pid
         dataDict["fightPower"] = PlayerControl.GetFightPower(curPlayer)
         dataDict["PlayerLV"] = curPlayer.GetLV()
         dataDict["IP"] = curPlayer.GetIP()
@@ -143,11 +149,12 @@
     loginTime = curPlayer.GetLoginTime()
     name = curPlayer.GetName()
     mapID = GameWorld.GetMap().GetMapID()
-    lineID = GameWorld.GetGameWorld().GetLineID()
+    #lineID = GameWorld.GetGameWorld().GetLineID()
+    lv = curPlayer.GetLV()
+    gold = curPlayer.GetGold()
     
-    dataDict = {'Type':'login', 'IP':str(ip), 'AccID':accID, 'mapID':mapID, 'lineID':lineID,
-                'Name':name, 'LoginTime':str(loginTime), 'LogoutTime':'', 'MFPFightPower':GetMFPFightPowerInfo(curPlayer),
-                'LV':curPlayer.GetLV(), 'TotalExp':PlayerControl.GetPlayerTotalExp(curPlayer)}
+    dataDict = {'Type':'login', 'IP':str(ip), 'AccID':accID, 'MapID':mapID, 'Name':name, 'LV':lv, 'Gold':gold, 
+                'LoginTime':str(loginTime), 'LogoutTime':''}
     
     if GameWorld.IsCrossServer():
         regCrossZoneID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBZoneID)
@@ -170,37 +177,20 @@
     logoutTime = curPlayer.GetLogoffTime()
     loginTime = curPlayer.GetLoginTime()
     lv = curPlayer.GetLV()
-    vipLV = curPlayer.GetVIPLv()
     gold = curPlayer.GetGold()
-    goldPaper = curPlayer.GetGoldPaper()
-    dataDict = {'Type':'logout', 'IP':ip, 'AccID':accID, 'LV':lv, 'VipLV':vipLV,
-                  'Name':name, 'LoginTime':str(loginTime), 'Gold':gold, 'GoldPaper':goldPaper,
-                  'LogoutTime':str(logoutTime), 'MFPFightPower':GetMFPFightPowerInfo(curPlayer), 
-                  'TotalExp':PlayerControl.GetPlayerTotalExp(curPlayer)}
+    mapID = GameWorld.GetMap().GetMapID()
+    dataDict = {'Type':'logout', 'IP':ip, 'AccID':accID, 'MapID':mapID, 'Name':name, 'LV':lv, 'Gold':gold, 
+                'LoginTime':str(loginTime), 'LogoutTime':str(logoutTime)}
     #发送封包
     SendEventPack("LogInOut", dataDict, curPlayer)
     return
 
-def GetMFPFightPowerInfo(curPlayer):
-    #记录模块战力
-    dataDict = {}
-    for mfpType in ShareDefine.ModuleFightPowerTypeList:
-        fightPower = PlayerControl.GetMFPFightPower(curPlayer, mfpType)
-        dataDict[mfpType] = fightPower
-    return dataDict
-    
-## 新增有效登陆
-#  @param accID: 账号ID
-#  @param ip: ip
-#  @return: None
-def DR_LoginValid(accID, ip, curPlayer):
-
-    dataDict = {'AccID':accID, 'IP':ip}
-    
-    #发送封包
-    SendEventPack("LoginValid", dataDict, curPlayer)
+def DR_OnlineTimeToday(curPlayer, onlineTime):
+    ## 今日累计在线时长
+    dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), 
+                'AccID':curPlayer.GetAccID(), 'OnlineTime':onlineTime}
+    SendEventPack("OnlineTimeToday", dataDict)
     return
-
 
 ## 新增第一次登陆
 #  @param accID: 账号ID
@@ -257,19 +247,6 @@
     SendEventPack("CTGOK", dataDict, curPlayer)
     return
 
-## 功能流向信息
-#  @param curPlayer: 玩家实例
-#  @return: {}
-def __GetFuncDRDict(curPlayer):
-    drDict = {}
-    
-    # 官爵阶级、祝福值
-    offBlessValue = 0
-    offRank = curPlayer.GetOfficialRank()
-    drDict["Official"] = [offRank, offBlessValue]
-    
-    return drDict
-
 ## 玩家升级
 #  @param curPlayer: 玩家实例
 #  @param playerLV: 玩家等级
@@ -284,6 +261,42 @@
 
     #发送封包
     SendEventPack("PlayerUpgrade", dataDict, curPlayer)
+    return
+
+def DR_Task(curPlayer, taskGroup, taskID, eventName="", drDict={}):
+    ## 任务流向
+    dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), 
+                'AccID':curPlayer.GetAccID(), 'TaskID':taskID, 'TaskGroup':taskGroup, 'eventName':eventName}
+    dataDict.update(drDict)
+    SendEventPack("Task_%s" % taskGroup, dataDict, curPlayer)
+    return
+
+def DR_MainLevelPass(curPlayer, lvID):
+    ## 主线关卡过关
+    dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), 
+                'AccID':curPlayer.GetAccID(), 'lvID':lvID}
+    SendEventPack("MainLevelPass", dataDict, curPlayer)
+    return
+
+def DR_FBPass(curPlayer, mapID, funcLineID, drDict={}):
+    ## 副本过关
+    dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), 
+                'AccID':curPlayer.GetAccID(), 'MapID':mapID, 'LineID':funcLineID}
+    dataDict.update(drDict)
+    SendEventPack("FBPass_%s" % mapID, dataDict, curPlayer)
+    return
+
+def DR_FightStat(reqPlayerID, mapID, funcLineID, isWin, turnNum, turnMax, heroCount, costTime, statInfo, drLineupInfo):
+    ## 战斗统计
+    dataDict = {'PlayerID':reqPlayerID, 'mapID':mapID, 'funcLineID':funcLineID, 'isWin':isWin, 
+                'turnNum':turnNum, 'turnMax':turnMax, 'heroCount':heroCount, 'costTime':costTime}
+    SendEventPack("FightTime", dataDict, checkBatServer=False)
+    
+    #战斗失败的记录明细信息
+    if not isWin:
+        failDRDict = {"statInfo":statInfo, "drLineupInfo":drLineupInfo}
+        failDRDict.update(dataDict)
+        SendEventPack("FightFail_%s" % mapID, failDRDict, checkBatServer=False)
     return
 
 ##累计登陆礼包
@@ -411,9 +424,16 @@
         return
     
     #避免记录太多信息
-    if moneyType in [IPY_GameWorld.TYPE_Price_Silver_Money] and moneyCount < ChConfig.Def_DRRecord_Min_Silver:
+    if moneyType in IpyGameDataPY.GetFuncEvalCfg("MoneyRecord", 3):
+        #GameWorld.DebugLogEx("消耗不记录的货币类型: %s", moneyType)
         return
-    
+    moneyRecordDict = IpyGameDataPY.GetFuncEvalCfg("MoneyRecord", 4, {})
+    if moneyType in moneyRecordDict:
+        recordSet = moneyRecordDict[moneyType]
+        if moneyCount < recordSet:
+            #GameWorld.DebugLogEx("消耗过少不记录的货币类型: %s,moneyCount=%s < %s", moneyType, moneyCount, recordSet)
+            return
+        
     dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), 
                 'AccID':curPlayer.GetAccID(), "eventName":eventName,
                 'MoneyType':moneyType, 'MoneyCount':moneyCount, 
@@ -421,7 +441,6 @@
                 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV()}
     
     dataDict.update(addDataDict)
-    dataDict.update(__GetFuncDRDict(curPlayer))
     
     #金子
     if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
@@ -465,9 +484,16 @@
         return
     
     #避免记录太多信息
-    if moneyType in [IPY_GameWorld.TYPE_Price_Silver_Money] and moneyCount < ChConfig.Def_DRRecord_Min_Silver:
+    if moneyType in IpyGameDataPY.GetFuncEvalCfg("MoneyRecord", 1):
+        #GameWorld.DebugLogEx("获得不记录的货币类型: %s", moneyType)
         return
-    
+    moneyRecordDict = IpyGameDataPY.GetFuncEvalCfg("MoneyRecord", 2, {})
+    if moneyType in moneyRecordDict:
+        recordSet = moneyRecordDict[moneyType]
+        if moneyCount < recordSet:
+            #GameWorld.DebugLogEx("获得过少不记录的货币类型: %s,moneyCount=%s < %s", moneyType, moneyCount, recordSet)
+            return
+        
     dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), 
                 'AccID':curPlayer.GetAccID(), "eventName":eventName,
                 'MoneyType':moneyType, 'MoneyCount':moneyCount, 
@@ -475,7 +501,6 @@
                 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV()}
     
     dataDict.update(addDataDict)
-    dataDict.update(__GetFuncDRDict(curPlayer))
     
     #金子
     if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:

--
Gitblit v1.8.0