hxp
2024-10-18 fb30a62bca5aa44399c1e8e9aa3dc2e5c250bbf2
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -36,6 +36,9 @@
import PlayerActFamilyCTGAssist
import PlayerActGarbageSorting
import PlayerActBossTrial
import PlayerActXianXiaMJ
import PlayerActGubao
import PlayerActHorsePetTrain
import PlayerUniversalGameRec
import GameWorldAverageLv
import PlayerFamilyBoss
@@ -742,7 +745,7 @@
        for sendMapServerMsgDict in curActMapInfoDictList:
            
            state = 0 # 默认关闭
            stateJoin = 0 # 可参与状态
            stateJoin = ShareDefine.ActStateJoin_None # 可参与状态,0-参与前;1-可参与;2-参与结束
            ipyData = None
            
            actNum = sendMapServerMsgDict.get(ShareDefine.ActKey_ActNum, 0)
@@ -773,10 +776,12 @@
                        for jIndex, joinStartDateTime in enumerate(joinStartTimeList):
                            endJoinDateTime = joinEndTimeList[jIndex]
                            if joinStartDateTime <= curDateTime < endJoinDateTime:
                                stateJoin = state
                                stateJoin = ShareDefine.ActStateJoin_Start
                                break
                            elif curDateTime >= endJoinDateTime:
                                stateJoin = ShareDefine.ActStateJoin_End
                    else:
                        stateJoin = state
                        stateJoin = ShareDefine.ActStateJoin_Start if state else ShareDefine.ActStateJoin_None
                        
                    # 全服广播提示信息
                    if curDateTime in notifyDict:
@@ -818,6 +823,12 @@
                if dbActID:
                    if actName == ShareDefine.OperationActionName_BossTrial:
                        PlayerActBossTrial.OnActEnd(actNum, ipyData, dayIndex)
                    elif actName == ShareDefine.OperationActionName_XianXiaMJ:
                        PlayerActXianXiaMJ.OnActEnd(actNum, ipyData, dayIndex)
                    elif actName == ShareDefine.OperationActionName_Gubao:
                        PlayerActGubao.OnActEnd(actNum, ipyData, dayIndex)
                    elif actName == ShareDefine.OperationActionName_HorsePetTrain:
                        PlayerActHorsePetTrain.OnActEnd(actNum, ipyData, dayIndex)
                        
                if curActID:
                    if actName in ShareDefine.NeedWorldLVOperationActNameList:
@@ -848,6 +859,12 @@
                        PlayerActGarbageSorting.OnActStart(actNum)
                    elif actName == ShareDefine.OperationActionName_BossTrial:
                        PlayerActBossTrial.OnActStart(actNum)
                    elif actName == ShareDefine.OperationActionName_XianXiaMJ:
                        PlayerActXianXiaMJ.OnActStart(actNum, ipyData)
                    elif actName == ShareDefine.OperationActionName_Gubao:
                        PlayerActGubao.OnActStart(actNum, ipyData)
                    elif actName == ShareDefine.OperationActionName_HorsePetTrain:
                        PlayerActHorsePetTrain.OnActStart(actNum, ipyData)
                    elif actName == ShareDefine.OperationActionName_FamilyCTGAssist:
                        PlayerActFamilyCTGAssist.OnActStart(actNum)
                else:
@@ -857,6 +874,34 @@
            else:
                GameWorld.Log("    dbActID不变: dbActID=%s,curActID=%s" % (dbActID, curActID))
                
            # 活动中刷新,每次都需要刷新的逻辑,包含重读配置等
            if state:
                if actName == ShareDefine.OperationActionName_BossTrial:
                    PlayerActBossTrial.OnActInStateRefresh(actNum, ipyData, dayIndex)
                elif actName == ShareDefine.OperationActionName_XianXiaMJ:
                    PlayerActXianXiaMJ.OnActInStateRefresh(actNum, ipyData)
                elif actName == ShareDefine.OperationActionName_Gubao:
                    PlayerActGubao.OnActInStateRefresh(actNum, ipyData)
                elif actName == ShareDefine.OperationActionName_HorsePetTrain:
                    PlayerActHorsePetTrain.OnActInStateRefresh(actNum, ipyData)
            # 仅活动有配置参与时间段的会触发
            if curActID and dbActID == curActID and preStateJoin != stateJoin:
                GameWorld.Log("    参与状态变更: preStateJoin=%s,stateJoin=%s" % (preStateJoin, stateJoin))
                # 参与开始
                if stateJoin == ShareDefine.ActStateJoin_Start:
                    pass
                # 参与结束
                elif stateJoin == ShareDefine.ActStateJoin_End:
                    if actName == ShareDefine.OperationActionName_BossTrial:
                        PlayerActBossTrial.OnActJoinEnd(actNum, ipyData, dayIndex)
                    elif actName == ShareDefine.OperationActionName_XianXiaMJ:
                        PlayerActXianXiaMJ.OnActJoinEnd(actNum, ipyData, dayIndex)
                    elif actName == ShareDefine.OperationActionName_Gubao:
                        PlayerActGubao.OnActJoinEnd(actNum, ipyData, dayIndex)
                    elif actName == ShareDefine.OperationActionName_HorsePetTrain:
                        PlayerActHorsePetTrain.OnActJoinEnd(actNum, ipyData, dayIndex)
            if ipyData and actName in ShareDefine.NeedWorldLVOperationActNameList:
                actWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(dbOperationActWorldLVKey)
                sendMapServerMsgDict[ShareDefine.ActKey_WorldLV] = actWorldLV