From be1496bfd2b5e0d180e07e0f1a35aa3a741160f4 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 18 四月 2022 16:14:38 +0800
Subject: [PATCH] 9553 【主干】【BT6】【BT6】【yn_1.0.1】【后端】新增下载奖励
---
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 50 insertions(+), 1 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py
index d22858e..717d12e 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py
@@ -24,6 +24,8 @@
import NetPackCommon
import ShareDefine
import IpyGameDataPY
+import PlayerDBGSEvent
+import PlayerControl
import ChConfig
import time
@@ -88,6 +90,7 @@
# @return None
def OnLogin(curPlayer):
NotifyFamilyBossFBInfo(curPlayer)
+ NotifyAllFamilyBossState(curPlayer)
return
@@ -182,7 +185,7 @@
#通知地图服务器刷新
PlayerFamily.SendPack_MapServer_PlayerFamilyRefresh(curFamily)
GameWorld.Log(" __DoOpenCostLogic 扣除家族兽粮=%s OK!, familyID=%s,playerFamilyLV=%s"
- % (foodCost, curFamily.GetFamilyID(), curMember.GetFamilyLV()), curPlayer.GetPlayerID())
+ % (foodCost, curPlayer.GetFamilyID(), curMember.GetFamilyLV()), curPlayer.GetPlayerID())
return True
@@ -272,4 +275,50 @@
+#############################多仙盟BOSS#############################
+def OnAllFamilyBossStateChange(isOpen):
+ if isOpen:
+ #本次开启时间距离上次击杀时间超过1小时则重置
+ lastKillTime = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime)
+ curTime = int(time.time())
+ if abs(curTime-lastKillTime)> 3600:
+ PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime, 0)
+ #通知
+ NotifyAllFamilyBossState()
+ return
+
+def AllFamilyBossKilled():
+ if PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime):
+ GameWorld.Log('多仙盟Boss已被击杀,不可重复!!')
+ return
+ curTime = int(time.time())
+ PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime, curTime)
+ GameWorld.Log('多仙盟Boss被击杀!!')
+ NotifyAllFamilyBossState()
+ return
+
+def NotifyAllFamilyBossState(curPlayer=None):
+ lastKillTime = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime)
+ bossInfo = ChPyNetSendPack.tagGCAllFamilyBossInfo()
+ bossInfo.IsEnd = 1 if lastKillTime else 0
+
+ if curPlayer == None:
+ playerManager = GameWorld.GetPlayerManager()
+ for i in xrange(playerManager.GetActivePlayerCount()):
+ curPlayer = playerManager.GetActivePlayerAt(i)
+ if curPlayer == None or not curPlayer.GetInitOK():
+ continue
+ if PlayerControl.GetIsTJG(curPlayer):
+ continue
+ NetPackCommon.SendFakePack(curPlayer, bossInfo)
+ else:
+ if PlayerControl.GetIsTJG(curPlayer):
+ return
+ NetPackCommon.SendFakePack(curPlayer, bossInfo)
+ return
+
+#是否在仙盟BOSS活动中
+def IsInAllFamilyBoss(lineID=-1):
+ state1 = GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyBoss1)
+ return state1
\ No newline at end of file
--
Gitblit v1.8.0