From d86939995b8cfece66b936897dbbd3fa46571a21 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 07 十二月 2018 12:37:22 +0800
Subject: [PATCH] 5200 【后端】【1.3.100】骑宠争夺boss每只boss伤害降低,增加灵宠的灵宠也要跟着降低

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py |   43 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
index 72fa8a1..d922fde 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
@@ -113,6 +113,7 @@
 import ChConfig
 import ShareDefine
 import PlayerControl
+import PyGameData
 #===============================================================================
 ##发送事件记录给EventShell
 # @param eventTypeStr: 事件类型标识
@@ -123,6 +124,7 @@
     if curPlayer:
         pid = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayerFromPID)
         dataDict["pid"] = pid
+        dataDict["fightPower"] = curPlayer.GetFightPower()
     dataDict["time"] = str(datetime.datetime.today()).split(".")[0]
     
     dataStr = str(dataDict)
@@ -153,7 +155,7 @@
     name = curPlayer.GetName()
     
     dataDict = {'Type':'login', 'IP':str(ip), 'AccID':accID,
-                'Name':name, 'LoginTime':str(loginTime), 'LogoutTime':''}
+                'Name':name, 'LoginTime':str(loginTime), 'LogoutTime':'', 'MFPFightPower':GetMFPFightPowerInfo(curPlayer)}
     
     #发送封包
     SendEventPack("LogInOut", dataDict, curPlayer)
@@ -175,11 +177,18 @@
     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)}
+                  'LogoutTime':str(logoutTime), 'MFPFightPower':GetMFPFightPowerInfo(curPlayer)}
     #发送封包
     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
@@ -929,8 +938,8 @@
     dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), 
                 "AccID":curPlayer.GetAccID()}
     dataDict.update(addDict)
-    
     SendEventPack("StoneChange_%s"%eventName, dataDict, curPlayer)
+    Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_StoneChange, addDict)
     return
 
 def DR_VIPChange(curPlayer, eventName, addDict={}):
@@ -1589,4 +1598,30 @@
     
     #发送封包
     SendEventPack("RealmLVUp", dataDict, curPlayer)
-    return
\ No newline at end of file
+    return
+
+def Cache_FightPowerChangeInfo(curPlayer, dotype, dataDict):
+    ##暂存可能导致战力降低的行为信息
+    dataDict['dotime'] = str(datetime.datetime.today()).split(".")[0]
+    eventName = ChConfig.FightPowerDownRecordDict.get(dotype, 'Unknown')
+    if eventName in PyGameData.g_fightpowerChangeDataRecordDict:
+        PyGameData.g_fightpowerChangeDataRecordDict[eventName].append(dataDict)
+    else:
+        PyGameData.g_fightpowerChangeDataRecordDict[eventName] = [dataDict]
+    return
+
+def DR_FightPowerChangeInfo(curPlayer, beforePower):
+    ##记录战力降低的行为信息
+    dataDict = {'beforePower':beforePower, 'PlayerID':curPlayer.GetPlayerID(), 'AccID':curPlayer.GetAccID()}
+    for dotype, dateList in PyGameData.g_fightpowerChangeDataRecordDict.items():
+        rList = []
+        for dateInfo in dateList:
+            dateTimeStr = dateInfo['dotime']
+            if GameWorld.GetPastSeconds(dateTimeStr) >10:
+                continue
+            rList.append(dateInfo)
+        dataDict[dotype] = rList
+    PyGameData.g_fightpowerChangeDataRecordDict = {}
+    #发送封包
+    SendEventPack("FightPowerChangeInfo", dataDict, curPlayer)
+    return

--
Gitblit v1.8.0