From 1e3f8cd83080ab4f140f862b2b2a0e60282b521e Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 30 八月 2018 20:11:31 +0800
Subject: [PATCH] fix:3106 【后端】新增守卫人皇参与奖励

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py |   20 +++++++++++++++-----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py                                      |    1 +
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py
index 3d3eff7..ac69927 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py
@@ -151,10 +151,10 @@
     fbStep = gameFB.GetFBStep()
     playerID = curPlayer.GetPlayerID()
     gameWorld = GameWorld.GetGameWorld()
-    
+    familyID = curPlayer.GetFamilyID()
     if not gameFB.GetGameFBDictByKey(Map_FamilyInvadeFB_FamilyID):
-        gameFB.SetGameFBDict(Map_FamilyInvadeFB_FamilyID, curPlayer.GetFamilyID())
-        GameWorld.DebugLog('    仙盟ID=%s 有人进入,开始刷怪了!' % curPlayer.GetFamilyID(), playerID)
+        gameFB.SetGameFBDict(Map_FamilyInvadeFB_FamilyID, familyID)
+        GameWorld.DebugLog('    仙盟ID=%s 有人进入,开始刷怪了!' % familyID, playerID)
         
         # 刷新水晶
         towerRMark, towerNPCID = invadeCfg[Def_FInvade_RMarkTower]
@@ -165,14 +165,18 @@
         
         if fbStep == FB_Step_Open:
             FBCommon.SetFBStep(FB_Step_MapPrepare, tick)
-            gameWorld.SetGameWorldDict(Map_FamilyInvadeFB_StartTick % curPlayer.GetFamilyID(), tick)
+            gameWorld.SetGameWorldDict(Map_FamilyInvadeFB_StartTick % familyID, tick)
     
     openServerDay = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)
     if gameWorld.GetGameWorldDictByKey(GameFBDict_LastEnterFbDay % playerID) != openServerDay + 1:
         gameWorld.SetGameWorldDict(GameFBDict_LastEnterFbDay % playerID, openServerDay + 1)
         FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyInvade)
         EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_FamilyInvade, 0, ChConfig.CME_Log_Start)
-        
+        if familyID in PyGameData.g_swrhPlayerIDDict:
+            if playerID not in PyGameData.g_swrhPlayerIDDict[familyID]:
+                PyGameData.g_swrhPlayerIDDict[familyID].append(playerID)
+        else:
+            PyGameData.g_swrhPlayerIDDict[familyID] = [playerID]
     fbStep = gameFB.GetFBStep()
     if fbStep == FB_Step_MapPrepare:
         #初始化并通知等待倒计时
@@ -364,6 +368,12 @@
     FBCommon.SetFBStep(FB_Step_Over, tick)
     
     familyID = gameFB.GetGameFBDictByKey(Map_FamilyInvadeFB_FamilyID)
+    #给参与奖励
+    joinPlayerIDList = PyGameData.g_swrhPlayerIDDict.pop(familyID, [])
+    joinAward = FBCommon.GetFBLineReward(ChConfig.Def_FBMapID_FamilyInvade, 0)
+    if joinAward:
+        PlayerControl.SendMailByKey('SwrhReward', joinPlayerIDList, joinAward)
+    
     PyGameData.g_swrhPlayerHurtDict.pop(familyID, [])
     # 时间到,踢出还在副本的玩家等...
     FBCommon.DoLogic_FBKickAllPlayer()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
index fba3f9a..d742a57 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
@@ -50,6 +50,7 @@
 g_xmzzVSPlayerData = {} # 仙魔之争对手玩家属性信息 {lineID:vsPlayerPropData, ...}
 
 g_swrhPlayerHurtDict = {} #守卫人皇玩家伤害排行信息 {familyID:{playername:hurtvalue}}
+g_swrhPlayerIDDict = {} #守卫人皇参与玩家ID {familyID:[playerID,..]}
 g_fbPickUpItemDict = {} #副本玩家拾取物品记录 {playerID:[]}
 
 g_bossShuntPlayerInfo = {} # boss分流玩家信息{(mapID, lineID):{playerID:[bossID, teamID, relatedTick], ...}, ...}

--
Gitblit v1.8.0