Просмотр исходного кода

提交累积充值活动、阵容推荐 修复bug

SCFC 1 год назад
Родитель
Сommit
aa34d05c53

+ 377 - 364
script/common/CommonDB.lua

@@ -1,365 +1,378 @@
-local DB = require("common.DB")
-local LuaMongo = _G.lua_mongo
-local Config = require("Config")
-local Util = require("common.Util")
-local ObjHuman = require("core.ObjHuman")
-local YunYingLogic = require("yunying.YunYingLogic")
-local OpenAct = require("present.OpenAct")
-
-local DBUpdate = {_id=nil}								-- 更新	
-local DBUpdateField = {}								-- 更新域
-
-
-KEY_SERVER_START_TIME = "serverStartTime"				-- 开服时间
-KEY_IDENTITY_MAX = "identityMax"						-- 自增的最大的数字 从1开始
-KEY_UNION_IDENTITY_MAX = "unionIdentityMax"				-- 自增的最大的数字 从1开始
-KEY_REWARD_INDEX = "rewardIndex"						-- 好友排行榜奖励索引rewardIndex
-KEY_BAN_IP = "banIp"									-- 被禁IP
-KEY_CHONGJI_ACT = "chongJiAct"							-- 全服冲级活动 领取情况
-KEY_ACT_MONTH = "actMonth"								-- 当前计算的真实月份
-KEY_UNION_WAR = "unionWar"								-- 公会战
-KEY_ACT_MONTH_LIST = "actMonthList"						-- 现实活动
-KEY_RESET_TIME = "resetTime"
-KEY_DRILL = "drill"										-- 过关斩将信息(本期开始时间等)
-KEY_SHARE_PLATFORM_BOARD = "sharePlatformBoard"			-- 分享排行
-KEY_BILLBOARD_AIM = "billboardAim"						-- 排行榜达标记录
-KEY_JJC_LADDER = "jjcLadder"							-- 天梯争霸信息
-KEY_VALLEY = "valley"									-- 荣耀峡谷信息
-KEY_LIANYU = "lianyu" 									-- 绝望深渊信息
-KEY_MIDDLE_INFO = "middleInfo"							-- 跨服链接信息
-KEY_CHAMPION_END_TIME = "championEndTime"				-- 冠军竞技场本赛季结束时间
-KEY_DRAGON_NEST_CITIAO = "dragonNestCiTiao"             -- 冰龙巢穴词条
-KEY_WORK_MAN = "workMan"                                -- 打工人活动
-KEY_OPEN_SERVER_TOPUP_TOP = "openServerTopupTop"		-- 开服充值排名活动
-KEY_CIYUAN_MOZHU = "ciyuanMoZhu"                        -- 次元魔蛛
-KEY_YJ_TIME = "yjTreasureTime"                          -- 遗迹探险时间
-KEY_CDK_BATCH = "cdkBatchIdx"                           -- CDK批次序号
-KEY_WEEKLOOP_CARD_BATCH = "weekLoopCardBatch"			-- 周活动-抽卡批次
-
-db = db or {
-	serverStartTime = nil,								-- 开服时间
-	zhuanpanRecord = nil,								-- 转盘中奖记录
-	identityMax = nil,									-- 自增的最大的数字 从1开始
-    rewardIndex = nil,                                  -- 好友排行榜奖励索引rewardIndex
-    unionIdentityMax = nil,                             -- 自增的最大的数字 从1开始
-    mergeSvrIndex = nil,								-- 合服之后对应的服务器索引 比如如果10001,10003,100004合服了 这里的数据结构是{10001,10003,10004}
-    banIp = {},                                         -- 被禁IP
-	chongJiAct  = {},                                   -- 全服冲级活动 领取情况
-	actMonth = nil,                                     -- 当前计算的真实月份
-	unionWarState = nil,                                -- 当前工会战状态
-	actMonthList = nil,                                 -- 现实活动
-	resetTime = nil,                                    -- 确认是否重置数据
-	middleInfo = {},									-- 跨服链接信息
-	championEndTime = nil,							    -- 冠军竞技场本赛季结束时间
-	dragonNestCiTiao = {},                              -- 冰龙巢穴词条
-	workMan = {},                                       -- 打工人活动
-	ciyuanMoZhu = nil,                                  -- 次元魔蛛 
-    yjTreasureTime = nil,                               -- 遗迹探险时间
-	cdkBatchIdx = nil,									-- CDK批次序号
-	weekLoopCardBatch = nil,							-- 周活动-抽卡批次
-}
-
-function init()
-	LuaMongo.find(DB.db_common)
-	if not LuaMongo.next(db) then
-		LuaMongo.insert(DB.db_common, db)
-	end
-end
-
--- 修改db单个字段
-function updateValue(key, value)
-	if not key then return end	
-	if not db then return end
-	if value then
-		DBUpdateField["$set"] = {[key]=value}
-		DBUpdateField["$unset"] = nil
-	else
-		DBUpdateField["$set"] = nil
-		DBUpdateField["$unset"] = {[key]=1}
-	end
-	DBUpdate._id = db._id
-	db[key] = value
-	LuaMongo.update(DB.db_common, DBUpdate, DBUpdateField)
-end
-
-function getCDKBatch()
-	if not db  then 
-		return
-	end
-	return db[KEY_CDK_BATCH] or 0
-end
-
-function setCDKBatch(idx)
-	idx = idx + 1
-	updateValue(KEY_CDK_BATCH,idx)
-end
-
-function getValueByKey(key)
-	if not db then return end
-	return db[key]
-end
-
--- 同步db内容
-function reset()
-	LuaMongo.find(DB.db_common)
-	
-	if not LuaMongo.next(db) then
-		db = {banIp = {},}
-	end
-	print("db.serverStartTime:",db.serverStartTime)
-end
-
--- 设置开服时间
-function setServerOpenTime(time)
-	db.serverStartTime = time
-	updateValue(KEY_SERVER_START_TIME, time)
-	
-    YunYingLogic.onServerOpenTime()
-	OpenAct.onServerOpenTime()
-end
-
-function getServerOpenTime()
-	if not db.serverStartTime then 
-		local t = Util.getDayStartTime()
-		setServerOpenTime(t)
-	end
-	return  db.serverStartTime
-end
-
--- 获得当前是开服第几天(如果是开服第一天返回1)
-function getServerOpenDay()
-	local openTime = getServerOpenTime()
-	if openTime == 0 then
-		return
-	end
-	
-	local startTime = Util.getDayStartTime(openTime)
-	
-	local now = os.time()
-	return math.ceil((now - startTime + 1) / 24 / 3600)
-end
-
-function getIdentityMax()
-	if db.identityMax == nil then
-		db.identityMax = math.random(10001, 20000)	
-		setIdentityMax(db.identityMax)
-	elseif db.identityMax < 10001 then
-		db.identityMax = math.random(10001, 20000) -- 兼容老规则下数据
-		setIdentityMax(db.identityMax)
-	end
-	
-	return db.identityMax
-end
-
--- 虚拟ID,假的
-function getFakeIdentityMax()
-	return math.random(1, 9999)
-end
-
-function setIdentityMax(idMax)
-	updateValue(KEY_IDENTITY_MAX, idMax)
-end
-
-function getUnionIdentityMax()
-	if db.unionIdentityMax == nil then
-		db.unionIdentityMax = math.random(10001, 20000)	
-		setUnionIdentityMax(db.unionIdentityMax)
-	elseif db.unionIdentityMax < 10001 then
-		db.unionIdentityMax = math.random(10001, 20000) -- 兼容老规则下数据
-		setUnionIdentityMax(db.unionIdentityMax)
-	end
-	
-	return db.unionIdentityMax
-end
-
-function setUnionIdentityMax(idMax)
-	updateValue(KEY_UNION_IDENTITY_MAX, idMax)
-end
-
-function getRewardIndex()
-	return db.rewardIndex or 0
-end
-
-function setRewardIndex(rewardIndex)
-	updateValue(KEY_REWARD_INDEX, rewardIndex)
-end
-
-function getMergeSvrIndex()
-	return db.mergeSvrIndex
-end
-
-cnt = 1
-function setBanIp(ip,time)
-    db.banIp[cnt] =db.banIp[cnt] or {}
-    db.banIp[cnt].ip = ip
-    db.banIp[cnt].time = time
-    cnt = cnt + 1
-	
-	updateValue(KEY_BAN_IP, db.banIp)
-end
-
-function getBanIp(ip)
-    for k,v in pairs(db.banIp) do
-        if v.ip == ip then
-            return v.ip,v.time
-        end
-    end
-    return 
-end
-
-function delBanIp(ip)
-    for k,v in pairs(db.banIp) do
-        if v.ip == ip then
-            db.banIp[k] = nil
-        end
-    end
-
-    updateValue(KEY_BAN_IP, db.banIp)
-end
-
--- 全服创号 冲级活动
-function getSvrChongJiGet(id)
-	local num = 0 
-	if not db.chongJiAct then
-		return num
-	end
-
-	if db.chongJiAct[id] then
-		num = db.chongJiAct[id] or 0
-	end
-
-	return num
-end
-
-function addSvrChongJiGet(id)
-	db.chongJiAct = db.chongJiAct or {}
-    db.chongJiAct[id] = db.chongJiAct[id] or 0
-    db.chongJiAct[id] = db.chongJiAct[id] + 1
-
-	updateValue(KEY_CHONGJI_ACT, db.chongJiAct)	
-end
-
-function getActMonth()
-    return db.actMonth or 0
-end
-
-function setActMonth(month)
-	updateValue(KEY_ACT_MONTH, month)	
-end
-
-function getActMonthList(id)
-	local act = nil 
-	if not db.actMonthList then
-		return act
-	end
-
-	if db.actMonthList[id] then
-		act = db.actMonthList[id] or 0
-	end
-
-	return act
-end
-
-function setActMonthList(id, endTime, month)
-	db.actMonthList = db.actMonthList or {}
-    db.actMonthList[id] = db.actMonthList[id] or {}
-    db.actMonthList[id].endTime = endTime
-	db.actMonthList[id].month = month
-	updateValue(KEY_ACT_MONTH_LIST, db.actMonthList)
-end
-
-function getResetTime()
-	return db.resetTime or 0
-end
-
-function setResetTime(time)
-	updateValue(KEY_RESET_TIME, time)
-end
-
-function getMiddleInfo()
-	return db.middleInfo
-end
-
-function setMiddleInfo(ip, port, host)
-	db.middleInfo.ip = ip
-	db.middleInfo.port = port
-	db.middleInfo.host = host
-	updateValue(KEY_MIDDLE_INFO, db.middleInfo)
-end
-
-function getChampionEndTime()
-	return db.championEndTime or 0
-end
-
-function setChampionEndTime(time)
-	updateValue(KEY_CHAMPION_END_TIME, time)
-end
-
-function getDragonNestCitiao()
-	return db.dragonNestCiTiao
-end
-
-function setDragonNestCitiao(list, time)
-	db.dragonNestCiTiao.citiao = Util.copyTable(list)
-	db.dragonNestCiTiao.time = time
-	updateValue(KEY_DRAGON_NEST_CITIAO, db.dragonNestCiTiao)
-end
-
-function setWorkManState(state)
-    db.workMan.state = state
-    updateValue(KEY_WORK_MAN, db.workMan)
-end
-
-function setWorkManGroup(group)
-    db.workMan.group = group
-    updateValue(KEY_WORK_MAN, db.workMan)
-end
-
-function setWorkManTs(ts)
-    db.workMan.time = ts
-    updateValue(KEY_WORK_MAN, db.workMan)
-end
-
-function getWorkMan()
-	return db.workMan
-end
-
--- 获取合服时间
-function getMergeServerTime()
-	return db.mergeServerTime or 0
-end
-
-
--- 获得当前是合服第几天(如果是合服第一天返回1)
-function getServerMergeDay()
-	local mergeTime = getMergeServerTime()
-	if mergeTime == 0 then
-		return
-	end
-	
-	local startTime = Util.getDayStartTime(mergeTime)
-	
-	local now = os.time()
-	return math.ceil((now - startTime + 1) / 24 / 3600)
-end
-
-function setMergeTime(ts)
-    db.mergeServerTime = ts
-    updateValue("mergeServerTime", db.mergeServerTime)
-end
-
-function getYjTreasureEndTime()
-	return db.yjTreasureTime or 0
-end
-
-function setYjTreasureEndTime(time)
-	updateValue(KEY_YJ_TIME, time)
-end
-
-function getWeekCardBatch()
-	return db.weekLoopCardBatch or 0
-end
-
-function setWeekCardBatch(nValue)
-	updateValue(KEY_WEEKLOOP_CARD_BATCH, nValue)
+local DB = require("common.DB")
+local LuaMongo = _G.lua_mongo
+local Config = require("Config")
+local Util = require("common.Util")
+local ObjHuman = require("core.ObjHuman")
+local YunYingLogic = require("yunying.YunYingLogic")
+local OpenAct = require("present.OpenAct")
+
+local DBUpdate = {_id=nil}								-- 更新	
+local DBUpdateField = {}								-- 更新域
+
+KEY_SERVER_START_TIME = "serverStartTime"				-- 开服时间
+KEY_IDENTITY_MAX = "identityMax"						-- 自增的最大的数字 从1开始
+KEY_UNION_IDENTITY_MAX = "unionIdentityMax"				-- 自增的最大的数字 从1开始
+KEY_REWARD_INDEX = "rewardIndex"						-- 好友排行榜奖励索引rewardIndex
+KEY_BAN_IP = "banIp"									-- 被禁IP
+KEY_CHONGJI_ACT = "chongJiAct"							-- 全服冲级活动 领取情况
+KEY_ACT_MONTH = "actMonth"								-- 当前计算的真实月份
+KEY_UNION_WAR = "unionWar"								-- 公会战
+KEY_ACT_MONTH_LIST = "actMonthList"						-- 现实活动
+KEY_RESET_TIME = "resetTime"
+KEY_DRILL = "drill"										-- 过关斩将信息(本期开始时间等)
+KEY_SHARE_PLATFORM_BOARD = "sharePlatformBoard"			-- 分享排行
+KEY_BILLBOARD_AIM = "billboardAim"						-- 排行榜达标记录
+KEY_JJC_LADDER = "jjcLadder"							-- 天梯争霸信息
+KEY_VALLEY = "valley"									-- 荣耀峡谷信息
+KEY_LIANYU = "lianyu" 									-- 绝望深渊信息
+KEY_MIDDLE_INFO = "middleInfo"							-- 跨服链接信息
+KEY_CHAMPION_END_TIME = "championEndTime"				-- 冠军竞技场本赛季结束时间
+KEY_DRAGON_NEST_CITIAO = "dragonNestCiTiao"             -- 冰龙巢穴词条
+KEY_WORK_MAN = "workMan"                                -- 打工人活动
+KEY_OPEN_SERVER_TOPUP_TOP = "openServerTopupTop"		-- 开服充值排名活动
+KEY_CIYUAN_MOZHU = "ciyuanMoZhu"                        -- 次元魔蛛
+KEY_YJ_TIME = "yjTreasureTime"                          -- 遗迹探险时间
+KEY_CDK_BATCH = "cdkBatchIdx"                           -- CDK批次序号
+KEY_WEEKLOOP_CARD_BATCH = "weekLoopCardBatch"			-- 周活动-抽卡批次
+kEY_RECOMMENDLINEUP = "recommendlineup"					-- 推荐阵容
+
+db = db or {
+	serverStartTime = nil,								-- 开服时间
+	zhuanpanRecord = nil,								-- 转盘中奖记录
+	identityMax = nil,									-- 自增的最大的数字 从1开始
+    rewardIndex = nil,                                  -- 好友排行榜奖励索引rewardIndex
+    unionIdentityMax = nil,                             -- 自增的最大的数字 从1开始
+    mergeSvrIndex = nil,								-- 合服之后对应的服务器索引 比如如果10001,10003,100004合服了 这里的数据结构是{10001,10003,10004}
+    banIp = {},                                         -- 被禁IP
+	chongJiAct  = {},                                   -- 全服冲级活动 领取情况
+	actMonth = nil,                                     -- 当前计算的真实月份
+	unionWarState = nil,                                -- 当前工会战状态
+	actMonthList = nil,                                 -- 现实活动
+	resetTime = nil,                                    -- 确认是否重置数据
+	middleInfo = {},									-- 跨服链接信息
+	championEndTime = nil,							    -- 冠军竞技场本赛季结束时间
+	dragonNestCiTiao = {},                              -- 冰龙巢穴词条
+	workMan = {},                                       -- 打工人活动
+	ciyuanMoZhu = nil,                                  -- 次元魔蛛 
+    yjTreasureTime = nil,                               -- 遗迹探险时间
+	cdkBatchIdx = nil,									-- CDK批次序号
+	weekLoopCardBatch = nil,							-- 周活动-抽卡批次
+	recommendlineup = {},								-- 推荐阵容
+}
+
+function init()
+	LuaMongo.find(DB.db_common)
+	if not LuaMongo.next(db) then
+		LuaMongo.insert(DB.db_common, db)
+	end
+end
+
+-- 修改db单个字段
+function updateValue(key, value)
+	if not key then return end	
+	if not db then return end
+	if value then
+		DBUpdateField["$set"] = {[key]=value}
+		DBUpdateField["$unset"] = nil
+	else
+		DBUpdateField["$set"] = nil
+		DBUpdateField["$unset"] = {[key]=1}
+	end
+	DBUpdate._id = db._id
+	db[key] = value
+	LuaMongo.update(DB.db_common, DBUpdate, DBUpdateField)
+end
+
+function getCDKBatch()
+	if not db  then 
+		return
+	end
+	return db[KEY_CDK_BATCH] or 0
+end
+
+function setCDKBatch(idx)
+	idx = idx + 1
+	updateValue(KEY_CDK_BATCH,idx)
+end
+
+function getValueByKey(key)
+	if not db then return end
+	return db[key]
+end
+
+-- 同步db内容
+function reset()
+	LuaMongo.find(DB.db_common)
+	
+	if not LuaMongo.next(db) then
+		db = {banIp = {},}
+	end
+	print("db.serverStartTime:",db.serverStartTime)
+end
+
+-- 设置开服时间
+function setServerOpenTime(time)
+	db.serverStartTime = time
+	updateValue(KEY_SERVER_START_TIME, time)
+	
+    YunYingLogic.onServerOpenTime()
+	OpenAct.onServerOpenTime()
+end
+
+function getServerOpenTime()
+	if not db.serverStartTime then 
+		local t = Util.getDayStartTime()
+		setServerOpenTime(t)
+	end
+	return  db.serverStartTime
+end
+
+-- 获得当前是开服第几天(如果是开服第一天返回1)
+function getServerOpenDay()
+	local openTime = getServerOpenTime()
+	if openTime == 0 then
+		return
+	end
+	
+	local startTime = Util.getDayStartTime(openTime)
+	
+	local now = os.time()
+	return math.ceil((now - startTime + 1) / 24 / 3600)
+end
+
+function getIdentityMax()
+	if db.identityMax == nil then
+		db.identityMax = math.random(10001, 20000)	
+		setIdentityMax(db.identityMax)
+	elseif db.identityMax < 10001 then
+		db.identityMax = math.random(10001, 20000) -- 兼容老规则下数据
+		setIdentityMax(db.identityMax)
+	end
+	
+	return db.identityMax
+end
+
+-- 虚拟ID,假的
+function getFakeIdentityMax()
+	return math.random(1, 9999)
+end
+
+function setIdentityMax(idMax)
+	updateValue(KEY_IDENTITY_MAX, idMax)
+end
+
+function getUnionIdentityMax()
+	if db.unionIdentityMax == nil then
+		db.unionIdentityMax = math.random(10001, 20000)	
+		setUnionIdentityMax(db.unionIdentityMax)
+	elseif db.unionIdentityMax < 10001 then
+		db.unionIdentityMax = math.random(10001, 20000) -- 兼容老规则下数据
+		setUnionIdentityMax(db.unionIdentityMax)
+	end
+	
+	return db.unionIdentityMax
+end
+
+function setUnionIdentityMax(idMax)
+	updateValue(KEY_UNION_IDENTITY_MAX, idMax)
+end
+
+function getRewardIndex()
+	return db.rewardIndex or 0
+end
+
+function setRewardIndex(rewardIndex)
+	updateValue(KEY_REWARD_INDEX, rewardIndex)
+end
+
+function getMergeSvrIndex()
+	return db.mergeSvrIndex
+end
+
+cnt = 1
+function setBanIp(ip,time)
+    db.banIp[cnt] =db.banIp[cnt] or {}
+    db.banIp[cnt].ip = ip
+    db.banIp[cnt].time = time
+    cnt = cnt + 1
+	
+	updateValue(KEY_BAN_IP, db.banIp)
+end
+
+function getBanIp(ip)
+    for k,v in pairs(db.banIp) do
+        if v.ip == ip then
+            return v.ip,v.time
+        end
+    end
+    return 
+end
+
+function delBanIp(ip)
+    for k,v in pairs(db.banIp) do
+        if v.ip == ip then
+            db.banIp[k] = nil
+        end
+    end
+
+    updateValue(KEY_BAN_IP, db.banIp)
+end
+
+-- 全服创号 冲级活动
+function getSvrChongJiGet(id)
+	local num = 0 
+	if not db.chongJiAct then
+		return num
+	end
+
+	if db.chongJiAct[id] then
+		num = db.chongJiAct[id] or 0
+	end
+
+	return num
+end
+
+function addSvrChongJiGet(id)
+	db.chongJiAct = db.chongJiAct or {}
+    db.chongJiAct[id] = db.chongJiAct[id] or 0
+    db.chongJiAct[id] = db.chongJiAct[id] + 1
+
+	updateValue(KEY_CHONGJI_ACT, db.chongJiAct)	
+end
+
+function getActMonth()
+    return db.actMonth or 0
+end
+
+function setActMonth(month)
+	updateValue(KEY_ACT_MONTH, month)	
+end
+
+function getActMonthList(id)
+	local act = nil 
+	if not db.actMonthList then
+		return act
+	end
+
+	if db.actMonthList[id] then
+		act = db.actMonthList[id] or 0
+	end
+
+	return act
+end
+
+function setActMonthList(id, endTime, month)
+	db.actMonthList = db.actMonthList or {}
+    db.actMonthList[id] = db.actMonthList[id] or {}
+    db.actMonthList[id].endTime = endTime
+	db.actMonthList[id].month = month
+	updateValue(KEY_ACT_MONTH_LIST, db.actMonthList)
+end
+
+function getResetTime()
+	return db.resetTime or 0
+end
+
+function setResetTime(time)
+	updateValue(KEY_RESET_TIME, time)
+end
+
+function getMiddleInfo()
+	return db.middleInfo
+end
+
+function setMiddleInfo(ip, port, host)
+	db.middleInfo.ip = ip
+	db.middleInfo.port = port
+	db.middleInfo.host = host
+	updateValue(KEY_MIDDLE_INFO, db.middleInfo)
+end
+
+function getChampionEndTime()
+	return db.championEndTime or 0
+end
+
+function setChampionEndTime(time)
+	updateValue(KEY_CHAMPION_END_TIME, time)
+end
+
+function getDragonNestCitiao()
+	return db.dragonNestCiTiao
+end
+
+function setDragonNestCitiao(list, time)
+	db.dragonNestCiTiao.citiao = Util.copyTable(list)
+	db.dragonNestCiTiao.time = time
+	updateValue(KEY_DRAGON_NEST_CITIAO, db.dragonNestCiTiao)
+end
+
+function setWorkManState(state)
+    db.workMan.state = state
+    updateValue(KEY_WORK_MAN, db.workMan)
+end
+
+function setWorkManGroup(group)
+    db.workMan.group = group
+    updateValue(KEY_WORK_MAN, db.workMan)
+end
+
+function setWorkManTs(ts)
+    db.workMan.time = ts
+    updateValue(KEY_WORK_MAN, db.workMan)
+end
+
+function getWorkMan()
+	return db.workMan
+end
+
+-- 获取合服时间
+function getMergeServerTime()
+	return db.mergeServerTime or 0
+end
+
+
+-- 获得当前是合服第几天(如果是合服第一天返回1)
+function getServerMergeDay()
+	local mergeTime = getMergeServerTime()
+	if mergeTime == 0 then
+		return
+	end
+	
+	local startTime = Util.getDayStartTime(mergeTime)
+	
+	local now = os.time()
+	return math.ceil((now - startTime + 1) / 24 / 3600)
+end
+
+function setMergeTime(ts)
+    db.mergeServerTime = ts
+    updateValue("mergeServerTime", db.mergeServerTime)
+end
+
+function getYjTreasureEndTime()
+	return db.yjTreasureTime or 0
+end
+
+function setYjTreasureEndTime(time)
+	updateValue(KEY_YJ_TIME, time)
+end
+
+function getWeekCardBatch()
+	return db.weekLoopCardBatch or 0
+end
+
+function setWeekCardBatch(nValue)
+	updateValue(KEY_WEEKLOOP_CARD_BATCH, nValue)
+end
+
+-- 获取阵容数据
+function getRecommendLineUp()
+	return db.recommendlineup
+end
+
+-- 修改阵容数据
+function SetRecommendLineUp(tData)
+	db.recommendlineup = tData
+
+	updateValue(kEY_RECOMMENDLINEUP, db.recommendlineup)
 end

+ 6 - 1
script/common/ProtoID.lua

@@ -1286,6 +1286,9 @@ _ENV[1285]="GC_WEEKLOOP_ACT_CARDQUERY"
 _ENV[1286]="CG_WEEKLOOP_ACT_CARDGETPRIZE"
 _ENV[1287]="CG_WEEKLOOP_ACT_RANK_QUERY"
 _ENV[1288]="GC_WEEKLOOP_ACT_RANK_QUERY"
+_ENV[1294]="CG_PRESEN_OPEN_ADDUP_CHARGE_QUERY"
+_ENV[1295]="GC_PRESEN_OPEN_ADDUP_CHARGE_QUERY"
+_ENV[1296]="CG_PRESENT_OPEN_ADDUP_CHARGE_GETPRIZE"
 _ENV[1301]="CG_XIANZHI_SHOP_QUERY"
 _ENV[1302]="GC_XIANZHI_SHOP_QUERY"
 _ENV[1303]="CG_XIANZHI_SHOP_BUY"
@@ -1316,4 +1319,6 @@ _ENV[1349]="GC_DBQB_RESET"
 _ENV[1350]="CG_DBQB_START_GAME"
 _ENV[1351]="GC_DBQB_START_GAME"
 _ENV[1352]="CG_DBQB_TIPS"
-_ENV[1353]="GC_DBQB_TIPS"
+_ENV[1353]="GC_DBQB_TIPS"
+_ENV[1354]="CG_DRAWCARD_GET_RECOMMEND_LINEUP"
+_ENV[1355]="GC_DRAWCARD_GET_RECOMMEND_LINEUP"

+ 226 - 226
script/core/Msg.lua

@@ -1,226 +1,226 @@
---[[
-协议模板规则如下
-	1.在module文件夹下面建立的所有文件夹都是一个一个的模块,里面至少要有一个proto.lua和handler.lua文件
-	2.handler.lua里面填写该模块的cg_xxx函数
-	3.proto.lua里面填写该模块的cg和gc协议
-	4.对于proto.lua里面的不是以cg和gc开头的table,是作为子结构,其中,如果没有local开头的,那么子结构的名字将作为客户端对应的类的名字,如果有local开头或者是直接在table里面展开的子结构,客户端对应的类的名字将根据一层一层的字段自动生成
-	5.协议的每个字段{名字,容量,类型}
-		名字:只能用string,不能用number,并且不能以下划线开头(避免生成的跟客户端的私有变量冲突)
-		容量:为预分配的最大空间,当容量大于1的时候,该字段就必需包含长度,例如字段名为aa,aa就是一个table,那么长度就是aa[0],aa[0]必需小于等于容量
-		类型:
-			{"aa", 1, "int"}	--32位整型
-			{"aa", 1, "double"}	--64位浮点数
-			{"aa", 1, "string", 128} --一个字符串,里面最多有128个字节,字符串长度上限不填的话,默认是64
-			{"aa", 1, sub}		--aa是一个table,里面的字段由子结构的模板sub决定
-
-			{"aa", 2, "int"}	--数组,里面最多有2个整型
-			{"aa", 2, "double"}	--数组,里面最多有2个64位浮点数
-			{"aa", 2, "string", 128}	--字符串数组,每个字符串里面最多有128个字节,字符串长度上限不填的话,默认是64
-			{"aa", 2, sub}		--aa是一个table,aa[1]也是一个table,aa[1]里面的字段由子结构的模板sub决定
---]]
-
-local msg_ex = _G.msg_ex
-
-cg = cg or {}
-gc = gc or {}
-proto_handler = proto_handler or {}
-proto_id = proto_id or {}
-proto_name = proto_name or {}
-proto_template = proto_template or {}
-list = list or {} -- 消息发送对象列表 第0为长度 后面1-x为obj
-
-local Config = require("Config")
-
-local mt = {
-	__index =
-	function(t, k)
-		local id = t[1] or ""
-		assert(nil, id .. " " .. k .. " not exist")
-	end
-}
-
-local function proto_container_metatable(msg)
-	if not Config.IS_WINDOWS then
-		return
-	end
-	setmetatable(msg, mt)
-	for _, v in pairs(msg) do
-		if type(v) == "table" then
-			proto_container_metatable(v)
-		end
-	end
-end
-
-local function proto_container_resize(msg, template)
-	for _, v in ipairs(template) do
-		if v[2] < 2 then
-			if type(v[3]) == "table" then
-				cnt = cnt + 1
-				msg[v[1]] = {}
-				proto_container_resize(msg[v[1]], v[3])
-			end
-		else
-			if type(v[3]) == "table" then
-				local v2 = v[2]
-				if v2 == 2 and (v[1] == "items" or v[1] == "equips" or v[1] == "gems") then
-					v2 = 1
-				end
-				cnt = cnt + 1
-				msg[v[1]] = {}
-				for i = 1, v2 do
-					msg[v[1]][i] = {}
-					proto_container_resize(msg[v[1]][i], v[3])
-				end
-			else
-				cnt = cnt + 1
-				msg[v[1]] = {}
-			end
-		end
-	end
-end
-
-function register(name, id, template, handler) 
-	if not proto_name[id] then
-		msg_ex.register_template(id, template)
-		if string.sub(name, 1, 2) == "CG" then
-			cg[id] = {[1] = id}
-			proto_container_resize(cg[id], template)
-			proto_container_metatable(cg[id])
-		elseif string.sub(name, 1, 2) == "GC" then
-			gc[name] = {[1] = id}
-			cnt = 0
-			proto_container_resize(gc[name], template)
-			if 8000 < cnt then
-			end
-		end
-	end
-	proto_handler[id] = handler
-	proto_name[id] = name
-	proto_template[id] = template
-end
-
-if msg_ex then
-
-send = msg_ex.unicast 
-
-sendMulti = msg_ex.multicast
-
-sendWorld = msg_ex.broadcast
-
-end
-
-local out = {}
-local out_len = 0
-local function add_space(step)
-	for i = 1, step do
-		out_len = out_len + 1
-		out[out_len] = "	"
-	end
-end
-
-local set = {}
-function trace(m, template, step, print_on_err)
-	if not step then
-		template = proto_template[m[1]]
-		step = 0
-		out_len = 0 
-	end
-	for k in pairs(set) do
-		set[k] = nil
-	end
-	for _, v in ipairs(template) do
-		set[v[1]] = true
-	end
-	for k in pairs(m) do
-		if k ~= 1 and not set[k] then
-			print(table.concat(out, nil, 1, out_len))
-			assert(nil, k .. " not need")
-		end
-	end
-	for _, v in ipairs(template) do
-		add_space(step)
-		out_len = out_len + 1
-		out[out_len] = v[1]
-		out_len = out_len + 1
-		out[out_len] = "="
-		if v[2] < 2 then
-			if type(v[3]) == "table" then
-				if type(m[v[1]]) ~= "table" then
-					print(table.concat(out, nil, 1, out_len))
-					assert(nil, v[1] .. " is not table")
-				end
-				out_len = out_len + 1
-				out[out_len] = "\n"
-				trace(m[v[1]], v[3], step + 1, print_on_err)
-			else
-				if (v[3] == "byte" or v[3] == "short" or v[3] == "int" or v[3] == "double" or v[3] == "uint") and type(m[v[1]]) ~= "number" then
-					print(table.concat(out, nil, 1, out_len))
-					assert(nil, v[1] .. " is not number")
-				end
-				if v[3] == "string" and type(m[v[1]]) ~= "string" then
-					print(table.concat(out, nil, 1, out_len))
-					assert(nil, v[1] .. " is not string")
-				end
-				out_len = out_len + 1
-				out[out_len] = m[v[1]]
-				out_len = out_len + 1
-				out[out_len] = "\n"
-			end
-		else
-			if type(m[v[1]]) ~= "table" then
-				print(table.concat(out, nil, 1, out_len))
-				assert(nil, v[1] .. " is not table")
-			end
-			out_len = out_len + 1
-			out[out_len] = "\n"
-			if type(m[v[1]][0]) ~= "number" then
-				print(table.concat(out, nil, 1, out_len))
-				assert(nil, v[1] .. " len is not number")
-			end
-			add_space(step + 1)
-			out_len = out_len + 1
-			out[out_len] = "0="
-			out_len = out_len + 1
-			out[out_len] = m[v[1]][0]
-			out_len = out_len + 1
-			out[out_len] = "\n"
-			for i = 1, m[v[1]][0] do
-				if type(v[3]) == "table" then
-					if type(m[v[1]][i]) ~= "table" then
-						print(table.concat(out, nil, 1, out_len))
-						assert(nil, v[1] .. " " .. i .. " is not table")
-					end
-					add_space(step + 1)
-					out_len = out_len + 1
-					out[out_len] = i
-					out_len = out_len + 1
-					out[out_len] = "="
-					out_len = out_len + 1
-					out[out_len] = "\n"
-					trace(m[v[1]][i], v[3], step + 2, print_on_err)
-				else
-					if (v[3] == "byte" or v[3] == "short" or v[3] == "int" or v[3] == "double" or v[3] == "uint") and type(m[v[1]][i]) ~= "number" then
-						print(table.concat(out, nil, 1, out_len))
-						assert(nil, v[1] .. " " .. i .. " is not number")
-					end
-					if v[3] == "string" and type(m[v[1]][i]) ~= "string" then
-						print(table.concat(out, nil, 1, out_len))
-						assert(nil, v[1] .. " " .. i .. " is not string")
-					end
-					add_space(step + 1)
-					out_len = out_len + 1
-					out[out_len] = i
-					out_len = out_len + 1
-					out[out_len] = "="
-					out_len = out_len + 1
-					out[out_len] = m[v[1]][i]
-					out_len = out_len + 1
-					out[out_len] = "\n"
-				end
-			end
-		end
-	end
-	if step == 0 and not print_on_err then
-		print(table.concat(out, nil, 1, out_len))
-	end
-end
+--[[
+协议模板规则如下
+	1.在module文件夹下面建立的所有文件夹都是一个一个的模块,里面至少要有一个proto.lua和handler.lua文件
+	2.handler.lua里面填写该模块的cg_xxx函数
+	3.proto.lua里面填写该模块的cg和gc协议
+	4.对于proto.lua里面的不是以cg和gc开头的table,是作为子结构,其中,如果没有local开头的,那么子结构的名字将作为客户端对应的类的名字,如果有local开头或者是直接在table里面展开的子结构,客户端对应的类的名字将根据一层一层的字段自动生成
+	5.协议的每个字段{名字,容量,类型}
+		名字:只能用string,不能用number,并且不能以下划线开头(避免生成的跟客户端的私有变量冲突)
+		容量:为预分配的最大空间,当容量大于1的时候,该字段就必需包含长度,例如字段名为aa,aa就是一个table,那么长度就是aa[0],aa[0]必需小于等于容量
+		类型:
+			{"aa", 1, "int"}	--32位整型
+			{"aa", 1, "double"}	--64位浮点数
+			{"aa", 1, "string", 128} --一个字符串,里面最多有128个字节,字符串长度上限不填的话,默认是64
+			{"aa", 1, sub}		--aa是一个table,里面的字段由子结构的模板sub决定
+
+			{"aa", 2, "int"}	--数组,里面最多有2个整型
+			{"aa", 2, "double"}	--数组,里面最多有2个64位浮点数
+			{"aa", 2, "string", 128}	--字符串数组,每个字符串里面最多有128个字节,字符串长度上限不填的话,默认是64
+			{"aa", 2, sub}		--aa是一个table,aa[1]也是一个table,aa[1]里面的字段由子结构的模板sub决定
+--]]
+
+local msg_ex = _G.msg_ex
+
+cg = cg or {}
+gc = gc or {}
+proto_handler = proto_handler or {}
+proto_id = proto_id or {}
+proto_name = proto_name or {}
+proto_template = proto_template or {}
+list = list or {} -- 消息发送对象列表 第0为长度 后面1-x为obj
+
+local Config = require("Config")
+
+local mt = {
+	__index =
+	function(t, k)
+		local id = t[1] or ""
+		assert(nil, id .. " " .. k .. " not exist")
+	end
+}
+
+local function proto_container_metatable(msg)
+	if not Config.IS_WINDOWS then
+		return
+	end
+	setmetatable(msg, mt)
+	for _, v in pairs(msg) do
+		if type(v) == "table" then
+			proto_container_metatable(v)
+		end
+	end
+end
+
+local function proto_container_resize(msg, template)
+	for _, v in ipairs(template) do
+		if v[2] < 2 then
+			if type(v[3]) == "table" then
+				cnt = cnt + 1
+				msg[v[1]] = {}
+				proto_container_resize(msg[v[1]], v[3])
+			end
+		else
+			if type(v[3]) == "table" then
+				local v2 = v[2]
+				if v2 == 2 and (v[1] == "items" or v[1] == "equips" or v[1] == "gems") then
+					v2 = 1
+				end
+				cnt = cnt + 1
+				msg[v[1]] = {}
+				for i = 1, v2 do
+					msg[v[1]][i] = {}
+					proto_container_resize(msg[v[1]][i], v[3])
+				end
+			else
+				cnt = cnt + 1
+				msg[v[1]] = {}
+			end
+		end
+	end
+end
+
+function register(name, id, template, handler) 
+	if not proto_name[id] then
+		msg_ex.register_template(id, template)
+		if string.sub(name, 1, 2) == "CG" then
+			cg[id] = {[1] = id}
+			proto_container_resize(cg[id], template)
+			proto_container_metatable(cg[id])
+		elseif string.sub(name, 1, 2) == "GC" then
+			gc[name] = {[1] = id}
+			cnt = 0
+			proto_container_resize(gc[name], template)
+			if 8000 < cnt then
+			end
+		end
+	end
+	proto_handler[id] = handler
+	proto_name[id] = name
+	proto_template[id] = template
+end
+
+if msg_ex then
+
+send = msg_ex.unicast 
+
+sendMulti = msg_ex.multicast
+
+sendWorld = msg_ex.broadcast
+
+end
+
+local out = {}
+local out_len = 0
+local function add_space(step)
+	for i = 1, step do
+		out_len = out_len + 1
+		out[out_len] = "	"
+	end
+end
+
+local set = {}
+function trace(m, template, step, print_on_err)
+	if not step then
+		template = proto_template[m[1]]
+		step = 0
+		out_len = 0 
+	end
+	for k in pairs(set) do
+		set[k] = nil
+	end
+	for _, v in ipairs(template) do
+		set[v[1]] = true
+	end
+	for k in pairs(m) do
+		if k ~= 1 and not set[k] then
+			print(table.concat(out, nil, 1, out_len))
+			assert(nil, k .. " not need")
+		end
+	end
+	for _, v in ipairs(template) do
+		add_space(step)
+		out_len = out_len + 1
+		out[out_len] = v[1]
+		out_len = out_len + 1
+		out[out_len] = "="
+		if v[2] < 2 then
+			if type(v[3]) == "table" then
+				if type(m[v[1]]) ~= "table" then
+					print(table.concat(out, nil, 1, out_len))
+					assert(nil, v[1] .. " is not table")
+				end
+				out_len = out_len + 1
+				out[out_len] = "\n"
+				trace(m[v[1]], v[3], step + 1, print_on_err)
+			else
+				if (v[3] == "byte" or v[3] == "short" or v[3] == "int" or v[3] == "double" or v[3] == "uint") and type(m[v[1]]) ~= "number" then
+					print(table.concat(out, nil, 1, out_len))
+					assert(nil, v[1] .. " is not number")
+				end
+				if v[3] == "string" and type(m[v[1]]) ~= "string" then
+					print(table.concat(out, nil, 1, out_len))
+					assert(nil, v[1] .. " is not string")
+				end
+				out_len = out_len + 1
+				out[out_len] = m[v[1]]
+				out_len = out_len + 1
+				out[out_len] = "\n"
+			end
+		else
+			if type(m[v[1]]) ~= "table" then
+				print(table.concat(out, nil, 1, out_len))
+				assert(nil, v[1] .. " is not table")
+			end
+			out_len = out_len + 1
+			out[out_len] = "\n"
+			if type(m[v[1]][0]) ~= "number" then
+				print(table.concat(out, nil, 1, out_len))
+				assert(nil, v[1] .. " len is not number")
+			end
+			add_space(step + 1)
+			out_len = out_len + 1
+			out[out_len] = "0="
+			out_len = out_len + 1
+			out[out_len] = m[v[1]][0]
+			out_len = out_len + 1
+			out[out_len] = "\n"
+			for i = 1, m[v[1]][0] do
+				if type(v[3]) == "table" then
+					if type(m[v[1]][i]) ~= "table" then
+						print(table.concat(out, nil, 1, out_len))
+						assert(nil, v[1] .. " " .. i .. " is not table")
+					end
+					add_space(step + 1)
+					out_len = out_len + 1
+					out[out_len] = i
+					out_len = out_len + 1
+					out[out_len] = "="
+					out_len = out_len + 1
+					out[out_len] = "\n"
+					trace(m[v[1]][i], v[3], step + 2, print_on_err)
+				else
+					if (v[3] == "byte" or v[3] == "short" or v[3] == "int" or v[3] == "double" or v[3] == "uint") and type(m[v[1]][i]) ~= "number" then
+						print(table.concat(out, nil, 1, out_len))
+						assert(nil, v[1] .. " " .. i .. " is not number")
+					end
+					if v[3] == "string" and type(m[v[1]][i]) ~= "string" then
+						print(table.concat(out, nil, 1, out_len))
+						assert(nil, v[1] .. " " .. i .. " is not string")
+					end
+					add_space(step + 1)
+					out_len = out_len + 1
+					out[out_len] = i
+					out_len = out_len + 1
+					out[out_len] = "="
+					out_len = out_len + 1
+					out[out_len] = m[v[1]][i]
+					out_len = out_len + 1
+					out[out_len] = "\n"
+				end
+			end
+		end
+	end
+	if step == 0 and not print_on_err then
+		print(table.concat(out, nil, 1, out_len))
+	end
+end

+ 3 - 0
script/module/chengjiu/ChengjiuLogic.lua

@@ -17,6 +17,7 @@ local GuideLogic = require("guide.GuideLogic")
 local DB = require("common.DB")
 local Util = require("common.Util")
 local LuaMongo = _G.lua_mongo
+local RoleDefine = require("role.RoleDefine")
 
 --[[
 human.db.chengjiu = {}
@@ -289,6 +290,8 @@ function getReward(human,taskID)
     Msg.send(msgRet,human.fd)
     --query(human,config.group)
     
+    RoleAttr.doCalc(human)
+    ObjHuman.sendAttr(human, RoleDefine.ZHANDOULI)
     GuideLogic.setDoSpecialGuide(human, GuideLogic.SKIPTYPE_JUMP_JIEFENG_BAOJU)
     RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2001)
 end

+ 10 - 1
script/module/combat/CombatLogic.lua

@@ -558,6 +558,15 @@ local function fontCombatHeroNet(net, obj)
 	net.star = obj.star
 	net.lv = obj.lv or 0
 	net.body = obj.body or config.body
+	if obj.body and config.body then
+		if obj.body ~= config.body then
+			local tSkinCof = SkinExcel.skin[obj.body]
+			if tSkinCof and tSkinCof.heroId ~= net.heroID then
+				net.body = config.body
+				print("[fontCombatHeroNet] 下发时修改英雄的身体数据 heroID = "..net.heroID .." body1 = "..obj.body.." conBody = "..config.body)
+			end
+		end
+	end
 	net.hpMax = CombatObj.getHpMax(obj)
 	net.hpNow = obj.initHp
 	net.icon = config.head
@@ -568,7 +577,7 @@ local function fontCombatHeroNet(net, obj)
 	net.posX = CombatDefine.DEFAULT_POS_SIZE[obj.pos][1]
 	net.posY = CombatDefine.DEFAULT_POS_SIZE[obj.pos][2]
 	net.size = CombatDefine.DEFAULT_POS_SIZE[obj.pos][3]
-	net.isBoss = 0
+	net.isBoss = config.isboss or 0 
     net.isGongMing = obj.isGongMing or 0
     net.grade = config.grade or 0	
 	local len = 0

+ 6 - 1
script/module/combat/CombatPosLogic.lua

@@ -45,10 +45,14 @@ local ChengjiuDefine = require("chengjiu.ChengjiuDefine")
 local SkillExcel = require("excel.skill")
 local RoleAttr = require("role.RoleAttr")
 local LostTempleCombatLogic = require("lostTemple.lostTempleCombatLogic")
+local RecommendLineup = require("drawCard.RecommendLineup")
 
 -- 根据战斗类型获取出战队伍类型
 function getTeamType(combatType)
-    if not CombatExcel.combat[combatType] then return end
+    if not CombatExcel.combat[combatType] then 
+		print("[getTeamType] 不存在对应的 combatType = "..combatType)
+		return 
+	end
 
 	return CombatExcel.combat[combatType].teamType
 end
@@ -176,6 +180,7 @@ function onUpdatePos(human, teamType)
     			ObjHuman.doCalc(human)
 	            local heroListZDL = getCombatHeroZDL(human, CombatDefine.COMBAT_TYPE1)
                 ChengjiuLogic.onCallback(human,ChengjiuDefine.CJ_TASK_TYPE_8,heroListZDL)
+				RecommendLineup.RecommendLineup_UpDate(human)
     		end
     	end
     end

+ 2 - 1
script/module/combat/Proto.lua

@@ -215,7 +215,8 @@ GC_COMBAT_BEGIN = {
     {"atkFormation",	1,		"short"},
     {"defFormation",	1,		"short"},
     {"isQuick",	        1,		"byte"},
-	{"backup",		2,		"byte"},	--第一个是攻方援军的站位,第二个是守方援军的站位。0值表示援军还没上
+	{"backup",			2,		"byte"},	--第一个是攻方援军的站位,第二个是守方援军的站位。0值表示援军还没上
+	--{"isBoss",			1,		"byte"},		-- 敌方是否是boss
 }
 
 CombatHitNet = {

+ 6 - 0
script/module/drawCard/Handler.lua

@@ -1,4 +1,6 @@
 local DrawCardLogic = require("drawCard.DrawCardLogic")
+local RecommendLineup = require("drawCard.RecommendLineup")
+
 function CG_DRAWCARD_QUERY(human,msg)
 	DrawCardLogic.query(human)
 end
@@ -9,4 +11,8 @@ end
 
 function CG_DRAWCARD_SKIP_SET(human, msg)
 	DrawCardLogic.setSkip(human, nil, msg.skip)
+end
+
+function CG_DRAWCARD_GET_RECOMMEND_LINEUP(human, msg)
+	RecommendLineup.GetRecommendLineUp(human)
 end

+ 15 - 0
script/module/drawCard/Proto.lua

@@ -1,5 +1,6 @@
 local ItemData = require("bag.Proto").ItemData
 local HeroNiceNet = require("hero.Proto").HeroNiceNet
+local HeroSimple = require("hero.Proto").HeroSimple
 
 CG_DRAWCARD_QUERY = {}
 DrawCardNet = {
@@ -49,4 +50,18 @@ GC_DRAWCARD_OP = {
 
 CG_DRAWCARD_SKIP_SET = {
 	{"skip",		    1,		"byte"},   -- 是否跳过
+}
+
+RecommendLineup = 
+{
+	{"data", 	7, 	HeroSimple},
+	{"nPower", 	1, 	"int"},
+}
+
+-- 请求推荐阵容
+CG_DRAWCARD_GET_RECOMMEND_LINEUP = {}
+
+-- 请求推荐阵容回报
+GC_DRAWCARD_GET_RECOMMEND_LINEUP = {
+	{"list",  35, RecommendLineup}
 }

+ 171 - 0
script/module/drawCard/RecommendLineup.lua

@@ -0,0 +1,171 @@
+--------------------------------
+-- 文件名       :  RecommendLineup.lua
+-- 文件说明     :  推荐阵容
+-- 创建时间     :   2025/1/15
+-- 创建人       :   FC
+--------------------------------
+
+local HeroLogic = require("hero.HeroLogic")
+local BagLogic = require("bag.BagLogic")
+local HeroGrid = require("hero.HeroGrid")
+local CommonDB = require("common.CommonDB")
+local Msg = require("core.Msg")
+local CombatPosLogic = require("combat.CombatPosLogic")
+local CombatDefine = require("combat.CombatDefine")
+
+
+local nRecommendLineupLen = 30		 -- 阵容记录推荐数量
+local tRecommendLineupData = nil
+
+---------------------------------------- 内部函数 ------------------------------------
+local function RecommendLineup_GetData()
+    if not tRecommendLineupData then
+        tRecommendLineupData = CommonDB.getRecommendLineUp()
+    end
+
+    return tRecommendLineupData
+end
+
+local function RecommendLineup_SetData(tData)
+    tRecommendLineupData = tData
+    CommonDB.SetRecommendLineUp(tRecommendLineupData)
+end
+
+-- 获取小于该战力的下表
+local function RecommendLineup_GetIndex(nNewPower)
+    local nIndex = -1
+    local tDBData = RecommendLineup_GetData()
+
+    if nil == _G.next(tDBData) then
+        nIndex = 1
+        return nIndex
+    end
+
+    local nNowLen = #tDBData
+    if nNowLen < nRecommendLineupLen then
+        nIndex = nNowLen + 1
+        return nIndex
+    end
+
+    for i, value in ipairs(tDBData) do
+        local nPower = value.nPower
+        if nNewPower > nPower then
+            nIndex = i
+            break
+        end
+    end
+
+    return nIndex
+end
+
+-- 插入最新的表
+local function RecommendLineup_UpDateData(human, nIndex, tHeroData)
+    local tOldData = RecommendLineup_GetData()
+    local nOldLen = #tOldData
+    local tNewData = {}
+
+    if nil == _G.next(tOldData) then
+        table.insert(tNewData, tHeroData)
+        RecommendLineup_SetData(tNewData)
+        return
+    end
+
+    if nOldLen < nRecommendLineupLen then
+        tNewData = tOldData
+        table.insert(tNewData, tHeroData)
+        RecommendLineup_SetData(tNewData)
+        return
+    end
+    
+    -- 只有30个直接遍历
+    local nLen = 0
+    local tLastData = nil
+    for i, value in ipairs(tOldData) do
+        if nLen >= nRecommendLineupLen then
+            break
+        end
+
+        if i == nIndex then
+            table.insert(tNewData, tHeroData)
+            tLastData = value
+        elseif i < nIndex then
+            table.insert(tNewData, value)
+        elseif i > nIndex then
+            table.insert(tNewData, tLastData)
+            tLastData = value
+        end
+        
+        nLen = nLen + 1
+    end
+
+    RecommendLineup_SetData(tNewData)
+end
+
+
+---------------------------------------- 客户端请求 ------------------------------------
+function GetRecommendLineUp(human)
+    local tData = RecommendLineup_GetData()
+
+    local tMsgData = Msg.gc.GC_DRAWCARD_GET_RECOMMEND_LINEUP
+    tMsgData.list[0] = 0 
+
+    for i, value in ipairs(tData) do
+        tMsgData.list[0] = tMsgData.list[0] + 1
+        local tHeroData = tMsgData.list[tMsgData.list[0]]
+        tHeroData.data[0] = 0
+        tHeroData.nPower = value.nPower
+        for _, v in pairs(value.data) do
+            tHeroData.data[0] = tHeroData.data[0] + 1
+            tHeroData[tHeroData.data[0]] = v
+        end
+    end
+
+    Msg.send(tMsgData, human.fd)
+end
+
+
+function RecommendLineup_UpDate(human)
+    local combatHero,helpList = CombatPosLogic.getCombatHeros(human, CombatDefine.COMBAT_TYPE1)
+    if not combatHero then
+        return
+    end
+
+    local nNewPower = CombatPosLogic.getCombatHeroZDL(human, CombatDefine.COMBAT_TYPE1, true)
+
+    local nIndex = RecommendLineup_GetIndex(nNewPower)
+    if -1 >= nIndex then
+        return
+    end
+
+    local tHeroData = {
+        nPower = nNewPower,
+        data = {},
+    }
+
+    local nLen = 1
+    for _, v in pairs(combatHero) do
+        local heroGrid = HeroLogic.getHeroGridByUuid(human, v)
+        if heroGrid then
+              tHeroData.data[nLen] = {
+                general = {},
+                gemData = {},
+            }
+            HeroGrid.makeHeroSimple(tHeroData.data[nLen], heroGrid, heroGrid.bagIndex, human)
+            nLen = nLen + 1
+        end
+    end
+    
+    for _,v in pairs(helpList) do
+        local heroGrid = HeroLogic.getHeroGridByUuid(human, v)
+        if heroGrid then
+            tHeroData.data[nLen] = {
+                general = {},
+                gemData = {},
+            }
+            HeroGrid.makeHeroSimple(tHeroData.data[nLen], heroGrid, heroGrid.bagIndex, human)
+            nLen = nLen + 1
+        end
+    end
+
+    -- RecommendLineup_UpDateData(human, nIndex, tHeroData)
+end

+ 16 - 0
script/module/hero/HeroLogic.lua

@@ -217,6 +217,22 @@ function sendHeroBagList(human)
 	for index = 1, human.db.heroBag[0] do
         local heroGrid = human.db.heroBag[index]
         if heroGrid then
+			-- 对皮肤进行一下检测
+			if heroGrid.body then
+				local nHeroID = heroGrid.id or heroGrid.heroID
+				local tHeroCof = HeroExcel.hero[heroGrid.heroID]
+				if tHeroCof and heroGrid.body ~= tHeroCof.body then
+					local tSkinCof = SkillExcel.skin[heroGrid.body]
+					if tSkinCof then
+						if tSkinCof.heroId ~= heroGrid.heroID then
+							print("[sendHeroBagList] 玩家当前英雄身体数据不正确 heroID = "..heroGrid.heroID.." OldBodyID = "..heroGrid.body.." NewBodyID = "..tHeroCof.body)
+							heroGrid.body = tHeroCof.body
+						end
+					end
+				else 
+					print("[sendHeroBagList] 不存在对应的配置 nHeroID = "..nHeroID)
+				end
+			end
 		    cnt = cnt + 1
 		    HeroGrid.makeHeroSimple(msgRet.list[cnt], heroGrid, index, human)
 		    if cnt >= HeroDefine.PAGE_HERO_COUNT then

+ 6 - 0
script/module/hero/HeroTenZhiHuan.lua

@@ -174,6 +174,12 @@ function zhihuan(human, material2ID, heroIndexList)
     BagLogic.sendItemGetList3(human, outItems, "tenStar_displace")
 
     newHeroGrid.id = attrConfig.heroID
+    local tHeroCof = HeroExcel.hero[attrConfig.heroID]
+    if tHeroCof then
+        newHeroGrid.head = tHeroCof.head
+        newHeroGrid.body = tHeroCof.body
+        print("[zhihuan] 置换新英雄先更换为原先的皮肤 heroID = "..attrConfig.heroID.." head = ".. tHeroCof.head.." body = "..tHeroCof.body)
+    end
     local newIndex = HeroLogic.addHeroByGrid(human, newHeroGrid, "tenStar_displace")
 
     if equipTb ~= nil then

+ 9 - 0
script/module/present/Handler.lua

@@ -33,6 +33,7 @@ local OpenServerRank = require("present.OpenServerRank")
 local DailyLibaoLogic = require("present.DailyLibaoLogic")
 local RichangLibaoLogic = require("present.RichangLibaoLogic")
 local OpenServerActPowerUp = require("present.OpenServerActPowerUp")
+local OpenServerActAddUpCharge = require("present.OpenServerActAddUpCharge")
 
 -- 充值-特权商店
 function CG_TEQUANSHOP_QUERY(human)
@@ -348,3 +349,11 @@ end
 function CG_PRESENT_OPEN_POWERUP_GETPRIZE(human, msg)
     OpenServerActPowerUp.ActPowerUp_GetPrize(human, msg.nID)
 end
+
+function CG_PRESEN_OPEN_ADDUP_CHARGE_QUERY(human, msg)
+    OpenServerActAddUpCharge.ActAddUpCharge_Query(human)
+end
+
+function CG_PRESENT_OPEN_ADDUP_CHARGE_GETPRIZE(human, msg)
+    OpenServerActAddUpCharge.ActAddUpCharge_GetPrize(human, msg.nID)
+end

+ 481 - 0
script/module/present/OpenServerActAddUpCharge.lua

@@ -0,0 +1,481 @@
+--------------------------------
+-- 文件名       :  OpenServerActAddUpCharge.lua
+-- 文件说明     :  开服7天活动 - 累积充值
+-- 创建时间     :   2025/1/14
+-- 创建人       :   FC
+--------------------------------
+
+local Util = require("common.Util")
+local Lang = require("common.Lang")
+local Broadcast = require("broadcast.Broadcast")
+local OpenAct = require("present.OpenAct")
+local PresentExcel = require("excel.present")
+local OpenActExcel = require("excel.openAct")
+local MailExcel = require("excel.mail")
+local Msg = require("core.Msg")
+local ObjHuman = require("core.ObjHuman")
+local MailManager = require("mail.MailManager")
+local BagLogic = require("bag.BagLogic")
+local Grid = require("bag.Grid")
+local KingWorldLogic = require("present.KingWorldLogic")
+local YunYingLogic = require("yunying.YunYingLogic")
+local PanelDefine = require("broadcast.PanelDefine")
+local SevenDayGiftLogic = require("present.SevenDayGiftLogic")
+local CommonDB = require("common.CommonDB")
+local BuyLogic = require("topup.BuyLogic")
+local GuideLogic = require("guide.GuideLogic")
+local Log = require("common.Log")
+
+local tPrizeByID = nil
+local nShowAllMoney = nil             -- 展示所有的奖励的充值数
+local nMailID = 7011                    -- 邮件ID
+
+ADDUPCHARGEGIFT_STATE_NONE    =   0       -- 不可领取
+ADDUPCHARG_STATE_CANGET  =   1       -- 可领取
+ADDUPCHARG_STATE_FINISH  =   2       -- 已领取
+
+----------------------------------------- DB数据操作 -------------------------------------
+
+-- 初始化DB数据
+local function ActAddUpCharge_InitDB(human)
+    if not human then
+        return false
+    end
+
+    human.db.AddUpChargeGift = {}
+    return true
+end
+
+-- 获取DB数据
+local function ActAddUpCharge_GetDB(human)
+    if not human or not human.db.AddUpChargeGift then
+        return nil
+    end
+    
+    return human.db.AddUpChargeGift
+end
+
+-- 获取累充金额
+local function ActAddUpCharge_GetDBCharge(human)
+    if not human.db.AddUpCharge then
+        human.db.AddUpCharge = 0
+    end
+
+    return  human.db.AddUpCharge
+end
+
+-- 设置累充金额
+local function ActAddUpCharge_SetDBCharge(human, nValue)
+    if not human.db.AddUpCharge then
+        human.db.AddUpCharge = 0
+    end
+
+    human.db.AddUpCharge = nValue
+end
+
+-- 创建DB数据
+local function ActAddUpCharge_CreateDB(human)
+    if not human then
+        return false
+    end
+
+    if not human.db.AddUpChargeGift then
+        local bRet = ActAddUpCharge_InitDB(human)
+        if false == bRet then
+            print("[ActAddUpCharge_CreateDB] 初始化BD数据失败")
+            return false
+        end
+
+        if tPrizeByID then
+            for nID, value in pairs(tPrizeByID) do
+                human.db.AddUpChargeGift[nID] = ADDUPCHARGEGIFT_STATE_NONE
+            end
+        else
+            print("[ActAddUpCharge_CreateDB] 不存在对应的ID对应配置")
+            return false
+        end
+    end
+
+    if not human.db.AddUpCharge then
+        human.db.AddUpCharge = 0
+    end
+
+    if human.db.topupAcount and human.db.topupAcount > 0 then
+        if not human.db.AddUpChargeFlag then
+            human.db.AddUpChargeFlag = 1
+            onCharge(human, human.db.topupAcount)
+        end
+    end
+
+    human.db.AddUpChargeSendMail = 0
+
+    return true
+end
+
+-- 获取某个数据状态
+local function ActAddUpCharge_GetDBIDState(human, nID)
+    if not human or 0 >= nID then
+        return ADDUPCHARGEGIFT_STATE_NONE
+    end
+
+    local tDBPrize = ActAddUpCharge_GetDB(human)
+    if nil == tDBPrize then
+        return ADDUPCHARGEGIFT_STATE_NONE
+    end
+
+    return tDBPrize[nID]
+end
+
+-- 设置某个数据状态
+local function ActAddUpCharge_SetDBIDState(human, nID, nState)
+    if not human or 0 >= nID then
+        return false
+    end
+
+    local tDBPrize = ActAddUpCharge_GetDB(human)
+    if nil == tDBPrize then
+        return false
+    end
+
+    tDBPrize[nID] = nState
+    return true
+end
+----------------------------------------- 内部函数判断 -------------------------------------
+-- 获取配置
+local function ActAddUpCharge_GetConfig()
+    return OpenActExcel.AddUpChargeGift
+end
+
+-- 日志写入
+local function ActAddUpCharge_WriteLog(szText)
+    Log.write(Log.LOGID_OSS_OPENSERVER_ACT, szText)
+end
+
+-- 报错打印
+local function ActAddUpCharge_PrintInfo(szFuncName,szText)
+    print(szFuncName.." "..szText)
+end
+
+-- 客户端回包
+local function ActAddUpCharge_SendClient(fd, data)
+    Msg.send(data, fd)
+    ActAddUpCharge_PrintInfo("[ActAddUpCharge_SendClient]", "发送给客户端结束")
+end
+
+-- 活动是否开启
+local function ActAddUpCharge_IsOpen(human)
+    local szFuncName = "ActAddUpCharge_IsOpen"
+    local szText = ""
+    if not human then
+        szText = "参数不正确 "
+        ActAddUpCharge_PrintInfo(szFuncName, szText)
+        return false
+    end
+
+    local nOpenLv = YunYingLogic.getOpenLvByPanelID(PanelDefine.PANEL_ID_3609)
+    if human.db.lv < nOpenLv then
+        return false
+    end
+
+    local flag = OpenAct.getOpenActTime(OpenAct.OPEN_ACT_SERVER_GIFT)
+    if not flag then
+		return false
+	end
+
+    return true
+end
+
+-- 活动剩余时间
+local function ActAddUpCharge_GetLeftTime()
+    local openDay = CommonDB.getServerOpenDay()
+    if openDay == nil then
+        return 0
+    end
+
+    local OpenActConfig = OpenActExcel.openAct[1]
+    if not OpenActConfig then return 0 end
+
+    local sDay = OpenActConfig.sDay
+    local eDay = OpenActConfig.eDay
+
+    if openDay >= sDay and openDay <= eDay then
+        local time = os.time()
+        local openTime = CommonDB.getServerOpenTime()
+        if openTime == 0 then
+            return 0
+        end
+
+        local endTime = Util.getDayStartTime(openTime) + eDay * 86400
+        return endTime - time
+    end
+
+    return 0
+end
+
+-- 红点
+local function ActAddUpCharge_CheckRed(human)
+    local szFuncName = "ActAddUpCharge_CheckRed"
+    local szText = ""
+    if not human then
+        szText = "参数不正确"
+        ActAddUpCharge_PrintInfo(szFuncName, szText)
+        return false
+    end
+
+    ActAddUpCharge_CreateDB(human)
+
+    local tDBData = ActAddUpCharge_GetDB(human)
+    if not tDBData then
+        szText = "获取玩家DB奖励数据状态表失败"
+        ActAddUpCharge_PrintInfo(szFuncName, szText)
+        return false
+    end
+
+    for k, v in pairs(tDBData) do
+        if ADDUPCHARG_STATE_CANGET == v then
+            print("[ActAddUpCharge_CheckRed] 存在红点")
+            return true
+        end
+    end
+
+    return false
+end
+
+-- 是否显示隐藏
+local function ActAddUpCharge_Show(human)
+    local nNowMoney = ActAddUpCharge_GetDBCharge(human)
+    if not nNowMoney or not nShowAllMoney then
+        return false
+    end
+   
+    return nNowMoney >= nShowAllMoney
+end
+----------------------------------------- 活动模板调用 -------------------------------------
+-- 是否开启
+function isOpen(human, YYInfo, funcConfig)
+    print("[ActAddUpCharge_isOpen] 进入了判断")
+    return ActAddUpCharge_IsOpen(human)
+end
+
+-- 活动剩余时间
+function getLeftTime()
+    print("[ActAddUpCharge_getLeftTime] 获取剩余时间")
+
+    return ActAddUpCharge_GetLeftTime()
+end
+
+-- 是否存在红点
+function isRed(human)
+    print("[ActAddUpCharge_isRed] 获取红点")
+    return ActAddUpCharge_CheckRed(human)
+end
+
+function isActive(human, YYInfo, funcConfig)
+    return not isOpen(human, YYInfo, funcConfig)
+end
+
+----------------------------------------- 客户端协议请求 -------------------------------------
+-- 请求活动协议
+function ActAddUpCharge_Query(human)
+    if not human then
+        return
+    end
+
+    local nCreatRet = ActAddUpCharge_CreateDB(human)
+    if false == nCreatRet then
+        ActAddUpCharge_PrintInfo("[ActAddUpCharge_Query]", "初始化DB数据失败")
+        return
+    end
+
+    local tPrize = tPrizeByID
+    if not tPrize then
+        return
+    end
+
+    local nNowMoney = ActAddUpCharge_GetDBCharge(human)
+    local bShowAll = ActAddUpCharge_Show(human)
+
+    local tMsgData = Msg.gc.GC_PRESEN_OPEN_ADDUP_CHARGE_QUERY
+    tMsgData.nNowMoney = nNowMoney
+    tMsgData.leftTime = ActAddUpCharge_GetLeftTime()
+    tMsgData.list[0] = 0
+
+    for nID, v in pairs(tPrize) do
+        if 1 == v.nShow or (0 == v.nShow and true == bShowAll ) then
+            tMsgData.list[0] = tMsgData.list[0] + 1
+            local tPrizeData = tMsgData.list[tMsgData.list[0]]
+            tPrizeData.nID = nID
+            tPrizeData.nNeedMoney = v.nMoney
+            tPrizeData.nState = ActAddUpCharge_GetDBIDState(human, nID)
+            
+            local nPrizeLne = #v.tPrize
+            tPrizeData.item[0] = nPrizeLne
+            
+            -- ActAddUpCharge_PrintInfo("[ActAddUpCharge_Query]", "遍历的奖励信息 nID = "
+            --         .. nID .. " nState = ".. tPrizeData.nState.." nPrizeLne = "..nPrizeLne)
+    
+            for j = 1, nPrizeLne do
+                local nGoodsID = v.tPrize[j][1]
+                local nGoodsNum = v.tPrize[j][2]
+                -- ActAddUpCharge_PrintInfo("[ActAddUpCharge_Query]", "物品信息 nGoodsID = "..nGoodsID .. " nGoodsNum = "..nGoodsNum)
+    
+                Grid.makeItem(tPrizeData.item[j], nGoodsID, nGoodsNum)
+            end
+        end
+    end
+
+    Msg.send(tMsgData, human.fd)
+    --ActAddUpCharge_PrintInfo("[ActAddUpCharge_Query]", "获取到的奖励长度为 nIndex = "..tMsgData.list[0])
+end
+
+
+-- 请求领取奖励
+function ActAddUpCharge_GetPrize(human, nID)
+    if not human or 0 >= nID then
+        return
+    end
+
+    if not tPrizeByID or not tPrizeByID[nID] then
+        return
+    end
+
+    local nNowMoney = ActAddUpCharge_GetDBCharge(human)
+    local nNowState = ActAddUpCharge_GetDBIDState(human, nID)
+    if ADDUPCHARG_STATE_CANGET ~= nNowState then
+        ActAddUpCharge_PrintInfo("ActAddUpCharge_GetPrize", "请求领取的奖励状态不正确 nID = "..nID)
+        return
+    end
+
+    local tGoodsInfo = tPrizeByID[nID].tPrize
+
+    -- 设置状态
+    if false == ActAddUpCharge_SetDBIDState(human, nID, ADDUPCHARG_STATE_FINISH) then
+        ActAddUpCharge_PrintInfo("ActAddUpCharge_GetPrize", "设置数据状态失败 nID = "..nID)
+        return
+    end
+
+    -- 发奖励
+    for i = 1, #tGoodsInfo do
+        local nGoodsID = tGoodsInfo[i][1]
+        local nGoodsNum = tGoodsInfo[i][2]
+
+        BagLogic.addItem(human, nGoodsID, nGoodsNum,"open_server_PowerUpPrize")
+    end
+
+	BagLogic.sendItemGetList(human, tGoodsInfo, "open_server_PowerUpPrize")
+
+    YunYingLogic.sendBanner(human)
+	for k, v in pairs(funcID) do
+	    YunYingLogic.updateIcon(YYInfo[k], human)
+	    YunYingLogic.sendGroupUpdate(YYInfo[k], human, PanelDefine.PANEL_ID_3605)
+        break
+    end
+    
+    ActAddUpCharge_Query(human)
+end
+
+
+----------------------------------------- 其他模块调用 -------------------------------------
+-- 用于起服时映射奖励ID对应配置
+function Init()
+    local tPrize = ActAddUpCharge_GetConfig()
+    if not tPrize then
+        ActAddUpCharge_PrintInfo("Init", "起服获取不到配置")
+        return
+    end
+    
+    tPrizeByID = {}
+    nShowAllMoney = 0
+
+    for nID, v in pairs(tPrize) do
+        if tPrizeByID[nID] then
+            ActAddUpCharge_PrintInfo("Init", "配置了重复的奖励ID")
+            return
+        end
+
+        tPrizeByID[nID] = v
+
+        if 1 == v.nShow then
+            nShowAllMoney = math.max(nShowAllMoney, v.nMoney)
+        end
+    end
+end
+
+-- 充值回调
+function onCharge(human, price, funcID, buyID)
+    if not human or 0 >= price then
+        return
+    end
+
+    if false == ActAddUpCharge_IsOpen(human) then
+        return
+    end
+
+    local nNowMoney = ActAddUpCharge_GetDBCharge(human)
+    nNowMoney = nNowMoney + price
+
+    ActAddUpCharge_SetDBCharge(human, nNowMoney)
+
+    if not tPrizeByID then
+        return
+    end
+
+    local nSendClient = false
+    for nID, v in pairs(tPrizeByID) do
+        local nState = ActAddUpCharge_GetDBIDState(human, nID)
+
+        if ADDUPCHARGEGIFT_STATE_NONE == nState then
+            if nNowMoney >= v.nMoney then
+                ActAddUpCharge_SetDBIDState(human, nID, ADDUPCHARG_STATE_CANGET)
+                nSendClient = true
+            end
+        end
+    end
+
+    if true == nSendClient then
+        YunYingLogic.sendBanner(human)
+    end
+end
+
+-- 登录回调
+function onLogin(human, funcID)
+    -- 在活动期间
+    if true == ActAddUpCharge_IsOpen(human) then
+        return
+    end
+
+    if not tPrizeByID then
+        return
+    end
+
+    if not human.db.AddUpChargeSendMail then
+        human.db.AddUpChargeSendMail = 0
+    end
+
+    if human.db.AddUpChargeSendMail == 1 then
+        return
+    end
+
+    human.db.AddUpChargeSendMail = 1
+
+    local tMailConfig = MailExcel.mail[nMailID]
+    if not tMailConfig then
+        return
+    end
+
+    local items = { }
+    for nID, v in pairs(tPrizeByID) do
+        local nState = ActAddUpCharge_GetDBIDState(human, nID)
+        if nState == ADDUPCHARG_STATE_CANGET then
+            for _, data in pairs(v.tPrize) do
+                items[#items + 1] = { data[1], data[2] }
+            end
+            ActAddUpCharge_SetDBIDState(human, nID, ADDUPCHARG_STATE_FINISH)
+        end
+    end
+
+    local title = tMailConfig.title
+    local content = tMailConfig.content
+    local senderName = tMailConfig.senderName
+    MailManager.add(MailManager.SYSTEM, human.db._id, title, content, items, senderName)
+end

+ 24 - 0
script/module/present/Proto.lua

@@ -945,3 +945,27 @@ GC_PRESENT_OPEN_POWERUP_GETPRIZE = {
     {"nID",             1,      "int"},         -- 领取奖励ID
     {"nState",          1,      "byte"},        -- 1 领取成功,0 领取失败
 }
+
+--------------------------------------------- 累积充值
+AddUpChargePrize = {
+    {"nID",              1,      "int"},         -- 奖励编号
+    {"nState",          1,      "byte"},        -- 0 不可领取 1 - 可领取 2- 已领取
+    {"nNeedMoney",      1,      "int"},         -- 领取所需充值数
+    {"item",            5,      ItemData},      -- 奖励信息
+}
+
+-- 请求开服累计充值活动信息
+CG_PRESEN_OPEN_ADDUP_CHARGE_QUERY = {}
+
+-- 请求开服累计充值活动信息 回包
+GC_PRESEN_OPEN_ADDUP_CHARGE_QUERY = 
+{
+    {"nNowMoney",   1,  "int"},
+    {"leftTime",    1,  "int"},             -- 剩余时间      
+    {"list",        20,  AddUpChargePrize},
+}
+
+-- 请求领取累计充值活动奖励
+CG_PRESENT_OPEN_ADDUP_CHARGE_GETPRIZE = {
+    {"nID",             1,      "int"},         -- 领取奖励ID
+}

+ 10 - 1
script/module/skin/SkinLogic.lua

@@ -292,7 +292,16 @@ function getBody(human,heroInd)
 	if not skinId then 
 		return
 	end
-	return SkinExcel[skinId].body,SkinExcel[skinId].head
+    if SkinExcel[skinId].heroId == heroId then
+        return SkinExcel[skinId].body,SkinExcel[skinId].head
+    else
+        print("[getBody] 英雄装备的身体ID不正确 heroId = "..heroId)
+        local tHeroCof = HeroExcel[heroId]
+        if tHeroCof then
+            print("[getBody] 英雄装备的身体ID不正确,返回基础配置 heroId = "..heroId.." body = "..tHeroCof.body.." head = "..tHeroCof.head)
+            return tHeroCof.body, tHeroCof.head
+        end
+    end
 	--[[if not human.db.skinBag then
 		return
 	end

+ 22 - 19
script/module/union/UnionTecLogic.lua

@@ -15,10 +15,11 @@ local UnionDBLogic = require("union.UnionDBLogic")
 local Util = require("common.Util")
 local UnionLivenessLogic = require("union.UnionLivenessLogic")
 local UnionDefine = require("union.UnionDefine")
+local RoleDefine = require("role.RoleDefine")
 
 TEC_OCCU_CNT = 4
 TEC_TIER_CNT = 6
--- 获取科技配置
+-- 鑾峰彇绉戞妧閰嶇疆
 local function getTechnologyCfg(job, tier)
     local config = UnionExcel.technology
 	local cfg = nil
@@ -30,7 +31,7 @@ local function getTechnologyCfg(job, tier)
 	end	
 end
 
--- 计算科技属性
+-- 璁$畻绉戞妧灞炴€�
 function doCalcHero(human, grid, attrs)
     if not human then return end
     if not human.db.unionUuid or human.db.unionUuid == "" then
@@ -92,7 +93,7 @@ function lvAllUpByGm(human)
 
 end
 
--- 获取其他科技的总等级
+-- 鑾峰彇鍏朵粬绉戞妧鐨勬€荤瓑绾�
 function getOtherLv(human, occu)
     local lv = 9999
 
@@ -125,7 +126,7 @@ function getID(occu, tier)
     return id 
 end
 
--- 获取该等级所需要的 磨坊等级 和其他 科技等级
+-- 鑾峰彇璇ョ瓑绾ф墍闇€瑕佺殑 纾ㄥ潑绛夌骇 鍜屽叾浠� 绉戞妧绛夌骇
 function getNeedMillOhter(lv, occu, tier)
     local needMill = 0
     local needOther = 0
@@ -151,11 +152,11 @@ function getNeedMillOhter(lv, occu, tier)
 end
 
 function techQuery(human, occu)
-    -- 没有加入公会查什么科技
+    -- 娌℃湁鍔犲叆鍏�細鏌ヤ粈涔堢�鎶€
     if human.db.unionUuid == nil then
         return
     end
-    -- 对不起,你要查的科技这里没得卖,请你出去
+    -- 瀵逛笉璧凤紝浣犺�鏌ョ殑绉戞妧杩欓噷娌″緱鍗栵紝璇蜂綘鍑哄幓
     if occu == nil then return end
     if occu < 1 or occu > TEC_OCCU_CNT then
         return
@@ -309,7 +310,7 @@ function techQuery(human, occu)
 end
 
 function techLvUp(human,occu,tier)
-    -- 没公会升什么玩意科技
+    -- 娌″叕浼氬崌浠€涔堢帺鎰忕�鎶€
     if human.db.unionUuid == nil then 
         return  Broadcast.sendErr(human,Lang.UNION_PLAYER_IN_NO)
     end
@@ -323,7 +324,7 @@ function techLvUp(human,occu,tier)
     local config = UnionExcel.technology
     local flag = 1
     local isFirst = false
-    if human.db.technology == nil then-- 先升第一层的科技嘛,干啥要跳级呢 
+    if human.db.technology == nil then-- 鍏堝崌绗�竴灞傜殑绉戞妧鍢涳紝骞插暐瑕佽烦绾у憿 
         if tier ~= 1 then
             return Broadcast.sendErr(human,Lang.UNION_TECH_LAST_LV_ERR)
         end
@@ -342,7 +343,7 @@ function techLvUp(human,occu,tier)
         human.db.technology[occu][tier].lv = human.db.technology[occu][tier].lv + 1
         isFirst = true
     else
-        -- 不要跳级
+        -- 涓嶈�璺崇骇
         if tier ~= 1 then
             if not human.db.technology  or not human.db.technology[occu] or next(human.db.technology[occu]) == nil  then
                 return
@@ -360,12 +361,12 @@ function techLvUp(human,occu,tier)
 
         local getID = getID(occu, tier)
         local thisConfig = UnionExcel.technology[getID]
-        -- 都顶级了还升个锤子
+        -- 閮介《绾т簡杩樺崌涓�敜瀛�
         if human.db.technology[occu][tier].lv >= thisConfig.lvMax then
             return Broadcast.sendErr(human,Lang.UNION_TECH_LV_ERR)
         end    
         
-        -- 前置科技等级没有达标
+        -- 鍓嶇疆绉戞妧绛夌骇娌℃湁杈炬爣
         if tier~= 1 then
             if human.db.technology[occu][tier - 1] == nil or human.db.technology[occu][tier - 1].lv == nil or human.db.technology[occu][tier - 1].lv <= human.db.technology[occu][tier].lv  then
                 return Broadcast.sendErr(human,Lang.UNION_TECH_LAST_LV_ERR)
@@ -379,12 +380,12 @@ function techLvUp(human,occu,tier)
         local millLv = UnionDBLogic.getMillLv(union)
         local needMillLv, needOther = getNeedMillOhter(human.db.technology[occu][tier].lv, occu, tier)
         local otherLv = getOtherLv(human, occu)
-        -- 公会聚义堂 等级没有达到需求 
+        -- 鍏�細鑱氫箟鍫� 绛夌骇娌℃湁杈惧埌闇€姹� 
         if millLv < needMillLv then
             return Broadcast.sendErr(human, Util.format(Lang.UNION_TECH_MILL_ERR,  needMillLv) )
         end
 
-        -- 其他科技没有达标
+        -- 鍏朵粬绉戞妧娌℃湁杈炬爣
         if otherLv < needOther then
             return Broadcast.sendErr(human, Util.format(Lang.UNION_TECH_OTHER_ERR, needOther ) )
         end
@@ -404,7 +405,7 @@ function techLvUp(human,occu,tier)
 
         if tier == TEC_TIER_CNT then
             human.db.technology[occu].lv = human.db.technology[occu][tier].lv
-            -- 公会科技等级记录
+            -- 鍏�細绉戞妧绛夌骇璁板綍
             Log.write(Log.LOGID_OSS_UNION_TECH, human.db._id, human.db.account, human.db.name, occu, human.db.technology[occu].lv or 0)
         end
     end
@@ -418,6 +419,8 @@ function techLvUp(human,occu,tier)
     techQuery(human,occu)
     UnionLivenessLogic.touchLiveness(human,UnionDefine.UNION_LIVENESS_TEC,1)
     RoleAttr.cleanHeroAttrCache(human)
+    RoleAttr.doCalc(human)
+    ObjHuman.sendAttr(human, RoleDefine.ZHANDOULI)
 end
 
 function checkisFirstRest(human)
@@ -440,10 +443,10 @@ function getResetNeedZuanshi(human, lv)
     end
 end
 
--- 重置 返回道具查询
+-- 閲嶇疆 杩斿洖閬撳叿鏌ヨ�
 function techResetQuery(human, occu) 
 
-     -- 没点科技,你重置个锤子
+     -- 娌$偣绉戞妧锛屼綘閲嶇疆涓�敜瀛�
      if human.db.technology == nil then 
         return Broadcast.sendErr(human,Lang.UNION_TECH_LV_ZERO_ERR)
     end
@@ -452,7 +455,7 @@ function techResetQuery(human, occu)
         return Broadcast.sendErr(human, Lang.UNION_TECH_LV_ZERO_ERR)
     end
 
-     -- 先把消耗计算出来
+     -- 鍏堟妸娑堣€楄�绠楀嚭鏉�
      local jinbiCnt = 0
      local coinCnt = 0
      local config = UnionExcel.tecConsume
@@ -481,7 +484,7 @@ function techReset(human,occu)
         return
     end
     local flag = 1
-    -- 没点科技,你重置个锤子
+    -- 娌$偣绉戞妧锛屼綘閲嶇疆涓�敜瀛�
     if human.db.technology == nil then 
         return Broadcast.sendErr(human,Lang.UNION_TECH_LV_ZERO_ERR)
     end
@@ -495,7 +498,7 @@ function techReset(human,occu)
         end
         ObjHuman.decZuanshi(human, -zuanshiCnt, "reset_technology")               
     end
-    -- 先把消耗计算出来
+    -- 鍏堟妸娑堣€楄�绠楀嚭鏉�
     local jinbiCnt = 0
     local coinCnt = 0
     local config = UnionExcel.tecConsume

+ 2 - 0
script/module/yunying/YunYingLogic.lua

@@ -38,6 +38,7 @@ local InnerMsg = require("core.InnerMsg")
 local AbsReachRankDB = require("absAct.AbsReachRankDB")
 local OpenServerActPowerUp = require("present.OpenServerActPowerUp")
 local WeekendLoopActManger = require("WeekendLoopActivity.WeekendLoopActManager")
+local OpenServerActAddUpCharge = require("present.OpenServerActAddUpCharge")
 
 ID2YYInfo = ID2YYInfo or { } -- 每个id是一个主界面上方运营活动大图标入口
 PANELID2OPENLV = PANELID2OPENLV or { }
@@ -185,6 +186,7 @@ function init()
     AbsReachRankDB.init()
     OpenServerActPowerUp.Init()
     WeekendLoopActManger.WeekLoopACT_Init()
+    OpenServerActAddUpCharge.Init()
 end
 
 

+ 3 - 0
script/module/zhanbu/ZhanbuLogic.lua

@@ -19,6 +19,7 @@ local MengxinLogic = require("present.MengxinLogic")
 local AbsZhanbuLunpanLogic = require("absAct.AbsZhanbuLunpanLogic")
 local YunYingLogic = require("yunying.YunYingLogic")
 local TalismanLogic = require("talisman.TalismanLogic")
+local RecommendLineup = require("drawCard.RecommendLineup")
 --[[
     pool ����
     hand ����
@@ -578,6 +579,8 @@ function onLogin(human)
             human.db.zhanbu.ts = os.time()
         end
     end
+
+    RecommendLineup.RecommendLineup_UpDate(human)
 end