| | |
| | | curDateTime = datetime.datetime.strptime("%d-%d-%d %d:%d:00" % (curDateTime.year, curDateTime.month, curDateTime.day,
|
| | | curDateTime.hour, curDateTime.minute), ChConfig.TYPE_Time_Format)
|
| | |
|
| | | startDateInCustomCanOpenList = IpyGameDataPY.GetFuncEvalCfg("OperationAction", 2) # 开始天在定制天内在定制天结束后可继续开启的活动列表
|
| | | |
| | | for actName in ShareDefine.OperationActionNameList:
|
| | |
|
| | | state = 0 # 默认关闭
|
| | |
| | | #notifyDict = {} # {notifyDateTime:[notifyKey, [参数]], ...}
|
| | | #ipyData 可能为 None
|
| | | ipyData, startList, endList, notifyDict = operationActionDict[actName]
|
| | | |
| | | if actName in startDateInCustomCanOpenList:
|
| | | # 由于某些活动的开始天允许和前定制X天有交叉的情况出现(实际不开,会等定制结束后才接下去开)
|
| | | # 所以会有时间交叉的情况出现,这种活动goon单独判断
|
| | | # 为防止动到其他活动,允许交叉的活动另外处理,理论上可以统一逻辑,为保险起见分开处理
|
| | | |
| | | # 精确匹配开启
|
| | | if curDateTime in startList:
|
| | | state = startList.index(curDateTime) + 1 # 也是代表第几个时间段
|
| | | # 精确匹配关闭
|
| | | elif curDateTime in endList:
|
| | | state = 0
|
| | | |
| | | # goon ״̬
|
| | | for dIndex, startDateTime in enumerate(startList):
|
| | | endDateTime = endList[dIndex]
|
| | | if startDateTime < curDateTime < endDateTime:
|
| | | state = dIndex + 1
|
| | | break
|
| | | |
| | | else:
|
| | | # 精确匹配开启
|
| | | if curDateTime in startList:
|
| | | state = startList.index(curDateTime) + 1 # 也是代表第几个时间段
|