From 75c16c80bcacd22c5e0bc4c7a77ffca594ad4e2f Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 25 九月 2018 21:16:21 +0800
Subject: [PATCH] 1834 装备分解-服务端防范不分解非装备道具

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
index 9490f73..792951b 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
@@ -621,10 +621,15 @@
     if not ipyData:
         return
     onlineCnt = __GetBossOnlineHeroCnt(bossid)[0]
+    LVLimit = ipyData.GetLVLimit()
+    if PyGameData.g_yesterdayPlayerLVDict: 
+        yesterdayCnt = len([1 for lv in PyGameData.g_yesterdayPlayerLVDict.values() if LVLimit[0]<=lv <= LVLimit[1]]) #参数昨日活跃人数
+    else:
+        yesterdayCnt = IpyGameDataPY.GetFuncCfg('FirstDayActivePlayerCnt')
     refreshTime = eval(ipyData.GetRefreshTime())
     PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRefreshTime % bossid, refreshTime)
     __UpdateBossRefreshList(bossid, killedTime, refreshTime)
-    GameWorld.DebugLog('    设置boss刷新时间 BossID=%s,onlineCnt=%s,refreshTime=%s' % (bossid, onlineCnt, refreshTime))
+    GameWorld.DebugLog('    设置boss刷新时间 BossID=%s,onlineCnt=%s,yesterdayCnt=%s,refreshTime=%s' % (bossid, onlineCnt, yesterdayCnt, refreshTime))
     return
 
 
@@ -1074,6 +1079,37 @@
     GameWorld.Log("骑宠争夺仙盟击杀Boss数统计: %s" % PyGameData.g_familyKillHorsePetRobBossCntDict)
     return
 
+def SyncMapServer_HorsePetRobBossPlayerCount():
+    ## 活动开始前,同步有效活动人数到地图,作为Boss属性成长系数用
+    
+    diffWorldLV = int(IpyGameDataPY.GetFuncCfg("FairyGrabBossID", 3))
+    funcLimitLV = PlayerControl.GetFuncLimitLV(ShareDefine.GameFuncID_HorsePetRobBoss)
+    curWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
+    minLV = max(funcLimitLV, curWorldLV + diffWorldLV)
+    
+    playerCount = 0
+    playerManager = GameWorld.GetPlayerManager()
+    for i in xrange(playerManager.GetActivePlayerCount()):
+        findPlayer = playerManager.GetActivePlayerAt(i)
+        if findPlayer == None or not findPlayer.GetInitOK():
+            continue
+        
+        if PlayerControl.GetIsTJG(findPlayer):
+            continue
+        
+        if not findPlayer.GetFamilyID():
+            continue
+        
+        if findPlayer.GetLV() < minLV:
+            continue
+        
+        playerCount += 1
+        
+    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_HorsePetRobBossPlayerCount, playerCount)
+    GameWorld.Log("同步骑宠争夺有效参与人数: playerCount=%s,minLV=%s,funcLimitLV=%s,curWorldLV=%s,diffWorldLV=%s" 
+                  % (playerCount, minLV, funcLimitLV, curWorldLV, diffWorldLV))
+    return
+
 def OnHorsePetRobBossActionChange(isOpen):
     ## 骑宠争夺活动状态变更
     

--
Gitblit v1.8.0