From 04643ea031c7434a7bb019aa1c05aa283ed7372d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 29 九月 2018 03:19:38 +0800
Subject: [PATCH] 3928 【后端】增加多倍经验活动在活动期间的循环广播
---
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py | 9 +++++----
ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 7 +++++--
PySysDB/PySysDBG.h | 1 +
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h
index 7e919ba..052b7aa 100644
--- a/PySysDB/PySysDBG.h
+++ b/PySysDB/PySysDBG.h
@@ -248,6 +248,7 @@
list EndTimeList; //结束时间列表, 支持多个时段
dict NotifyInfoStart; //全服提示信息 - 相对开始时间
dict NotifyInfoEnd; //全服提示信息 - 相对结束时间
+ list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key, [可选参数1, ...]]
WORD LVLimit; //限制等级
DWORD AddExpRate; //经验倍率加成,万分率
};
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
index 77674c2..7ee030f 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -179,7 +179,7 @@
notifyInfoDictStart = ipyData.GetNotifyInfoStart() if hasattr(ipyData, "GetNotifyInfoStart") else {}
notifyInfoDictEnd = ipyData.GetNotifyInfoEnd() if hasattr(ipyData, "GetNotifyInfoEnd") else {}
- notifyInfoLoopInfo = ipyData.GetNotifyInfoLoop() if hasattr(ipyData, "GetNotifyInfoLoop") else {} # [循环分钟, 广播key]
+ notifyInfoLoopInfo = ipyData.GetNotifyInfoLoop() if hasattr(ipyData, "GetNotifyInfoLoop") else {} # [循环分钟, 广播key, [广播参数列表可选]]
if len(startHMStrList) != len(endHMStrList):
GameWorld.ErrLog(" 活动配置开始及结束时间个数不匹配! actName=%s,cfgID=%s,startHMStrList=%s,endHMStrList=%s"
@@ -267,9 +267,10 @@
isNotify = True
# 广播 - 循环广播
- if notifyInfoLoopInfo and len(notifyInfoLoopInfo) == 2:
- loopMinutes, loopNotifyKey = notifyInfoLoopInfo
- notifyInfo = [loopNotifyKey, []] # 循环广播的默认无参数,不做支持
+ if notifyInfoLoopInfo and len(notifyInfoLoopInfo) >= 2:
+ loopMinutes, loopNotifyKey = notifyInfoLoopInfo[:2]
+ loopNotifyParamList = notifyInfoLoopInfo[2] if len(notifyInfoLoopInfo) > 2 else []
+ notifyInfo = [loopNotifyKey, loopNotifyParamList] # 循环广播的默认无参数
loopCount, loopMaxCount = 0, 100
while loopMinutes and loopNotifyKey and loopCount < loopMaxCount:
loopCount += 1
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
index 4ae0037..c96aa40 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -221,6 +221,7 @@
("list", "EndTimeList", 0),
("dict", "NotifyInfoStart", 0),
("dict", "NotifyInfoEnd", 0),
+ ("list", "NotifyInfoLoop", 0),
("WORD", "LVLimit", 0),
("DWORD", "AddExpRate", 0),
),
@@ -672,6 +673,7 @@
self.EndTimeList = []
self.NotifyInfoStart = {}
self.NotifyInfoEnd = {}
+ self.NotifyInfoLoop = []
self.LVLimit = 0
self.AddExpRate = 0
return
@@ -685,6 +687,7 @@
def GetEndTimeList(self): return self.EndTimeList # 结束时间列表, 支持多个时段
def GetNotifyInfoStart(self): return self.NotifyInfoStart # 全服提示信息 - 相对开始时间
def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
+ def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key, [可选参数1, ...]]
def GetLVLimit(self): return self.LVLimit # 限制等级
def GetAddExpRate(self): return self.AddExpRate # 经验倍率加成,万分率
@@ -1287,7 +1290,7 @@
'''查询条件下与对应查询字段参考值相近的数据实例;参考值小于配置表最小值时返回none,大于最大值时返回最大值对应的实例
@param dtName: 表名,不含tag
@param keyName: 参考字段名
- @param keyValue: 参考字段值
+ @param keyValue: 参考字段值,大于等于字段值时返回对应数据
@param conditionDict: 查询条件,{查询字段名:字段值, ...}
@return: 找不到数据返回 None , 否则返回对应的 ipyData 数据实例
'''
@@ -1319,7 +1322,7 @@
for i in xrange(near - 1, low - 1, -1):
nearData = dataList[i]
nearValue = getattr(nearData, "%s" % keyName)
- if nearValue < keyValue:
+ if nearValue <= keyValue:
return nearData
elif keyValue > nearValue:
--
Gitblit v1.8.0