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
@@ -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