Bladeren bron

Merge branch '360test' of http://43.226.57.217:3000/yishanyou/GongFuServer into 360test

pigflower 1 week geleden
bovenliggende
commit
96c8ceabae

+ 0 - 2
script/common/CommonDB.lua

@@ -45,7 +45,6 @@ KEY_BAN_DATA = "banData"								-- 封禁数据
 KEY_DESKTOP_DATA = "desktopData"					-- 桌面添加数据(账号级)
 KEY_REBATE_DATA = "rebateData"							-- 渠道返利数据
 KEY_ANOTHERWORLDBATTLE_START_TI = "anotherWorldBattleStart" -- 最近一轮异界之战开启时间
-KEY_BIGRPLAYER_SHOW_DATA = "bigRPlayerShowData"				-- 大R玩家实力展示相关数据
 
 db = db or {
 	serverStartTime = nil,								-- 开服时间
@@ -74,7 +73,6 @@ db = db or {
 	commerceActInfo = {},								-- 跨服商业活动信息
 	jjcNewladderInfo = {},								-- 天梯赛信息
 	commerceMiddleActInfo = {},							-- 中心服跨服商业活动信息
-	bigRPlayerShowData = {},
 }
 
 

+ 3 - 0
script/common/Lang.lua

@@ -51,6 +51,8 @@ COMMON_FINISH = [[已完成]]
 COMMON_NEED_LEVEL = [[等级需要达到{1}级]]
 COMMON_HERO_UPPOS = [[有英雄已经在别的阵容上阵]]
 
+COMMON_DAILY_PASSLEVEL_LIMIT = [[已达每日通关上限, 请明日再来]]
+
 --------------------------------------------------
 
 
@@ -213,6 +215,7 @@ ITEM_GET_SUCCESS = [[领取成功]]
 ITEM_BUY_ERROR = [[购买错误]]
 ITEM_BUY_ERR_MAX = [[道具购买已达上限]]
 ITEM_BUY_DEFAULT = [[购买失败]]
+ITEM_CANNOT_RECYCLE = [[道具无法被回收]]
 
 ACT_NOT_START = [[活动未开始]]
 ACT_WAS_OVER = [[活动已结束]]

+ 4 - 2
script/common/LogDefine.lua

@@ -320,8 +320,10 @@ DEFINE = {
 	HeroTianYuan 			= 780,  		-- 英雄天元系统
 	BreakThroughTheme 		= 781,  		-- 闯关主题
 	VoucherInvest 			= 782,  		-- 代金券投资
-	Artifacts				= 783,			-- 英雄神威灵装
-	BattleGift				= 784,			-- 闯关礼金
+	LevelGift 				= 783,  		-- 送万元充值
+	Artifacts				= 784,			-- 英雄神威灵装
+	BattleGift				= 785,			-- 闯关礼金
+	RecycleItem				= 786,			-- 收纳箱
 
 	errHandle				= 99999,		-- 异常处理
 }

+ 12 - 0
script/common/ProtoID.lua

@@ -1736,6 +1736,7 @@ _ENV[1776]="GC_ZHUANPAN_ONCE_REWARD_QUERY"
 _ENV[1777]="CG_ZHUANPAN_ONCE_REWARD_GET"
 _ENV[1778]="CG_ALL_HERO_BOOK_QUERY"
 _ENV[1779]="GC_ALL_HERO_BOOK_QUERY"
+_ENV[1780]="GC_DRAWCARD_OP2"
 _ENV[1781]="CG_SERVEERCOMMERCE_ACT_BATTLEGROUND_MAINPAGE_QUERY"
 _ENV[1782]="GC_SERVEERCOMMERCE_ACT_BATTLEGROUND_MAINPAGE_QUERY"
 _ENV[1783]="CG_SERVEERCOMMERCE_ACT_BATTLEGROUND_MATCHLIST_QUERY"
@@ -1814,6 +1815,17 @@ _ENV[1851]="CG_BATTLEGIFT_GET"
 
 _ENV[1854]="GC_POWERRANK_TOPONE_LOGIN"
 
+_ENV[1855]="CG_RECYCLE_QUERY"
+_ENV[1856]="GC_RECYCLE_QUERY"
+_ENV[1857]="CG_RECYCLE_RECYCLEITEM"
+_ENV[1858]="CG_RECYCLE_GET_RECYCLE_LIST"
+_ENV[1859]="GC_RECYCLE_GET_RECYCLE_LIST"
+
+_ENV[1860]="CG_BATTLE_DAILY_PASSLVEL_INFO_QUERY"
+_ENV[1861]="GC_BATTLE_DAILY_PASSLVEL_INFO_QUERY"
+_ENV[1862]="CG_HUNAGJINGTOWER_DAILY_PASSLVEL_INFO_QUERY"
+_ENV[1863]="GC_HUNAGJINGTOWER_DAILY_PASSLVEL_INFO_QUERY"
+
 _ENV[1896]="CG_ZHUANPAN_SUBSCRIBE_REWARD_QUERY"
 _ENV[1897]="GC_ZHUANPAN_SUBSCRIBE_REWARD_QUERY"
 _ENV[1898]="CG_ZHUANPAN_SUBSCRIBE_REWARD_GET"

+ 56 - 0
script/common/Util.lua

@@ -474,6 +474,62 @@ function split(str, split_char,isNumber)
     return t
 end
 
+
+TONUMBER_KEY   = "key"
+TONUMBER_VALUE = "value"
+TONUMBER_ALL   = "all"
+--- 灵活解析键值字符串
+-- @param str           源字符串,如 "1001-10|1002-11"
+-- @param segSep        段分隔符,如 "|"(默认 "|")
+-- @param kvSep         键值分隔符,如 "-"(默认 "-")
+-- @param tonumberMode  可选:"key"只转键,"value"只转值,"all"都转,nil不转
+-- @return table        解析后的字典表
+function parseKVString(str, segSep, kvSep, tonumberMode)
+    -- 防护:nil 或空字符串直接返回空表
+    if not str or str == "" then
+        return {}
+    end
+
+    -- 去掉首尾空白(可选,视需求而定)
+    str = string.match(str, "^%s*(.-)%s*$") or ""
+    if str == "" then
+        return {}
+    end
+
+    segSep = segSep or "|"
+    kvSep = kvSep or "-"
+
+    -- 转义模式中的特殊字符
+    local function escapePattern(s)
+        return (string.gsub(s, "([%-%.%+%*%?%[%]%^%$%(%)%%])", "%%%1"))
+    end
+
+    local segPattern = escapePattern(segSep)
+
+    local result = {}
+
+    for segment in string.gmatch(str, "([^" .. segPattern .. "]+)") do
+        local pos = string.find(segment, kvSep, 1, true)
+        if pos then
+            local key = string.sub(segment, 1, pos - 1)
+            local value = string.sub(segment, pos + string.len(kvSep))
+
+            if tonumberMode == "key" or tonumberMode == "all" then
+                key = tonumber(key) or key
+            end
+            if tonumberMode == "value" or tonumberMode == "all" then
+                value = tonumber(value) or value
+            end
+
+            result[key] = value
+        end
+    end
+
+    return result
+end
+
+
+
 -- 根据KEY从小到大排序
 function pairsByKeys(t)
 	local a = {}

+ 1 - 1
script/core/Timer.lua

@@ -126,7 +126,7 @@ function doZhengDian(hour)
         BillboardLogic.onZero()
         ChatRecord.CHAT_RECORD_REPETITION = {}
         HeroGrowUp.actLoop()
-        LostTempleLogic.onZero()
+        -- LostTempleLogic.onZero()
 	    VoucherShopLogic.VoucherShop_OnZero()
         MainDianLogic.MaiDian_OnTime()
         ServerCommerceMiddle.CommerceMiddle_OnZero()

+ 7 - 0
script/module/bag/BagLogic.lua

@@ -285,6 +285,9 @@ function handlerSpObj(human, itemID, itemCnt, logType)
     	return
     end
 
+	Log.write(Log.LOGID_OSS_ITEM, human.db._id, human.db.account, human.db.name, human.db.lv,
+		LogDefine.DEFINE[logType] + LogDefine.TYPE["item"] , itemID, itemCnt, 0)
+
 	local cmdstr = itemConfig.cmd and itemConfig.cmd[1]
 	if cmdstr and ItemLogic.cmd[cmdstr] then
 		ItemLogic.onlyuse(human, itemID, itemCnt, logType, true)
@@ -882,4 +885,8 @@ function calculateBonusItemCount(human, id, cnt,logType)
     end
     -- 默认返回原数量
     return cnt
+end
+
+function GetBagData(human)
+	return human.db.bag
 end

+ 14 - 0
script/module/bag/Handler.lua

@@ -4,6 +4,7 @@ local ItemLogic = require("bag.ItemLogic")
 local BoxLogic = require("bag.BoxLogic")
 local DropSpecial = require("bag.DropSpecial")
 local HeroSkinLogic = require("present.HeroSkinLogic")
+local RecycleItem = require("bag.RecycleItem")
 
 -- 请求碎片英雄信息
 function CG_SUIPIAN_HERO_QUERY(human, msg)
@@ -91,4 +92,17 @@ end
 
 function CG_DUIHUANG_DO(human, msg)
 	SuipianLogic.SuiPianLogic_DuiHuangDo(human, msg.nID, msg.nNum)
+end
+
+
+function CG_RECYCLE_QUERY(human, msg)
+	RecycleItem.RecycleItem_Query(human)
+end
+
+function CG_RECYCLE_RECYCLEITEM(human, msg)
+	RecycleItem.RecycleItem_Recycle_Do(human, msg.recycleItemStr)
+end
+
+function CG_RECYCLE_GET_RECYCLE_LIST(human, msg)
+	RecycleItem.RecycleItem_RecycleItemListQuery(human)
 end

+ 32 - 0
script/module/bag/Proto.lua

@@ -364,4 +364,36 @@ GC_DUIHUANG_QUERY = {
 CG_DUIHUANG_DO = {
 	{"nID",		1,		"int"},		-- 物品ID
 	{"nNum",	1,		"int"},		-- 兑换数量
+}
+
+
+-------------------------收纳箱---------------------------------
+
+RECYCLE_ITEM = {
+	{"id",			1,		"int"},		-- 物品ID
+	{"recycleVal",	1,		"short"},	-- 回收值
+}
+--查询
+CG_RECYCLE_QUERY = {}
+
+GC_RECYCLE_QUERY = {
+	{"currentLevel",	1,		"short"},		-- 当前等级
+	{"maxLevel",		1,		"short"},		-- 最高等级
+	{"currentExp",		1,		"int"},			-- 当前经验值
+	{"nextLvExp",		1,		"int"},			-- 升到下一级所需经验
+	{"currentLvAttrs",	6,		Attr},			-- 当前等级加成属性
+	{"nextLvAttrs",		6,		Attr},			-- 下一级加成属性
+}
+
+CG_RECYCLE_GET_RECYCLE_LIST = {}
+GC_RECYCLE_GET_RECYCLE_LIST = {
+	{"recycleList",		50,		RECYCLE_ITEM},	-- 可回收道具列表
+	{"isStart",			1,		"byte"},      	-- 0-否,1-是
+	{"isEnd",			1,		"byte"},      	-- 0-否,1-是
+}
+
+
+--回收道具
+CG_RECYCLE_RECYCLEITEM = {
+	{"recycleItemStr",		1,		"string"},	-- 回收道具信息, 格式:"道具Id-数量|道具Id-数量"
 }

+ 330 - 0
script/module/bag/RecycleItem.lua

@@ -0,0 +1,330 @@
+-- 收纳箱(回收道具)
+
+--db
+--[=[
+    human.db.recycleData = {
+        level = nil,
+        exp = nil,
+    }
+]=]--
+
+local Msg = require("core.Msg")
+local Lang = require("common.Lang")
+local Broadcast = require("broadcast.Broadcast")
+local Util = require("common.Util")
+local BagLogic = require("bag.BagLogic")
+local RoleAttr = require("role.RoleAttr")
+local RoleDefine = require("role.RoleDefine")
+local ObjHuman = require("core.ObjHuman")
+local RecycleConfig = require("excel.recycleItem").RecycleLvList
+local ItemConfig = require("excel.item").item
+-- local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
+-- local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
+
+local LOG_TAG = "RecycleItem" -- 本系统的日志标识
+local OPEN_COND_LV = 150 -- 开启功能需要的等级
+
+local function initRecycleData(human)
+    human.db.recycleData = { level = 0, exp = 0 }
+end
+
+local function getRecycleData(human)
+    return human.db.recycleData
+end
+
+local function updateRecycleData(human, newLv, newExp)
+    local recycleData = getRecycleData(human)
+    if not recycleData then
+        initRecycleData(human)
+        recycleData = getRecycleData(human)
+    end
+
+    recycleData.level = newLv
+    recycleData.exp = newExp
+end
+
+
+-- 是否开启本系统
+local function isOpen(human)
+    -- return RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_2031) -- 待修改
+    return human.db.lv >= OPEN_COND_LV
+end
+-- 计算当前等级加成属性
+local function calcCurrentLvAttrs(currentLevel)
+    if not currentLevel or currentLevel <= 0 then
+        return
+    end
+
+    local attrs = {}
+    for i=1, currentLevel do
+        local cfg = RecycleConfig[i]
+        if cfg and cfg.attrs then
+            for _,v in ipairs(cfg.attrs) do
+                local attrId = v[1]
+                local attrVal = v[2]
+                attrs[attrId] = (attrs[attrId] or 0) + attrVal
+            end
+        end
+    end
+
+    return attrs
+end
+-- 重算战力
+local function updatePower(human)
+    RoleAttr.cleanHeroAttrCache(human)
+    RoleAttr.doCalc(human)
+    ObjHuman.sendAttr(human, RoleDefine.ZHANDOULI)
+end
+-- 计算出新的等级和经验
+local function calcLv(human, addExp)
+    local recycleData = getRecycleData(human)
+    local currentLevel = recycleData and recycleData.level or 0
+    local currentExp = recycleData and recycleData.exp or 0
+
+    currentExp = currentExp + addExp
+    local newLv = currentLevel
+
+    for i=currentLevel+1, #RecycleConfig do
+        local cfg = RecycleConfig[i]
+        if currentExp < cfg.exp then
+            break
+        end
+
+        currentExp = currentExp - cfg.exp
+        newLv = i
+
+        if currentExp <= 0 then
+            break
+        end
+    end
+
+    return newLv, currentExp
+end
+
+
+local function populateCurrentLvAttrs(net, currentLevel)
+    local isZero = false
+    if currentLevel <= 0 then
+        currentLevel = 1
+        isZero = true
+    end
+
+    local len = 0
+    net[0] = len
+
+    local attrs = calcCurrentLvAttrs(currentLevel)
+    for attrId, attrVal in pairs(attrs or {}) do
+        len = len + 1
+        net[0] = len
+        net[len].key = attrId
+        net[len].value = isZero and 0 or attrVal
+    end
+
+end
+
+local function populateNextLvAttrs(net, nextLv)
+    local isMax = false
+    local maxLv = #RecycleConfig
+    if maxLv <= nextLv then
+        nextLv = maxLv
+        isMax = true
+    end
+
+    net[0] = 0
+    local cfg = RecycleConfig[nextLv]
+
+    if cfg and cfg.attrs then
+        net[0] = #cfg.attrs
+        for k,v in ipairs(cfg.attrs) do
+            net[k].key = v[1]
+            net[k].value = isMax and 0 or v[2]
+        end
+    end
+
+end
+
+-- local function populateRecycleItem(net, human)
+--     net[0] = 0
+
+--     local bagData = BagLogic.GetBagData(human)
+--     if not bagData then
+--         return
+--     end
+
+--     local len = 0
+--     for itemId in pairs(bagData) do
+--         local itemCfg = ItemConfig[itemId]
+--         if itemCfg and itemCfg.val and itemCfg.val > 0 then
+--             len = len + 1
+--             net[0] = len
+--             net[len].id = itemId
+--             net[len].recycleVal = itemCfg.val
+--         end
+--     end
+-- end
+
+
+
+-- 外部调用, 统计收纳箱加成属性
+function doCalcHero(human, addAttrs)
+    if not human then
+        return
+    end
+
+    local recycleData = getRecycleData(human)
+    if not recycleData then
+        return
+    end
+
+    local currentLevel = recycleData and recycleData.level or 0
+    if currentLevel <= 0 then
+        return
+    end
+
+    local attrs = calcCurrentLvAttrs(currentLevel)
+    for attrId, attrVal in pairs(attrs or {}) do
+        RoleAttr.updateValue(attrId, attrVal, addAttrs)
+    end
+end
+
+
+
+-- 查询部分信息
+function RecycleItem_Query(human)
+    if not isOpen(human) then
+        return Broadcast.sendErr(human, Lang.COMMOM_NOT_ENABLED)
+    end
+
+    local recycleData = getRecycleData(human)
+    local currentLevel = recycleData and recycleData.level or 0
+    local currentExp = recycleData and recycleData.exp or 0
+    local maxLevel = #RecycleConfig
+    local nextLvExp = 0
+
+    if currentLevel < maxLevel then
+        local nextLvCfg = RecycleConfig[currentLevel + 1]
+        nextLvExp = nextLvCfg.exp
+    end
+
+    local msgRet = Msg.gc.GC_RECYCLE_QUERY
+    msgRet.currentLevel = currentLevel
+    msgRet.maxLevel = maxLevel
+    msgRet.currentExp = currentExp
+    msgRet.nextLvExp = nextLvExp
+
+    populateCurrentLvAttrs(msgRet.currentLvAttrs, currentLevel)
+    populateNextLvAttrs(msgRet.nextLvAttrs, currentLevel+1)
+    -- populateRecycleItem(msgRet.recycleList, human)
+
+    Msg.send(msgRet, human.fd)
+end
+
+-- 查询可回收道具列表
+function RecycleItem_RecycleItemListQuery(human)
+    if not isOpen(human) then
+        return Broadcast.sendErr(human, Lang.COMMOM_NOT_ENABLED)
+    end
+
+    local msgRet = Msg.gc.GC_RECYCLE_GET_RECYCLE_LIST
+    msgRet.recycleList[0] = 0
+    msgRet.isStart = 1
+    msgRet.isEnd = 0
+
+    local bagData = BagLogic.GetBagData(human)
+    if not bagData then
+        msgRet.isEnd = 1
+        return Msg.send(msgRet, human.fd)
+    end
+
+    local itemArr = {}
+    for itemId in pairs(bagData) do
+        local itemCfg = ItemConfig[itemId]
+        if itemCfg and itemCfg.val and itemCfg.val > 0 then
+            itemArr[#itemArr+1] = {itemId, itemCfg.val}
+        end
+    end
+
+    local itemNum = #itemArr
+    if itemNum == 0 then
+        msgRet.isEnd = 1
+        return Msg.send(msgRet, human.fd)
+    end
+
+    local len = 0
+    local onceMsgLen = 50
+
+    for _, itemInfo in ipairs(itemArr) do
+        len = len + 1
+        msgRet.recycleList[0] = len
+        msgRet.recycleList[len].id = itemInfo[1]
+        msgRet.recycleList[len].recycleVal = itemInfo[2]
+
+        if len >= onceMsgLen then
+            itemNum = itemNum - len
+            if itemNum <= 0 then
+                msgRet.isEnd = 1
+                return Msg.send(msgRet, human.fd)
+            end
+
+            Msg.send(msgRet, human.fd)
+            len = 0
+            msgRet.isStart = 0
+        end
+    end
+
+    if len > 0 then
+        msgRet.isEnd = 1
+        Msg.send(msgRet, human.fd)
+    end
+end
+
+-- 回收道具
+function RecycleItem_Recycle_Do(human, recycleItemStr)
+    if not isOpen(human) then
+        return Broadcast.sendErr(human, Lang.COMMOM_NOT_ENABLED)
+    end
+
+    local itemList = Util.parseKVString(recycleItemStr, "|", "-", Util.TONUMBER_ALL)
+    if not next(itemList) then
+        return Broadcast.sendErr(human, Lang.COMMON_ARGUMENT_ERROR)
+    end
+
+    local recycleData = getRecycleData(human)
+    local currentLevel = recycleData and recycleData.level or 0
+    local maxLevel = #RecycleConfig
+    if currentLevel >= maxLevel then
+        return Broadcast.sendErr(human, Lang.COMMON_MAXLEVEL)
+    end
+
+    local totalExp = 0
+    for itemId, itemCnt in pairs(itemList) do
+        local itemCfg = ItemConfig[itemId]
+        if not itemCfg or not itemCfg.val or itemCfg.val <= 0 then
+            return Broadcast.sendErr(human, Lang.ITEM_CANNOT_RECYCLE)
+        end
+
+        if BagLogic.getItemCnt(human, itemId) < itemCnt then
+            return Broadcast.sendErr(human, Lang.COMMON_ITEM_NOT_ENOUGH)
+        end
+
+        totalExp = totalExp + itemCfg.val * itemCnt
+    end
+
+    for itemId, itemCnt in pairs(itemList) do
+        if BagLogic.getItemCnt(human, itemId) < itemCnt then
+            return Broadcast.sendErr(human, Lang.COMMON_ITEM_NOT_ENOUGH)
+        end
+        BagLogic.delItem(human, itemId, itemCnt, LOG_TAG)
+    end
+
+    -- 更新等级, 经验
+    local newLv, newExp = calcLv(human, totalExp)
+    updateRecycleData(human, newLv, newExp)
+
+    -- 更新战力
+    updatePower(human)
+
+    -- 更新UI界面数据
+    RecycleItem_Query(human)
+    RecycleItem_RecycleItemListQuery(human)
+end

+ 54 - 3
script/module/battle/BattleLogic.lua

@@ -424,6 +424,35 @@ local function getBattleCfgByType(nBattleType)
 end
 
 
+-- 获取每日通关层数
+local function getDailyPassLevelNum(human)
+    return human.db.battle_dailyPassLevelNum or 0
+end
+
+-- 增加每日通关层数
+local function addDailyPassLevelNum(human, addNum)
+    if not addNum or addNum <= 0 then
+        return
+    end
+
+    human.db.battle_dailyPassLevelNum = (human.db.battle_dailyPassLevelNum or 0) + addNum
+end
+
+-- 重置每日通关层数
+local function resetDailyPassLevelNum(human)
+    if not human.db.battle_dailyPassLevelNum then
+        return
+    end
+
+    human.db.battle_dailyPassLevelNum = 0
+end
+
+-- 跨天时, 对每日通关层数的处理
+local function dailyPassLevelHandle(human)
+    resetDailyPassLevelNum(human)
+    Battle_DailyPassLevelInfo_Query(human)
+end
+
 ------------------------------------------------多队伍挑战相关------------------------------------
 
 -- 是否开启多队伍挑战
@@ -2918,7 +2947,6 @@ function onFightBegin(human, cbParam, combatType, param)
 end
 
 
-
 -- 挑战当前挂机节点
 function fight(human)
     local battleID = BattleLogic_GetBattleBattleID(human)
@@ -2965,6 +2993,11 @@ function fight(human)
         return Broadcast.sendErr(human, Lang.BATTLE_CHOOSE_ATTR)
     end
 
+    local currentPassLevelNum = getDailyPassLevelNum(human)
+    if currentPassLevelNum >= EliteDefine.BATTLE_DAILY_MAX_PASSLEVEL_NUM then
+        return Broadcast.sendErr(human, Lang.COMMON_DAILY_PASSLEVEL_LIMIT)
+    end
+
 
     local config = tBattleConfig.node[battleID]
     -- local mapConfig = tBattleConfig.map[config.mapID]
@@ -2983,6 +3016,11 @@ function fight(human)
     GuideLogic.setDoSpecialGuide(human, GuideLogic.SKIPTYPE_JUMP_BATTLE)
 end
 
+local function challengeWinHandle(human)
+    addDailyPassLevelNum(human, 1)
+    Battle_DailyPassLevelInfo_Query(human)
+end
+
 function onFightEnd(human, result, fightTypeID, param1, combatInfo)
     -- 设置一些战斗结算信息
     combatInfo.defender.name = Util.format(Lang.COMBAT_BATTLE_DEFEND_NAME, param1)
@@ -3248,6 +3286,8 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
     if nBattleType == EliteDefine.COPY_ELITE_NORMAL then
         TriggerLogic.PublishEvent(TriggerDefine.BATTLE_NORMAL_MODE_PASS, human.db._id, 1)
     end
+
+    challengeWinHandle(human)
 end
 
 function setBattleID(human, guajiID)
@@ -3675,6 +3715,8 @@ function updateDaily(human)
     human.db.mopupFreeCnt = 0
     human.db.mopupDoCnt = 0
     human.db.mopupAddFreeCnt = 0
+
+    dailyPassLevelHandle(human)
 end
 
 function getTongGuanReward(human, id)
@@ -4919,7 +4961,7 @@ end
 
 -----------------------------多队伍--------------------------------------------------------
 -- 请求当前模式当前关卡需要几支队伍
-function QueryLevelTeamCnt(human)
+function Battle_LevelTeamCnt_Query(human)
     local teamCnt = getLevelTeamCnt(human)
     local msgRet = Msg.gc.GC_BATTLE_TEAM_COUNT
     msgRet.teamCnt = teamCnt
@@ -4927,4 +4969,13 @@ function QueryLevelTeamCnt(human)
     Msg.send(msgRet, human.fd)
 end
 
--------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------
+
+-- 每日通关信息查询
+function Battle_DailyPassLevelInfo_Query(human)
+    local msgRet = Msg.gc.GC_BATTLE_DAILY_PASSLVEL_INFO_QUERY
+    msgRet.currentPassLevelNum = getDailyPassLevelNum(human)
+    msgRet.maxPassLevelNum = EliteDefine.BATTLE_DAILY_MAX_PASSLEVEL_NUM
+
+    Msg.send(msgRet, human.fd)
+end

+ 3 - 0
script/module/battle/EliteDefine.lua

@@ -30,6 +30,9 @@ BATTLE_MOPUP_MAX_LEN = 12
 -- 开启多队伍挑战的关卡要求
 OPEN_OTHER_TEAM_LEVEL = 601
 
+-- 三种难度关卡, 每日可通关总层数
+BATTLE_DAILY_MAX_PASSLEVEL_NUM = 100
+
 
 
 

+ 6 - 1
script/module/battle/Handler.lua

@@ -98,6 +98,11 @@ function CG_BATTLE_GETGAMEREWARD(human,msg)
     BattleLogic.GetGameReward(human,msg.indexStr)
 end
 
+-- 每日通关信息查询
+function CG_BATTLE_DAILY_PASSLVEL_INFO_QUERY(human,msg)
+    BattleLogic.Battle_DailyPassLevelInfo_Query(human)
+end
+
 ---------------------------------------------------肉鸽玩法---------------------------------------------------
 function CG_ISNEEDSELECTATTR(human,msg)
     BattleLogic.QueryDiffBattleUnSelectAttr(human)
@@ -122,7 +127,7 @@ end
 
 ------------------------------------------多队伍战斗------------------------------------------
 function CG_BATTLE_TEAM_COUNT(human,msg)
-    BattleLogic.QueryLevelTeamCnt(human)
+    BattleLogic.Battle_LevelTeamCnt_Query(human)
 end
 
 

+ 8 - 0
script/module/battle/Proto.lua

@@ -366,6 +366,14 @@ GC_BATTLE_GETGAMEREWARD = {
 }
 
 
+-- 每日通关信息查询
+CG_BATTLE_DAILY_PASSLVEL_INFO_QUERY = {}
+GC_BATTLE_DAILY_PASSLVEL_INFO_QUERY = {
+	{"currentPassLevelNum",      1,        "short"},  -- 当日已通关数量
+	{"maxPassLevelNum",        	 1,        "short"},  -- 当日最大通关数量
+}
+
+
 
 -------------------------------肉鸽系统-----------------------------------------
 AttrInfo ={

+ 8 - 4
script/module/chengjiu/ChengjiuLogic.lua

@@ -297,6 +297,10 @@ function getReward(human,taskID)
     GuideLogic.setDoSpecialGuide(human, GuideLogic.SKIPTYPE_JUMP_JIEFENG_BAOJU)
     RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2001)
 
+    -- 刷新洗练凤凰..
+    if taskID == 402 then
+        RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2002)
+    end
 
     local giftType
     GiftLogic = GiftLogic or require("topup.GiftLogic")
@@ -377,10 +381,10 @@ function checkTaskState(human)
             human.db.chengjiu.task[k] = CJ_TASK_STATE_1
             RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2001)
             -- 同时刷新秘宝/圣遗物/精灵入口的红点(强制发送,确保可解封时客户端能看到提示)
-            RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2002,true)
-            RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2006, true)
-            RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2021, true)
-            RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2031, true)
+            -- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2002,true)
+            -- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2006, true)
+            -- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2021, true)
+            -- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2031, true)
             local msgRet = Msg.gc.GC_DAILYSHARE_SET
             msgRet.type = 2
             msgRet.desc = v.desc

+ 144 - 25
script/module/drawCard/DrawCardLogic.lua

@@ -77,6 +77,7 @@ DRAWCARD_ID11 = 11    -- 新英雄活动40抽必出
 
 DRAWCARD_OP_1 = 1	-- 召唤1次
 DRAWCARD_OP_2 = 2	-- 召唤10次
+DRAWCARD_OP_3 = 3	-- 召唤100次
 
 DRAWCARD_JIFEN_NEED_VIPLV = 3
 DRAWCARD_JIFEN_SHOW_ITEM = 801005
@@ -299,17 +300,43 @@ function fontDrawCardNet(net, id, human)
         Grid.makeItem(net.items[net.items[0]], config.item2[1], finalItemCnt )
     end
 
+    vipArg = 100
+    itemCnt, finalItemCnt = 0, 0
+    if config.item3[1] and config.item3[2] then
+        if id == DRAWCARD_ID2 then -- 目前只有高抽和精英两种模式有100抽
+            vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER23)
+        end
+
+        net.items[0] = net.items[0] + 1
+        itemCnt = math.floor(config.item3[2] * vipArg / 100 )
+        finalItemCnt = itemCnt
+        if id == DRAWCARD_ID8 then
+            local talisman_jyzh_lotter100 = getTalismanAdd(human)
+            finalItemCnt = math.floor(finalItemCnt * talisman_jyzh_lotter100)
+        end
+        Grid.makeItem(net.items[net.items[0]], config.item3[1], finalItemCnt)
+    end
+
+
     vipArg = 0
     if id == DRAWCARD_ID2 then
         vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER22)
     end
 
-    net.zuanshi[0] = 2
+    net.zuanshi[0] = 3
     net.zuanshi[1] = config.zuanshi1
     net.zuanshi[2] = config.zuanshi2 + vipArg
+    net.zuanshi[3] = config.zuanshi3 or 0
+
+    vipArg = 0
+    if id == DRAWCARD_ID2 and net.zuanshi[3] > 0 then -- 目前只有高抽和精英两种模式有100抽
+        vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER24)
+        net.zuanshi[3] = net.zuanshi[3] + vipArg
+    end
 
     if id == DRAWCARD_ID8 then
         net.zuanshi[2] = math.floor((net.zuanshi[2] / itemCnt) * finalItemCnt)
+        net.zuanshi[3] = math.floor((net.zuanshi[3] / itemCnt) * finalItemCnt)
     end
 
     net.isFirst = (getDraw2Cnt(human, id) < 1) and 1 or 0
@@ -341,6 +368,62 @@ function query(human)
     Msg.send(msgRet, human.fd)
 end
 
+
+local function sendHeroData(human, heroList, items, heroNewList, heroIndexList)
+    heroList = heroList or {}
+    local itemArr = {}
+    for itemId, itemNum in pairs(items or {}) do
+        itemArr[#itemArr+1] = {itemId, itemNum}
+    end
+
+    local len = 0
+    local msgMaxLen = 30
+    local maxLen = math.max(#heroList, #itemArr)
+
+    local msgRet = Msg.gc.GC_DRAWCARD_OP2
+    msgRet.heros[0] = 0
+    msgRet.items[0] = 0
+    msgRet.isEnd = 0
+
+    for i=1, math.max(#heroList, #itemArr) do
+        len = len + 1
+        local heroID = heroList[i]
+        if heroID then
+            msgRet.heros[0] = len
+            local isNew = heroNewList and heroNewList[i]
+            local index = heroIndexList and heroIndexList[i]
+            HeroGrid.makeHeroNice(msgRet.heros[len], heroID, nil, isNew, index, human)
+        end
+
+        local itemInfo = itemArr[i]
+        if itemInfo then
+            msgRet.items[0] = len
+            Grid.makeItem(msgRet.items[len], itemInfo[1], itemInfo[2])
+        end
+
+        if len >= msgMaxLen then
+            maxLen = maxLen - len
+            if maxLen <= 0 then
+                msgRet.isEnd = 1
+                return Msg.send(msgRet, human.fd)
+            end
+
+            Msg.send(msgRet, human.fd)
+
+            len = 0
+            msgRet.heros[0] = len
+            msgRet.items[0] = len
+        end
+    end
+
+    if len > 0 then
+        msgRet.isEnd = 1
+        Msg.send(msgRet, human.fd)
+    end
+end
+
+
+
 -- 抽奖结果
 function sendDrawOp(human, id, op, heroList, items, heroNewList, heroIndexList,isAct)
     local msgRet = Msg.gc.GC_DRAWCARD_OP
@@ -353,23 +436,32 @@ function sendDrawOp(human, id, op, heroList, items, heroNewList, heroIndexList,i
     dataNet.jifen = getJifen(human)
     dataNet.id = id
     dataNet.op = op
-    dataNet.heros[0] = heroList and #heroList or 0
-    for i = 1, dataNet.heros[0] do
-        local heroID = heroList[i]
-        local isNew = heroNewList and heroNewList[i]
-        local index = heroIndexList and heroIndexList[i]
-        HeroGrid.makeHeroNice(dataNet.heros[i], heroID, nil, isNew, index, human)      
-    end
-    dataNet.items[0] = 0
-    if items and type(items) == "table" then
-        for itemID, itemCnt in pairs(items) do
-            dataNet.items[0] = dataNet.items[0] + 1
-            Grid.makeItem(dataNet.items[dataNet.items[0]], itemID, itemCnt)
+    if op == DRAWCARD_OP_3 then
+        dataNet.heros[0] = 0
+        dataNet.items[0] = 0
+    else
+        dataNet.heros[0] = heroList and #heroList or 0
+        for i = 1, dataNet.heros[0] do
+            local heroID = heroList[i]
+            local isNew = heroNewList and heroNewList[i]
+            local index = heroIndexList and heroIndexList[i]
+            HeroGrid.makeHeroNice(dataNet.heros[i], heroID, nil, isNew, index, human)      
+        end
+        dataNet.items[0] = 0
+        if items and type(items) == "table" then
+            for itemID, itemCnt in pairs(items) do
+                dataNet.items[0] = dataNet.items[0] + 1
+                Grid.makeItem(dataNet.items[dataNet.items[0]], itemID, itemCnt)
+            end
         end
     end
 
     fontDrawCardNet(msgRet.drawData, id, human)
     Msg.send(msgRet, human.fd)
+
+    if op == DRAWCARD_OP_3 then
+        sendHeroData(human, heroList, items, heroNewList, heroIndexList)
+    end
 end
 
 -- 积分召唤
@@ -410,8 +502,8 @@ function checkUseItem(human, id, op, config,isAct)
     local itemCnt = item[2]
     local finalItemCnt = itemCnt
 
-    --精英召唤10连抽的处理
-    if id == DRAWCARD_ID8 and op == DRAWCARD_OP_2 then
+    --精英召唤10, 100连抽的处理
+    if id == DRAWCARD_ID8 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) then
         --秘宝对精英召唤10连的增益
         local talisman_jyzh_lotter10 = getTalismanAdd(human)
         finalItemCnt = math.floor(finalItemCnt * talisman_jyzh_lotter10)
@@ -422,9 +514,13 @@ function checkUseItem(human, id, op, config,isAct)
     end
 
 
-    if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 then
+    if id == DRAWCARD_ID2 then
         local vipArg = 100
-        vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER21)
+        if op == DRAWCARD_OP_2 then
+            vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER21)
+        elseif op == DRAWCARD_OP_3 then
+            vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER23)
+        end
         print(" checkUseItem  vipArg   ", vipArg, "  ,   old  :  " ,itemCnt , "  ,  new : ", math.floor(itemCnt * vipArg / 100 ) )
         finalItemCnt = math.floor(itemCnt * vipArg / 100 )
     end 
@@ -485,8 +581,12 @@ function checkUseItem(human, id, op, config,isAct)
         local haveCnt = BagLogic.getItemCnt(human, itemID)
 
         local vipArg = 0
-        if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 then
-            vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER22)
+        if id == DRAWCARD_ID2 then
+            if op == DRAWCARD_OP_2 then
+                vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER22)
+            elseif op == DRAWCARD_OP_3 then
+                vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER24)
+            end
         end
         zuanshi = zuanshi + vipArg
         if haveCnt > 0 then          
@@ -495,7 +595,7 @@ function checkUseItem(human, id, op, config,isAct)
         end       
 
         if not ObjHuman.checkRMB(human, zuanshi) then
-           return 
+           return Broadcast.sendErr(human, Lang.COMMON_NO_ZUANSHI)
         end
         if haveCnt > 0 then
            BagLogic.delItem(human, itemID, haveCnt, "draw_card")
@@ -618,6 +718,8 @@ local function draw(human, id, op, actConfig, skip,isAct)
         heroCnt = 1
     elseif op == DRAWCARD_OP_2 then
         heroCnt = 10
+    elseif op == DRAWCARD_OP_3 then
+        heroCnt = 100
     else
         return
     end
@@ -656,21 +758,36 @@ local function draw(human, id, op, actConfig, skip,isAct)
     local fenjielist = {}
     local heroIDs = nil
 
-    local randomMin = math.random(1, heroCnt)
+    -- local randomMin = math.random(1, heroCnt)
+    local randomMinSet = {}
+    if id == DRAWCARD_ID2 then
+        if op == DRAWCARD_OP_2 then
+            -- 十连:1个保底位置
+            randomMinSet[math.random(1, 10)] = true
+        elseif op == DRAWCARD_OP_3 then
+            -- 百连:分成10组,每组10抽里随机1个保底位置,共10次
+            for group = 0, 9 do
+                local pos = math.random(1, 10) + group * 10
+                randomMinSet[pos] = true
+            end
+        end
+    end
 
     local tag = 0
 
     for i = 1, heroCnt do
         config = DrawCardExcel[id]
         -- if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 and i == randomMin and getDraw2Cnt(human, id) > 3 then
-        if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 and i == randomMin then
+        -- if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and i == randomMin then
+        if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and randomMinSet[i] then
             config = DrawCardExcel[DRAWCARD_ID5]
         elseif id == DRAWCARD_ID2 and op == DRAWCARD_OP_1 then
             config = DrawCardExcel[DRAWCARD_ID6]
         end
 
         
-        if id == DRAWCARD_ID8 and op == DRAWCARD_OP_2 and i == randomMin then
+        -- if id == DRAWCARD_ID8 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and i == randomMin then
+        if id == DRAWCARD_ID8 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and randomMinSet[i] then
             config = DrawCardExcel[DRAWCARD_ID10]
         end
 
@@ -680,7 +797,8 @@ local function draw(human, id, op, actConfig, skip,isAct)
         end
 
         -- 高级召唤前5次10连每轮必出SSR
-        if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 and getDraw2Cnt(human, id) < DRAWCARD_ID2_CNT and i ~= randomMin and tag == 0 then
+        -- if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and getDraw2Cnt(human, id) < DRAWCARD_ID2_CNT and i ~= randomMin and tag == 0 then
+        if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and getDraw2Cnt(human, id) < DRAWCARD_ID2_CNT and not randomMinSet[i] and tag == 0 then
             config = DrawCardExcel[DRAWCARD_ID7]
             tag = 1
         end
@@ -694,7 +812,8 @@ local function draw(human, id, op, actConfig, skip,isAct)
             config = DrawCardExcel[DRAWCARD_ID9]
         end
 
-        local heroID = randHeroID(human, id, op, config, actConfig, i == randomMin, isAct)
+        -- local heroID = randHeroID(human, id, op, config, actConfig, i == randomMin, isAct)
+        local heroID = randHeroID(human, id, op, config, actConfig, randomMinSet[i], isAct)
         local heroConfig = HeroExcel[heroID]
         local star = heroConfig.star
 		local name = heroConfig.name

+ 8 - 2
script/module/drawCard/Proto.lua

@@ -8,7 +8,7 @@ DrawCardNet = {
 	{"leftFreeTime",1,		"int"},	   -- 免费倒计时
 	{"leftFreeCnt",	1,		"int"},	   -- 剩余免费次数
 	{"items",		3,		ItemData}, -- {1次消耗道具,10次消耗道具}
-	{"zuanshi",		3,		"short"},  -- {1次消耗钻石,10次消耗钻石}0为不能用钻石
+	{"zuanshi",		3,		"int"},  -- {1次消耗钻石,10次消耗钻石}0为不能用钻石
 	{"isFirst",		1,		"byte"},   -- 是否首次十连
 	{"canBuy",		1,		"byte"},   -- 可否购买
 }
@@ -27,7 +27,7 @@ GC_DRAWCARD_QUERY = {
 
 CG_DRAWCARD_OP = {
 	{"id",				1,		"byte"}, --1 基础召唤 2 高级召唤 3 友情召唤 0 积分召唤
-	{"op",				1,		"byte"}, --1 1次 2 10次
+	{"op",				1,		"byte"}, --1 1次 2 10次, 3-100次
     {"skip",		    1,		"byte"}, --是否跳过
     {"isAct",           1,      "int"}, --是否选取up活动
 }
@@ -50,6 +50,12 @@ GC_DRAWCARD_OP = {
 	{"nHighCnt",		1,		"int"},		-- 高级抽卡次数
 }
 
+GC_DRAWCARD_OP2 = {
+	{"heros",			30,		HeroNiceNet},	-- 召唤获得英雄
+    {"items",			30,		ItemData}, 		-- 自动分解获得道具
+	{"isEnd",			1,		"byte"},		-- 是否发完, 0-没有, 1-发完
+}
+
 CG_DRAWCARD_SKIP_SET = {
 	{"skip",		    1,		"byte"},   -- 是否跳过
 }

+ 1 - 2
script/module/elf/ElfLogic.lua

@@ -257,8 +257,7 @@ end
 local function updateDot(human, targetQuality)
     local cfgHtbl = generateCfgByQuality(targetQuality)
 
-    -- 如果该品质的精灵存在可激活或可升级的情况,发送红点
-    if dotJudgment(human, cfgHtbl) then
+    if not dotJudgment(human, cfgHtbl) then
         local dotID = 0
         if targetQuality == 1 then
             dotID = RoleSystemDefine.ROLE_SYS_ID_2032

+ 5 - 0
script/module/huanjingTower/Handler.lua

@@ -52,4 +52,9 @@ end
 
 function CG_HUNAGJINGTOWER_ONECLICK_SAPDANG(human, msg)
 	HuanJingTowerLogic.oneClickSaodang(human)
+end
+
+
+function CG_HUNAGJINGTOWER_DAILY_PASSLVEL_INFO_QUERY(human, msg)
+	HuanJingTowerLogic.HuanjingTower_DailyPassLevelInfo_Query(human)
 end

+ 62 - 1
script/module/huanjingTower/HuanjingTowerLogic.lua

@@ -71,6 +71,9 @@ REWARD_STATUS_HADGET = 2 -- 已领
 TOWER_TONGGUAN_TYPE = 1 -- 通关奖励
 TOWER_KING_TYPE = 2 -- 通关王者奖励
 
+-- 每日最多可通关层数
+local MAX_DAILY_PASSLEVEL_NUM = 50
+
 
 --秘宝加成
 local function HJ_GetTalismanAdd(human)
@@ -78,6 +81,41 @@ local function HJ_GetTalismanAdd(human)
 	return dailyFreeTimes
 end
 
+-- 获取每日通关层数
+local function getDailyPassLevelNum(human)
+    local num = 0
+    if human.db.tower and human.db.tower.dailyPassLevelNum then
+        num = human.db.tower.dailyPassLevelNum
+    end
+
+    return num
+end
+
+-- 增加每日通关层数
+local function addDailyPassLevelNum(human, addNum)
+    if not addNum or addNum <= 0 then
+        return
+    end
+
+    human.db.tower = human.db.tower or {}
+    human.db.tower.dailyPassLevelNum = (human.db.tower.dailyPassLevelNum or 0) + addNum
+end
+
+-- 重置每日通关层数
+local function resetDailyPassLevelNum(human)
+    if not human.db.tower or not human.db.tower.dailyPassLevelNum then
+        return
+    end
+
+    human.db.tower.dailyPassLevelNum = 0
+end
+
+-- 跨天时, 对每日通关层数的处理
+local function dailyPassLevelHandle(human)
+    resetDailyPassLevelNum(human)
+    HuanjingTower_DailyPassLevelInfo_Query(human)
+end
+
 
 function initSeverTower(nowLv)
     local towerDB = HuanjingTowerDB.query(#HuanjingTowerExcel.huanjingTower)
@@ -578,6 +616,11 @@ end
 
 -- 挑战
 function fight(human, args)
+    local currentPassLevelNum = getDailyPassLevelNum(human)
+    if currentPassLevelNum >= MAX_DAILY_PASSLEVEL_NUM then
+        return Broadcast.sendErr(human, Lang.COMMON_DAILY_PASSLEVEL_LIMIT)
+    end
+
     local changeLv = tonumber(args[1] or 0)
     if changeLv > #HuanjingTowerExcel.huanjingTower then
         return
@@ -615,6 +658,12 @@ function checkUpdeType(db, combatTime, zhandouli)
     return timeUp, zhanliUp
 end
 
+local function challengeWinHandle(human)
+    addDailyPassLevelNum(human, 1)
+    HuanjingTower_DailyPassLevelInfo_Query(human)
+end
+
+
 -- 挑战结束
 function onFightEnd(human, result, fightTypeID, param, combatInfo, args)
     local rewardItem = combatInfo.rewardItem
@@ -671,7 +720,9 @@ function onFightEnd(human, result, fightTypeID, param, combatInfo, args)
         MengxinLogic.onCallBack(human, MengxinLogic.MX_TASK_TYPE_2, param)
         JibanLogic.onCallback(human, 3, param)
         DailyTaskLogic.recordDailyTaskFinishCnt(human, DailyTaskLogic.DAILY_TASK_ID_5, 1)
-        YunYingLogic.onCallBack(human, "onHuangjingTower",1)   
+        YunYingLogic.onCallBack(human, "onHuangjingTower",1)
+
+        challengeWinHandle(human)
     end
     LiLianLogic.onCallbackByCombat(human, combatInfo)
     RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1203)
@@ -794,6 +845,14 @@ function buyTiliDo(human, buyCnt)
     --	query(human)
 end
 
+-- 每日通关信息查询
+function HuanjingTower_DailyPassLevelInfo_Query(human)
+    local msgRet = Msg.gc.GC_HUNAGJINGTOWER_DAILY_PASSLVEL_INFO_QUERY
+    msgRet.currentPassLevelNum = getDailyPassLevelNum(human)
+    msgRet.maxPassLevelNum = MAX_DAILY_PASSLEVEL_NUM
+    Msg.send(msgRet, human.fd)
+end
+
 -- 挑战结果
 function updateResult(human, result, combatInfo, param)
     -- 当前胜利关卡已通关
@@ -845,6 +904,8 @@ function updateDaily(human)
         human.db.tower.buyCnt = 0
         RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1203)
         RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1201)
+
+        dailyPassLevelHandle(human)
     end
 end
 

+ 9 - 1
script/module/huanjingTower/Proto.lua

@@ -144,4 +144,12 @@ GC_HUANGJINGTOWER_LV_ALLHUMAN = {
 }
 
 -- 一键扫荡
-CG_HUNAGJINGTOWER_ONECLICK_SAPDANG = {}
+CG_HUNAGJINGTOWER_ONECLICK_SAPDANG = {}
+
+
+-- 每日挑战信息查询
+CG_HUNAGJINGTOWER_DAILY_PASSLVEL_INFO_QUERY = {}
+GC_HUNAGJINGTOWER_DAILY_PASSLVEL_INFO_QUERY = {
+	{"currentPassLevelNum",      1,        "short"},  -- 当日已通关数量
+	{"maxPassLevelNum",        	 1,        "short"},  -- 当日最大通关数量
+}

+ 22 - 1
script/module/lostTemple/lostTempleLogic.lua

@@ -46,6 +46,13 @@ DAY_1s = 86400
 --跳过战斗需要的战力
 local SHOWQUICKPOWER = 0 --2000000
 
+local function resetDB(human)
+    local query = { _id = human.db._id }
+    LuaMongo.remove(DB.db_lost_temple, query)
+end
+
+
+
 function initAfterHot()
 
 end
@@ -113,7 +120,7 @@ function onZero()
     -- LuaMongo.remove(DB.db_lost_temple)
 
     -- 修改: 延迟60s再清除数据
-    Timer.addLater(60, LuaMongo.remove, DB.db_lost_temple)
+    -- Timer.addLater(60, LuaMongo.remove, DB.db_lost_temple)
 
     -- 已经关闭
     -- if (openDay - 7 + 1) % 2 ~= 0 then
@@ -127,6 +134,8 @@ function updateDaily(human)
         return
     end
 
+    resetDB(human)
+
     print("[lostTempleLogic - updateDaily] 天数刷新 玩家移除lostTemple数据 name = "..human.db.name)
     human.lostTemple = nil
     
@@ -1340,6 +1349,10 @@ end
 
 -- 查询一键扫荡状态
 function LostTemple_OneClickSweep_Query(human)
+    if not isOpen(human) then
+        return Broadcast.sendErr(human, Lang.COMMOM_NOT_ENABLED)
+    end
+
     local msgRet = Msg.gc.GC_LOGT_TEMPLE_ONECLICK_SWEEP_QUERY
     msgRet.state = 0
 
@@ -1357,6 +1370,9 @@ end
 
 -- 查询一键扫荡奖励
 function LostTemple_OneClickSweep_Award(human)
+    if not isOpen(human) then
+        return Broadcast.sendErr(human, Lang.COMMOM_NOT_ENABLED)
+    end
     local msgRet = Msg.gc.GC_LOGT_TEMPLE_ONECLICK_SWEEP_AWARD
     msgRet.awardArr[0] = 0
 
@@ -1372,6 +1388,9 @@ end
 
 -- 进行一键扫荡
 function LostTemple_OneClickSweep_Do(human)
+    if not isOpen(human) then
+        return Broadcast.sendErr(human, Lang.COMMOM_NOT_ENABLED)
+    end
     local isBuyKing = HeroGrowUp.isBuyKing(human)
     if not isBuyKing or isBuyKing ~= 1 then
         return Broadcast.sendErr(human, Lang.LOST_NO_BUY)
@@ -1411,6 +1430,8 @@ function LostTemple_OneClickSweep_Do(human)
 
     YunYingLogic.onCallBack(human, "lostTempleCombat", 1)
 
+    TriggerLogic.PublishEvent(TriggerDefine.LOSTTEMPLE_PASS_LAYER, human.db._id, 3)
+
     LostTemple_OneClickSweep_Query(human)
 
     RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1208)

+ 136 - 30
script/module/mail/MailManager.lua

@@ -9,6 +9,7 @@ local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
 local RoleSystemDefine = require("roleSystem.RoleSystemDefine") 
 local RoleDBLogic = require("role.RoleDBLogic")
 local MailExcel = require("excel.mail")
+local CommonDB = require("common.CommonDB")
 
 SYSTEM = 1 				-- 系统邮件
 GONGGAO = 2 				-- 公告
@@ -75,7 +76,8 @@ function add(type,receiverUuid,title,content,items,senderName,sender,time,fbTime
         mail.flag = 1
     end
 	LuaMongo.insert(DB.db_mail, mail)
-	RoleSystemLogic.onDotByUuid(receiverUuid, RoleSystemDefine.ROLE_SYS_ID_204)
+	-- 检测红点会调用getMails(), 短时间插入多封邮件加上玩家邮件数量过多,会发生段错误
+	-- RoleSystemLogic.onDotByUuid(receiverUuid, RoleSystemDefine.ROLE_SYS_ID_204)
 	return mail
 
 end
@@ -156,45 +158,149 @@ local function cmpMail(a, b)
 end
 
 local mails = {}
-function getMails(receiverUuid,mailType)
-	for key in ipairs(mails) do 
-		mails[key] = nil
-	end
+-- function getMails(receiverUuid,mailType)
+-- 	for key in ipairs(mails) do 
+-- 		mails[key] = nil
+-- 	end
+
+-- 	FIELD_RECEIVER.receiverUuid = receiverUuid
+-- 	FIELD_RECEIVER.type = mailType
+
+--     LuaMongo.find(DB.db_mail,{["$query"]=FIELD_RECEIVER})
+    
+-- 	local lastTime = os.time() - 7 * 86400
+--     local mailCnt = 0
+-- 	while true do
+-- 		local mail = {}
+-- 		-- if not LuaMongo.next(mail) then
+-- 		-- 	break
+-- 		-- end
 
-	FIELD_RECEIVER.receiverUuid = receiverUuid
-	FIELD_RECEIVER.type = mailType
+-- 		local res, err = pcall(function ()
+-- 			return LuaMongo.next(mail)
+-- 		end)
 
-    LuaMongo.find(DB.db_mail,{["$query"]=FIELD_RECEIVER})
+-- 		if not res then
+-- 			Log.write(Log.LOGID_DEBUG, "MailManager.getMails err = ".. err)
+-- 			break
+-- 		end
+
+-- 		if not err then
+-- 			break
+-- 		end
+
+--        if mail.expireTime then  -- 有指定过期时间
+--             if mail.time > os.time() - mail.expireTime then
+-- 			    mailCnt = mailCnt + 1
+-- 			    mails[mailCnt] = mail
+--             end
+--        elseif mail.time > lastTime then -- 没有就用默认过期时间
+--             mailCnt = mailCnt + 1
+-- 			mails[mailCnt] = mail
+--        end
+-- 	end
     
-	local lastTime = os.time() - 7 * 86400
+--     if mailCnt > MAIL_MAX_CNT then
+-- 		table.sort(mails, cmpMail)
+-- 		for i = MAIL_MAX_CNT + 1, mailCnt do
+-- 			mails[i] = nil
+-- 		end
+-- 	end    
+-- 	return mails
+-- end
+
+-- 替换原有的 getMails 函数
+function getMails(receiverUuid, mailType)
+    -- 1. 清空缓存表
+    for i = 1, #mails do mails[i] = nil end
+
+    local now = os.time()
     local mailCnt = 0
-	while true do
-		local mail = {}
-		if not LuaMongo.next(mail) then
-			break
-		end
+    local tempMails = {}
+    local SCAN_LIMIT = 2000  -- 单次分段查询安全上限
+    local foundEnough = false
+
+    -- 2.将时间划分为多个小窗口,避免单次 find 触发底层 OOM
+    -- 窗口设计:最近7天 -> 7~14天 -> 14~30天 -> 30~60天
+    local timeWindows = {
+        {now - 7*86400,   now},
+        {now - 14*86400,  now - 7*86400},
+        {now - 30*86400,  now - 14*86400},
+        {now - 60*86400,  now - 30*86400}
+    }
+	-- 60天 -> 开服
+	local serverOpenTime = CommonDB.getServerOpenTime()
+	timeWindows[#timeWindows+1] = { serverOpenTime, now - 60*86400 }
+
+    for _, window in ipairs(timeWindows) do
+        if foundEnough then break end
+
+        -- 使用最简平铺查询,彻底避开 C 扩展解析缺陷
+        local query = {
+            receiverUuid = receiverUuid,
+            type = mailType,
+            time = { ["$gte"] = window[1], ["$lte"] = window[2] }
+        }
 
-       if mail.expireTime then  -- 有指定过期时间
-            if mail.time > os.time() - mail.expireTime then
-			    mailCnt = mailCnt + 1
-			    mails[mailCnt] = mail
+        LuaMongo.find(DB.db_mail, query)
+
+        local mail = {}
+        local scanCnt = 0
+        while true do
+            local has_next = LuaMongo.next(mail)
+            if not has_next then break end
+            
+            scanCnt = scanCnt + 1
+            if scanCnt > SCAN_LIMIT then 
+                Log.write(Log.LOGID_DEBUG, string.format("Mail segment limit hit! uuid=%s window=%d~%d", 
+                    receiverUuid, window[1], window[2]))
+                break 
             end
-       elseif mail.time > lastTime then -- 没有就用默认过期时间
+
+            -- 浅拷贝隔离 C 驱动内部 Buffer
+            local m = {}
+            for k, v in pairs(mail) do m[k] = v end
+            tempMails[#tempMails + 1] = m
+
+            -- 清空复用表
+            for k in pairs(mail) do mail[k] = nil end
+        end
+
+        -- 如果已收集足够多数据(留足过滤冗余),提前终止后续窗口查询
+        if #tempMails >= 500 then 
+            foundEnough = true 
+            break 
+        end
+    end
+
+    -- 3.按时间倒序排序,确保后续取到的是“最新”的
+    table.sort(tempMails, cmpMail)
+
+    -- 4. 过滤过期邮件,精准截取最新 100 条
+    for _, m in ipairs(tempMails) do
+        if type(m.time) ~= "number" then m.time = 0 end
+
+        local isExpired = false
+        local expireTime = m.expireTime
+        if expireTime and type(expireTime) == "number" then
+            if m.time <= now - expireTime then isExpired = true end
+        elseif m.time <= now - 7 * 86400 then
+            isExpired = true
+        end
+
+        if not isExpired then
             mailCnt = mailCnt + 1
-			mails[mailCnt] = mail
-       end
-	end
-    
-    if mailCnt > MAIL_MAX_CNT then
-		table.sort(mails, cmpMail)
-		for i = MAIL_MAX_CNT + 1, mailCnt do
-			mails[i] = nil
-		end
-	end    
-	return mails
+            mails[mailCnt] = m
+            if mailCnt >= MAIL_MAX_CNT then break end -- 达到 100 条立即退出
+        end
+    end
+
+    return mails
 end
 
 
+
+
 function saveMail(mail)
     FIELD_ID._id = mail._id
     LuaMongo.update(DB.db_mail, FIELD_ID, mail)

+ 3 - 1
script/module/role/RoleAttr.lua

@@ -47,6 +47,7 @@ local HeroSeed = require("hero.HeroSeed")
 local ElfLogic = require("elf.ElfLogic")
 local HeroTianYuan = require("hero.HeroTianYuan")
 local HeroArtifacts = require("hero.HeroArtifacts")
+local RecycleItem = require("bag.RecycleItem")
 
 
 local function printAttr(attr, szText)
@@ -186,7 +187,8 @@ function calcHeroGrid(heroGrid, index, human)
 	ElfLogic.doCalcHero(human, HERO_OTHER_ATTRS) --精灵系统
 	HeroTianYuan.doCalcHero(human, heroGrid, HERO_OTHER_ATTRS) -- 英雄天元
 	HeroArtifacts.doCalcHero(human, heroGrid, HERO_OTHER_ATTRS) -- 英雄神威灵装
-
+	RecycleItem.doCalcHero(human, HERO_OTHER_ATTRS) -- 收纳箱
+	
 	--不同模块在英雄属性计算 end	
 	
 	-- 计算评分

+ 2 - 2
script/module/serverCommerce/ServerCommerceActDefine.lua

@@ -9,8 +9,8 @@ COMMERCEACT_BEGINTIME = 0               -- 开启时间
 COMMERCEACT_ENDTIME = 23                -- 结束时间
 COMMERCEACT_LASTDAY = 7                 -- 持续时间
 COMMERCEACT_BEGINDELATTIME = 10 * 60    -- 延迟10分钟开始
-COMMERCEACT_INITSERVERTIME =4 * 60     -- 普通服 起服3分钟请求活动是否开始
-COMMERCEACT_INITOPENDAY = 3 * 60        -- 中心服2分钟后请求普通服开服时间
+COMMERCEACT_INITSERVERTIME = 10 * 60 --4 * 60     -- 普通服 起服3分钟请求活动是否开始
+COMMERCEACT_INITOPENDAY = 9 * 60 -- 3 * 60        -- 中心服2分钟后请求普通服开服时间
 COMMERCEACT_RANKUPDATE = 150            -- 普通服 5 分钟请求排行榜数据
 COMMERCEACT_ENDBATCH = 3                -- 结束批次
 

+ 3 - 0
script/module/vip/VipLogic.lua

@@ -45,6 +45,9 @@ VIP_POWER19 = 19	-- o
 -- VIP_POWER20 = 21	-- o激活专属背景
 VIP_POWER21 = 21	-- o抽卡 卷轴折扣特权
 VIP_POWER22 = 22    -- o抽卡 钻石特权
+
+VIP_POWER23 = 23	-- 100抽卡 卷轴折扣特权
+VIP_POWER24 = 24    -- 100抽卡 钻石特权
 -- 礼包状态
 local LIBAO_STATE_CANT = 0 		-- 不可购买
 local LIBAO_STATE_CAN = 1 		-- 可购买