ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -37,6 +37,7 @@
import GameWorldAverageLv
import PlayerFamilyBoss
import PlayerHorsePetBoss
import CrossActionControl
import GameWorldProcess
import ChPyNetSendPack
import NetPackCommon
@@ -106,6 +107,7 @@
    if GameWorld.IsCrossServer():
        # 跨服不处理运营活动
        return
    CrossActionControl.SendMapServerCrossActionState()
    
    isReload, OperationActionInfo = __GetOperationActionInfo()
    mapServerInfoDict = OperationActionInfo[OperationAction_MapServerInfo]
@@ -236,7 +238,7 @@
                    customMaxServerDateTime = curDateTime + datetime.timedelta(days=(customMaxServerDay-openServerDay))
                    curStartDateTime = datetime.datetime.strptime("%s %02d:%02d:%02d" % (startDateStr, customMaxServerDateTime.hour, customMaxServerDateTime.minute, 
                                                                                         customMaxServerDateTime.second), ChConfig.TYPE_Time_Format)
                    if curServerOpenDateTime <= curStartDateTime <= customMaxServerDateTime:
                    if customOpenServerDayState and curServerOpenDateTime <= curStartDateTime <= customMaxServerDateTime:
                        if actName not in startDateInCustomCanOpenList:
                            GameWorld.Log("        按日期/周开的开始日期在开服定制限制天内,不处理! cfgID=%s,curServerOpenDateTime=%s<=curStartDateTime=%s<=customMaxServerDateTime=%s" % (cfgID, curServerOpenDateTime, curStartDateTime, customMaxServerDateTime))
                            continue
@@ -249,7 +251,7 @@
                        customMaxServerDateTime = curDateTime + datetime.timedelta(days=(maxCustomServerDayMix-mixServerDay))
                        curStartDateTime = datetime.datetime.strptime("%s %02d:%02d:%02d" % (startDateStr, customMaxServerDateTime.hour, customMaxServerDateTime.minute, 
                                                                                             customMaxServerDateTime.second), ChConfig.TYPE_Time_Format)
                        if mixStartServerDateTime <= curStartDateTime <= customMaxServerDateTime:
                        if customMixServerDayState and mixStartServerDateTime <= curStartDateTime <= customMaxServerDateTime:
                            if actName not in startDateInCustomCanOpenList:
                                GameWorld.Log("        按日期/周开的开始日期在合服定制限制天内,不处理! cfgID=%s,mixStartServerDateTime=%s<=curStartDateTime=%s<=customMaxServerDateTime=%s" % (cfgID, mixStartServerDateTime, curStartDateTime, customMaxServerDateTime))
                                continue
@@ -390,12 +392,11 @@
                        activityInfoDict[ShareDefine.ActKey_WorldLVList] = GameWorldAverageLv.GetWorldLVListByTime(startDayDate, (endDayDate - startDayDate).days)
                    
                    if startDayDate <= curDateTime < endDayDate:
                        dayIndex = 0
                        dayIndex = (curDateTime - startDayDate).days
                        actIDDateTime = startDayDate
                        isDayRest = 0 if not hasattr(ipyData, "GetIsDayReset") else ipyData.GetIsDayReset()
                        # 按时段开的默认每天重置
                        if isDayRest or (startHMStrList and endHMStrList):
                            dayIndex = (curDateTime - startDayDate).days
                            actIDDateTime += datetime.timedelta(days=dayIndex)
                        actID = int(time.mktime(actIDDateTime.timetuple())) # 默认取开始时间点的time值作为活动ID
                        activityInfoDict[ShareDefine.ActKey_DayIndex] = dayIndex
@@ -507,6 +508,7 @@
    
    if GameWorld.IsCrossServer():
        # 跨服不处理运营活动
        CrossActionControl.Dispose_CrossActState(reloadRefresh)
        return
    
    isReload, OperationActionInfo = __GetOperationActionInfo(False) # 这里必须传False
@@ -580,43 +582,52 @@
        if not isReload and preState == state:
            #已经是这个状态了
            continue
        GameWorld.Log("运营活动变更: actName=%s,preState=%s,state=%s,dictName=%s" % (actName, preState, state, dictName))
        #更新字典值
        gameWorld.SetDict(dictName, state)
        sendMapServerMsgDict = mapServerInfoDict.get(actName, {})
        
        dbOperationActIDKey = PlayerDBGSEvent.Def_OperationActID % actName
        curActID = sendMapServerMsgDict.get(ShareDefine.ActKey_ID)
        dbActID = PlayerDBGSEvent.GetDBGSTrig_ByKey(dbOperationActIDKey)
        curActID = sendMapServerMsgDict.get(ShareDefine.ActKey_ID, 0)
        dayIndex = sendMapServerMsgDict.get(ShareDefine.ActKey_DayIndex, 0)
        if curActID and PlayerDBGSEvent.GetDBGSTrig_ByKey(dbOperationActIDKey) != curActID:
        if dbActID != curActID:
            GameWorld.Log("    dbActID变更: dbActID=%s,curActID=%s" % (dbActID, curActID))
            PlayerDBGSEvent.SetDBGSTrig_ByKey(dbOperationActIDKey, curActID)
            if actName in ShareDefine.NeedWorldLVOperationActNameList:
                #记录开启时世界等级
                worldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
                PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % actName, worldLV)
            #此处为活动开启时
            if actName == ShareDefine.OperationActionName_BossReborn:
                #重置BOSS复活点
                GameWorldBoss.ResetBossRebornPoint()
            elif actName == ShareDefine.OperationActionName_FairyCeremony:
                #重置仙界盛典
                PlayerFairyCeremony.ResetFairyCeremony()
            elif actName == ShareDefine.OperationActionName_NewFairyCeremony:
                #重置仙界盛典
                PlayerNewFairyCeremony.ResetNewFairyCeremony()
            elif actName == ShareDefine.OperationActionName_FeastRedPacket:
                #重置节日红包
                if ipyData:
                    PlayerFamilyRedPacket.OnResetFeastRedPacket(ipyData, dayIndex)
            elif actName == ShareDefine.OperationActionName_FlashSale:
                #限时抢购重置购买次数 本次活动每场不能重复
                #dayIndex = sendMapServerMsgDict.get(ShareDefine.ActKey_DayIndex, 0)
                PlayerStore.ResetFlashSaleBuyCnt(ipyData)
            if curActID:
                if actName in ShareDefine.NeedWorldLVOperationActNameList:
                    #记录开启时世界等级
                    worldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
                    PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % actName, worldLV)
                    GameWorld.Log("    记录活动开启时世界等级: worldLV=%s" % (worldLV))
                #此处为活动开启时
                if actName == ShareDefine.OperationActionName_BossReborn:
                    #重置BOSS复活点
                    GameWorldBoss.ResetBossRebornPoint()
                elif actName == ShareDefine.OperationActionName_FairyCeremony:
                    #重置仙界盛典
                    PlayerFairyCeremony.ResetFairyCeremony()
                elif actName == ShareDefine.OperationActionName_NewFairyCeremony:
                    #重置仙界盛典
                    PlayerNewFairyCeremony.ResetNewFairyCeremony()
                elif actName == ShareDefine.OperationActionName_FeastRedPacket:
                    #重置节日红包
                    if ipyData:
                        PlayerFamilyRedPacket.OnResetFeastRedPacket(ipyData, dayIndex)
                elif actName == ShareDefine.OperationActionName_FlashSale:
                    #限时抢购重置购买次数 本次活动每场不能重复
                    #dayIndex = sendMapServerMsgDict.get(ShareDefine.ActKey_DayIndex, 0)
                    PlayerStore.ResetFlashSaleBuyCnt(ipyData)
        else:
            GameWorld.Log("    dbActID不变: dbActID=%s,curActID=%s" % (dbActID, curActID))
        if actName in ShareDefine.NeedWorldLVOperationActNameList:
            actWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % actName)
            sendMapServerMsgDict[ShareDefine.ActKey_WorldLV] = actWorldLV
            GameWorld.Log("    活动世界等级: actWorldLV=%s" % (actWorldLV))
        if actName == ShareDefine.OperationActionName_ExpRate:
            if isReload and ipyData:
                Sync_OperationAction_ExpRate(ipyData)
@@ -652,7 +663,7 @@
        sendMapServerMsgDict[ShareDefine.ActKey_State] = state
        GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OperationActionInfo % actName, sendMapServerMsgDict)
        
        GameWorld.Log("运营活动变更: actName=%s,preState=%s,state=%s,dictName=%s, %s" % (actName, preState, state, dictName, sendMapServerMsgDict))
        GameWorld.Log("    sendMapServerMsgDict: %s" % (sendMapServerMsgDict))
    return
def Sync_OperationAction_ExpRate(ipyData, curPlayer=None):