From a390fdd7f9dd14e2b1c5793088131bc90ebf3dc6 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 01 七月 2024 20:05:35 +0800
Subject: [PATCH] 9802 9762 【后端】藏宝阁修改(修复拥有八卦炉古宝2303时加属性点导致战力临时下降bug;)
---
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py | 70 +++++++++++++++++++++++++++-------
1 files changed, 55 insertions(+), 15 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
index f8a3320..d8ae9bd 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -33,6 +33,7 @@
import PlayerFamilyRedPacket
import PlayerFairyCeremony
import PlayerNewFairyCeremony
+import PlayerActFamilyCTGAssist
import PlayerActGarbageSorting
import PlayerActBossTrial
import PlayerUniversalGameRec
@@ -109,10 +110,11 @@
def SendMapServerOperationActionState():
# 地图启动成功时通知本日运行活动相关状态
+ CrossActionControl.SendMapServerCrossActionState()
+
if GameWorld.IsCrossServer():
# 跨服不处理运营活动
return
- CrossActionControl.SendMapServerCrossActionState()
isReload, OperationActionInfo = __GetOperationActionInfo()
mapServerInfoDict = OperationActionInfo[OperationAction_MapServerInfo]
@@ -142,7 +144,7 @@
活动分组编号 = 活动类型 * 10 + 不同界面编号
'''
- if ipyData and hasattr(ipyData, "ActNum"):
+ if ipyData and hasattr(ipyData, "GetActNum"):
return ipyData.GetActNum()
# 原节日活动的还是默认节日活动
@@ -246,9 +248,9 @@
for ipyData in curServerActIpyDataList:
- platformList = [] if not hasattr(ipyData, "PlatformList") else ipyData.GetPlatformList()
- serverGroupIDList = [] if not hasattr(ipyData, "ServerGroupIDList") else ipyData.GetServerGroupIDList()
- serverGroupIDListExcept = [] if not hasattr(ipyData, "ServerGroupIDListExcept") else ipyData.GetServerGroupIDListExcept()
+ platformList = [] if not hasattr(ipyData, "GetPlatformList") else ipyData.GetPlatformList()
+ serverGroupIDList = [] if not hasattr(ipyData, "GetServerGroupIDList") else ipyData.GetServerGroupIDList()
+ serverGroupIDListExcept = [] if not hasattr(ipyData, "GetServerGroupIDListExcept") else ipyData.GetServerGroupIDListExcept()
cfgID = ipyData.GetCfgID()
startDateStr = ipyData.GetStartDate()
endDateStr = ipyData.GetEndDate()
@@ -374,6 +376,13 @@
GameWorld.Log(" 非法配置,未知活动类型,不处理! cfgID=%s,actNum=%s" % (cfgID, actNum))
continue
+ if hasattr(ipyData, "GetJoinStartTime") and hasattr(ipyData, "GetJoinEndTime"):
+ joinStartTimeStr = ipyData.GetJoinStartTime()
+ joinEndTimeStr = ipyData.GetJoinEndTime()
+ else:
+ joinStartTimeStr = ""
+ joinEndTimeStr = ""
+
if hasattr(ipyData, "GetStartTimeList") and hasattr(ipyData, "GetEndTimeList"):
startHMStrList = ipyData.GetStartTimeList()
endHMStrList = ipyData.GetEndTimeList()
@@ -390,6 +399,7 @@
% (actName, cfgID, startHMStrList, endHMStrList))
continue
+ isDayRest = 0 if not hasattr(ipyData, "GetIsDayReset") else ipyData.GetIsDayReset()
resetType = 0 if not hasattr(ipyData, "GetResetType") else ipyData.GetResetType() # 重置类型,0-0点重置;1-5点重置
if resetType == 1:
startDayDate = datetime.datetime.strptime("%s 05:00:00" % (startDateStr), ChConfig.TYPE_Time_Format)
@@ -497,6 +507,17 @@
GameWorld.Log(" startList=%s" % (startList))
GameWorld.Log(" end List=%s" % (endList))
+ joinStartTimeList, joinEndTimeList = [], [] # 可指定活动可参与的时间点,不影响活动状态,只影响活动某些功能的参与时机,如上榜类
+ if joinStartTimeStr:
+ if isDayRest:
+ joinStartTimeList.append(datetime.datetime.strptime("%d-%d-%d %s:00" % (curDateTime.year, curDateTime.month, curDateTime.day, joinStartTimeStr), ChConfig.TYPE_Time_Format))
+ joinEndTimeList.append(datetime.datetime.strptime("%d-%d-%d %s:00" % (curDateTime.year, curDateTime.month, curDateTime.day, joinEndTimeStr), ChConfig.TYPE_Time_Format))
+ else:
+ joinStartTimeList.append(datetime.datetime.strptime("%s %s:00" % (startDateStr, joinStartTimeStr), ChConfig.TYPE_Time_Format))
+ joinEndTimeList.append(datetime.datetime.strptime("%s %s:00" % (endDateStr, joinEndTimeStr), ChConfig.TYPE_Time_Format))
+ GameWorld.Log(" joinStartTimeList=%s" % (joinStartTimeList))
+ GameWorld.Log(" joinEndTime List=%s" % (joinEndTimeList))
+
for dtIndex, startDateTime in enumerate(startList):
endDateTime = endList[dtIndex]
# 广播 - 相对实际开始时间
@@ -542,9 +563,9 @@
if actName in ShareDefine.MultiActNumOperationActNameList:
if actName not in operationTodayActionDict:
operationTodayActionDict[actName] = {} # 今日有需要处理的才初始化
- operationTodayActionDict[actName][actNum] = [ipyData, startList, endList, notifyDict]
+ operationTodayActionDict[actName][actNum] = [ipyData, startList, endList, notifyDict, joinStartTimeList, joinEndTimeList]
else:
- operationTodayActionDict[actName] = [ipyData, startList, endList, notifyDict]
+ operationTodayActionDict[actName] = [ipyData, startList, endList, notifyDict, joinStartTimeList, joinEndTimeList]
if isActTime:
activityInfoDict = {ShareDefine.ActKey_CfgID:cfgID, ShareDefine.ActKey_ActNum:actNum}
@@ -558,7 +579,6 @@
dayIndex = (curDateTime - startDayDate).days
actIDDateTime = startDayDate
- isDayRest = 0 if not hasattr(ipyData, "GetIsDayReset") else ipyData.GetIsDayReset()
# 按时段开的默认每天重置
if isDayRest or (startHMStrList and endHMStrList):
actIDDateTime += datetime.timedelta(days=dayIndex)
@@ -599,9 +619,9 @@
actCfgCount = getattr(ipyDataMgr, "Get%sCount" % actName)()
for cfgIndex in xrange(actCfgCount):
ipyData = getattr(ipyDataMgr, "Get%sByIndex" % actName)(cfgIndex)
- platformList = [] if not hasattr(ipyData, "PlatformList") else ipyData.GetPlatformList()
- serverGroupIDList = [] if not hasattr(ipyData, "ServerGroupIDList") else ipyData.GetServerGroupIDList()
- serverGroupIDListExcept = [] if not hasattr(ipyData, "ServerGroupIDListExcept") else ipyData.GetServerGroupIDListExcept()
+ platformList = [] if not hasattr(ipyData, "GetPlatformList") else ipyData.GetPlatformList()
+ serverGroupIDList = [] if not hasattr(ipyData, "GetServerGroupIDList") else ipyData.GetServerGroupIDList()
+ serverGroupIDListExcept = [] if not hasattr(ipyData, "GetServerGroupIDListExcept") else ipyData.GetServerGroupIDListExcept()
if platformList and platform not in platformList:
continue
@@ -722,6 +742,7 @@
for sendMapServerMsgDict in curActMapInfoDictList:
state = 0 # 默认关闭
+ stateJoin = 0 # 可参与状态
ipyData = None
actNum = sendMapServerMsgDict.get(ShareDefine.ActKey_ActNum, 0)
@@ -734,12 +755,12 @@
else:
todayActInfoList = operationTodayActionDict[actName]
- if isinstance(todayActInfoList, list) and len(todayActInfoList) == 4:
+ if isinstance(todayActInfoList, list) and len(todayActInfoList) == 6:
#startList = [] # [startDateTime, ...]
#endList = [] # [endDateTime, ...]
#notifyDict = {} # {notifyDateTime:[notifyKey, [参数]], ...}
#ipyData 可能为 None
- ipyData, startList, endList, notifyDict = todayActInfoList
+ ipyData, startList, endList, notifyDict, joinStartTimeList, joinEndTimeList = todayActInfoList
# 状态
for dIndex, startDateTime in enumerate(startList):
@@ -747,6 +768,15 @@
if startDateTime <= curDateTime < endDateTime:
state = dIndex + 1 # 代表第几个时间段
break
+
+ if joinStartTimeList:
+ for jIndex, joinStartDateTime in enumerate(joinStartTimeList):
+ endJoinDateTime = joinEndTimeList[jIndex]
+ if joinStartDateTime <= curDateTime < endJoinDateTime:
+ stateJoin = state
+ break
+ else:
+ stateJoin = state
# 全服广播提示信息
if curDateTime in notifyDict:
@@ -757,12 +787,19 @@
if actName in ShareDefine.MultiActNumOperationActNameList:
dictName += "_%s" % actNum
preState = gameWorld.GetDictByKey(dictName)
- if not isReload and preState == state:
+
+ dictNameJoin = ChConfig.Def_WorldKey_OperationActionStateJoin % actName
+ if actName in ShareDefine.MultiActNumOperationActNameList:
+ dictNameJoin += "_%s" % actNum
+ preStateJoin = gameWorld.GetDictByKey(dictNameJoin)
+
+ if not isReload and preState == state and preStateJoin == stateJoin:
#已经是这个状态了
continue
- GameWorld.Log("运营活动变更: actName=%s,actNum=%s,preState=%s,state=%s,dictName=%s" % (actName, actNum, preState, state, dictName))
+ GameWorld.Log("运营活动变更: actName=%s,actNum=%s,preState=%s,state=%s,preStateJoin=%s,stateJoin=%s" % (actName, actNum, preState, state, preStateJoin, stateJoin))
#更新字典值
gameWorld.SetDict(dictName, state)
+ gameWorld.SetDict(dictNameJoin, stateJoin)
dbOperationActIDKey = PlayerDBGSEvent.Def_OperationActID % actName
dbOperationActWorldLVKey = PlayerDBGSEvent.Def_OActWorldLV % actName
@@ -811,6 +848,8 @@
PlayerActGarbageSorting.OnActStart(actNum)
elif actName == ShareDefine.OperationActionName_BossTrial:
PlayerActBossTrial.OnActStart(actNum)
+ elif actName == ShareDefine.OperationActionName_FamilyCTGAssist:
+ PlayerActFamilyCTGAssist.OnActStart(actNum)
else:
if actName == ShareDefine.OperationActionName_GarbageSorting:
PlayerActGarbageSorting.OnActEnd(actNum)
@@ -859,6 +898,7 @@
#GameWorld.SendMapServerMsgEx(dictName, state) # 运营活动不单独通知活动状态,需与活动信息整合后一起通知
sendMapServerMsgDict[ShareDefine.ActKey_State] = state
+ sendMapServerMsgDict[ShareDefine.ActKey_StateJoin] = stateJoin
GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OperationActionInfo % actName, sendMapServerMsgDict)
GameWorld.Log(" sendMapServerMsgDict: %s" % (sendMapServerMsgDict))
--
Gitblit v1.8.0