From dd3d1998f3a219118b9c24af1763a96e1fef85d1 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 28 一月 2019 17:45:23 +0800
Subject: [PATCH] 6112 【后端】【1.5.200】诛仙塔优化

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py
index eea8d25..8f3468d 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py
@@ -37,6 +37,7 @@
 
 #非VIP权限
 Def_GeTui_FMT = -2 # 封魔坛
+Def_GeTui_ZhuXianBoss = -3 # 诛仙BOSS
 
 # 新玩家还没有脱机时间 有利于挽回流失玩家
 g_NewGuyNoTJGTime = {} # {playerID:[playername,getuiid, tick]}
@@ -99,7 +100,7 @@
             return True
         return False
     
-    if geTuiType == Def_GeTui_FMT:
+    if geTuiType in [Def_GeTui_FMT, Def_GeTui_ZhuXianBoss]:
         # 封魔坛受VIP的关注BOSS开关影响
         geTuiType = Def_Onoff_Boss
     
@@ -235,8 +236,21 @@
             return False
         
         g_FMTGeTuiLimit[playerID][bossID] = int(time.time())
-            
-            
+    elif geTuiType == Def_GeTui_ZhuXianBoss:
+        if not cacheDict.get("CntMark_%s"%ChConfig.Def_FBMapID_ZhuXianBoss, 0):
+            return False
+        
+        # 比较频繁默认1小时通知一次
+        if playerID not in g_FMTGeTuiLimit:
+            g_FMTGeTuiLimit[playerID] = {}
+        
+        lastTime = g_FMTGeTuiLimit[playerID].get(bossID, 0)
+        if lastTime != 0 and time.time() - lastTime < 3600:
+            # 离上次通知还没超过1小时
+            return False
+        
+        g_FMTGeTuiLimit[playerID][bossID] = int(time.time())
+       
     elif geTuiType == Def_Onoff_Boss:
         #重生boss
         killBossCntLimitDict = IpyGameDataPY.GetFuncEvalCfg('KillBossCntLimit', 1, {})
@@ -253,6 +267,9 @@
     if bossData.GetMapID() == ChConfig.Def_FBMapID_SealDemon:
         # 非VIP玩家 封魔坛个推
         geTuiType = Def_GeTui_FMT
+    elif bossData.GetMapID() == ChConfig.Def_FBMapID_ZhuXianBoss:
+        # 非VIP玩家 诛仙BOSS个推
+        geTuiType = Def_GeTui_ZhuXianBoss
     else:
         geTuiType = Def_Onoff_Boss
         
@@ -281,7 +298,7 @@
             # 判断BOSS剩余次数, 避免通知频繁
             continue
         
-        appID = GameWorld.GetPlayerPlatform(cacheDict.get("AccID", ""))
+        appID = cacheDict.get("AppID", "")
         if appID not in appIDDict:
             appIDDict[appID] = []
             
@@ -296,6 +313,8 @@
     
     if geTuiType == Def_GeTui_FMT:
         showStr = GameWorld.GbkToCode(IpyGameDataPY.GetFuncCfg("GeTuiOffLine", 1)%(npcName, npcLV))    # 文字信息
+    elif geTuiType == Def_GeTui_ZhuXianBoss:
+        showStr = GameWorld.GbkToCode(IpyGameDataPY.GetFuncCfg("GeTuiOffLine", 5)%(npcName, npcLV))    # 文字信息
     elif geTuiType == Def_Onoff_Boss:
         showStr = GameWorld.GbkToCode(IpyGameDataPY.GetFuncCfg("GeTuiOffLine", 2)%(bossData.GetSourceName(), npcName, npcLV))    # 文字信息
         
@@ -314,7 +333,7 @@
         return
     
     showStr = GameWorld.GbkToCode(IpyGameDataPY.GetFuncCfg("GeTuiOffLine", 3))%(tagPlayerName)    # 文字信息
-    GeTuiNotify({GameWorld.GetPlayerPlatform(cacheDict.get("AccID", "")):[[cacheDict.get("GeTuiClientID", ""), playerName]]}, showStr)
+    GeTuiNotify({cacheDict.get("AppID", ""):[[cacheDict.get("GeTuiClientID", ""), playerName]]}, showStr)
     return
 
 # 下线时,低级玩家没有离线时间的玩家提示, 上线清空
@@ -326,7 +345,7 @@
         return
     playerID = curPlayer.GetID()
     g_NewGuyNoTJGTime[playerID] = [curPlayer.GetName(), curPlayer.GetGeTuiClientID(), tick, 
-                                   GameWorld.GetPlayerPlatform(curPlayer.GetAccID())]  # curPlayer.GetGeTuiClientID()
+                                   GameWorld.GetPlayerPlatform(curPlayer)]  # curPlayer.GetGeTuiClientID()
     return
 
 # 上线清除

--
Gitblit v1.8.0