Commit 5d71c3a54eb4efade8c3d5dbc4e8df97860071f9
Merge branch 'tr/bugfix' into tr/bugfix-qa
* tr/bugfix: 计算英雄战斗力,天赋,信赖 错误的 多队挂机 电台任务英雄也不能重用 冒险次数 取消特权卡餐厅加速获得额外道具功能 铭文属性问题 返还bug 切换拆解术式bug,造成获得巨大数量的物品 or global email 添加新的延時類型郵件 发送邮件清标记 活动卡池回馈数量丢失Bug 手抽英雄只奖励一个 奖励内容错误 # Conflicts: # src/csvdata
Showing
12 changed files
with
97 additions
and
57 deletions
Show diff stats
src/actions/AdvAction.lua
| @@ -57,6 +57,15 @@ local function checkFormat(role, format, checkAdvTeam) | @@ -57,6 +57,15 @@ local function checkFormat(role, format, checkAdvTeam) | ||
| 57 | end | 57 | end |
| 58 | end | 58 | end |
| 59 | 59 | ||
| 60 | + -- 多队挂机 电台任务英雄也不能重用 | ||
| 61 | + local radioTask = role:getProperty("radioTask") | ||
| 62 | + for id, taskInfo in pairs(radioTask) do | ||
| 63 | + local heros = taskInfo["heros"] or {} | ||
| 64 | + for _, heroId in ipairs(heros) do | ||
| 65 | + hadHero[heroId] = true | ||
| 66 | + end | ||
| 67 | + end | ||
| 68 | + | ||
| 60 | if not format.leader then return end | 69 | if not format.leader then return end |
| 61 | if format.leader2 == format.leader then return end | 70 | if format.leader2 == format.leader then return end |
| 62 | local hadLeader = false | 71 | local hadLeader = false |
| @@ -102,6 +111,8 @@ function _M.startAdvRpc( agent, data ) | @@ -102,6 +111,8 @@ function _M.startAdvRpc( agent, data ) | ||
| 102 | 111 | ||
| 103 | local advPass = role:getProperty("advPass") | 112 | local advPass = role:getProperty("advPass") |
| 104 | 113 | ||
| 114 | + if not checkFormat(role) then return 7 end | ||
| 115 | + | ||
| 105 | if AdvCommon.isEndless(chapterId) then -- 无尽模式判断 | 116 | if AdvCommon.isEndless(chapterId) then -- 无尽模式判断 |
| 106 | 117 | ||
| 107 | if chapterId ~= role.advElChapter then return end -- 不是当前进行的章节 | 118 | if chapterId ~= role.advElChapter then return end -- 不是当前进行的章节 |
| @@ -118,37 +129,23 @@ function _M.startAdvRpc( agent, data ) | @@ -118,37 +129,23 @@ function _M.startAdvRpc( agent, data ) | ||
| 118 | if not relayData then return 14 end -- 不是中继层 | 129 | if not relayData then return 14 end -- 不是中继层 |
| 119 | if advElM < relayData.unlockfloor then return 15 end --未解锁 | 130 | if advElM < relayData.unlockfloor then return 15 end --未解锁 |
| 120 | end | 131 | end |
| 132 | + | ||
| 133 | + role.dailyData:updateProperty({field = "advElC", delta = 1}) | ||
| 121 | else -- 普通模式判断 | 134 | else -- 普通模式判断 |
| 122 | - if not role:checkAdvCount(chapterData.limitlevel) then return 2 end -- 是否有体力 | ||
| 123 | if layer >= chapterData.limitlevel then return 4 end | 135 | if layer >= chapterData.limitlevel then return 4 end |
| 124 | - -- 关卡开放判断 | ||
| 125 | - if not role:advChapterIsOpen(chapterId) then return 5 end | ||
| 126 | 136 | ||
| 137 | + local relayData = role:getAdvData():isHaveRelay(layer, chapterId, true) | ||
| 138 | + if not relayData then return 6 end -- 不是中继层 | ||
| 127 | if layer ~= 1 then | 139 | if layer ~= 1 then |
| 128 | - local relayData = role:getAdvData():isHaveRelay(layer, chapterId) | ||
| 129 | - if not relayData then return 6 end -- 不是中继层 | ||
| 130 | if (advPass[chapterId] or 0) < relayData.floor then return 21 end | 140 | if (advPass[chapterId] or 0) < relayData.floor then return 21 end |
| 131 | end | 141 | end |
| 132 | - end | ||
| 133 | - | ||
| 134 | - if not checkFormat(role) then return 7 end | ||
| 135 | - | ||
| 136 | - --local advTeam = role:getProperty("advTeam") | ||
| 137 | - --table.clear(advTeam) | 142 | + if not role:checkAdvCount(relayData.supply) then return 2 end -- 是否有体力 |
| 143 | + -- 关卡开放判断 | ||
| 144 | + if not role:advChapterIsOpen(chapterId) then return 5 end | ||
| 138 | 145 | ||
| 139 | - --advTeam.heros = {} | ||
| 140 | - --for slot, heroId in pairs(format.heros) do | ||
| 141 | - -- advTeam.heros[slot] = heroId | ||
| 142 | - --end | ||
| 143 | - --advTeam.leader = format.leader | ||
| 144 | - --advTeam.leader2 = format.leader2 | ||
| 145 | - --role:updateProperty({field = "advTeam", value = advTeam}) | ||
| 146 | - if AdvCommon.isEndless(chapterId) then | ||
| 147 | - role.dailyData:updateProperty({field = "advElC", delta = 1}) | ||
| 148 | - else | ||
| 149 | - role:changeAdvCount(chapterData.limitlevel) | 146 | + role:changeAdvCount(relayData.supply) |
| 150 | end | 147 | end |
| 151 | - | 148 | + |
| 152 | local support = {} -- 支援效果 | 149 | local support = {} -- 支援效果 |
| 153 | if AdvCommon.isEndless(chapterId) then | 150 | if AdvCommon.isEndless(chapterId) then |
| 154 | -- 选择的支援效果 | 151 | -- 选择的支援效果 |
| @@ -168,6 +165,7 @@ function _M.startAdvRpc( agent, data ) | @@ -168,6 +165,7 @@ function _M.startAdvRpc( agent, data ) | ||
| 168 | end | 165 | end |
| 169 | end | 166 | end |
| 170 | end | 167 | end |
| 168 | + | ||
| 171 | role:getAdvData():initByChapter({ | 169 | role:getAdvData():initByChapter({ |
| 172 | chapterId = chapterId, | 170 | chapterId = chapterId, |
| 173 | level = layer, | 171 | level = layer, |
| @@ -175,6 +173,7 @@ function _M.startAdvRpc( agent, data ) | @@ -175,6 +173,7 @@ function _M.startAdvRpc( agent, data ) | ||
| 175 | isEnter = true, | 173 | isEnter = true, |
| 176 | support = support, | 174 | support = support, |
| 177 | }) | 175 | }) |
| 176 | + | ||
| 178 | role:checkTaskEnter("AdvStart", {id = chapterId}) | 177 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
| 179 | role:checkTaskEnter("AdvStartSelf", {id = chapterId}) | 178 | role:checkTaskEnter("AdvStartSelf", {id = chapterId}) |
| 180 | role:getAdvData():popBackEvents() -- 清一下事件 | 179 | role:getAdvData():popBackEvents() -- 清一下事件 |
| @@ -236,7 +235,8 @@ function _M.startHangRpc(agent, data) | @@ -236,7 +235,8 @@ function _M.startHangRpc(agent, data) | ||
| 236 | + 0.226 * player["hit"] | 235 | + 0.226 * player["hit"] |
| 237 | + 0.26 * player["miss"] | 236 | + 0.26 * player["miss"] |
| 238 | 237 | ||
| 239 | - if battleV < campSiteData.idleValue then return 9 end -- 战斗力是否满足 | 238 | + --print(math.ceil(battleV), campSiteData.idleValue) |
| 239 | + if math.ceil(battleV) < campSiteData.idleValue then return 9 end -- 战斗力是否满足 | ||
| 240 | 240 | ||
| 241 | local info = {} | 241 | local info = {} |
| 242 | info.format = {} | 242 | info.format = {} |
src/actions/DinerAction.lua
| @@ -305,7 +305,7 @@ function _M.expediteSellRpc( agent, data ) | @@ -305,7 +305,7 @@ function _M.expediteSellRpc( agent, data ) | ||
| 305 | local gift = reward:toNumMap() | 305 | local gift = reward:toNumMap() |
| 306 | 306 | ||
| 307 | -- 特权卡获取加速获得额外道具 | 307 | -- 特权卡获取加速获得额外道具 |
| 308 | - local coef = role.storeData:getProduceItemSpeedCoef() | 308 | + local coef = 1 --role.storeData:getProduceItemSpeedCoef() |
| 309 | for k, v in pairs(gift) do | 309 | for k, v in pairs(gift) do |
| 310 | if coef > 1 then | 310 | if coef > 1 then |
| 311 | v = math.floor(v * coef) | 311 | v = math.floor(v * coef) |
src/actions/EmailAction.lua
| @@ -40,10 +40,17 @@ function _M.listRpc(agent, data) | @@ -40,10 +40,17 @@ function _M.listRpc(agent, data) | ||
| 40 | local count = 1 | 40 | local count = 1 |
| 41 | for _, data in ipairs(result) do | 41 | for _, data in ipairs(result) do |
| 42 | local email = tarr2tab(data) | 42 | local email = tarr2tab(data) |
| 43 | - if tonum(email.createtime) > role:getProperty("ctime") | ||
| 44 | - and ( not email.mid or tonum(email.mid) == mid ) | 43 | + -- 0 需要判斷創角時間小於郵件創建時間 1 只需要在時間段內登陸即可領取 |
| 44 | + local delayType = tonum(email.delayType) | ||
| 45 | + local flag = false | ||
| 46 | + if delayType == 1 then | ||
| 47 | + flag = skynet.timex() > tonum(email.createtime) | ||
| 48 | + else | ||
| 49 | + flag = tonum(email.createtime) > role:getProperty("ctime") | ||
| 50 | + end | ||
| 51 | + if flag and ( not email.mid or tonum(email.mid) == mid ) | ||
| 45 | and ( not email.endtime or tonum(email.endtime) > now )then | 52 | and ( not email.endtime or tonum(email.endtime) > now )then |
| 46 | - local time = math.max(tonum(email.timestamp, 0) or email.createtime) | 53 | + local time = math.max(tonum(email.timestamp, 0) , tonum(email.createtime)) |
| 47 | redisproxy:insertEmail({ | 54 | redisproxy:insertEmail({ |
| 48 | roleId = roleId, | 55 | roleId = roleId, |
| 49 | emailId = 0, | 56 | emailId = 0, |
src/actions/HeroAction.lua
| @@ -663,7 +663,8 @@ function _M.getResetRewardRpc(agent, data) | @@ -663,7 +663,8 @@ function _M.getResetRewardRpc(agent, data) | ||
| 663 | 663 | ||
| 664 | while stage > 0 do | 664 | while stage > 0 do |
| 665 | local curData = csvdb["unit_talent_"..heroCfgId.."Csv"][stage] | 665 | local curData = csvdb["unit_talent_"..heroCfgId.."Csv"][stage] |
| 666 | - for lvl = 1, curTalentLvl - 1 do | 666 | + local offset = stage == talent:getv(0,1) and curTalentLvl - 1 or #curData |
| 667 | + for lvl = 1, offset do | ||
| 667 | local talentData = curData[lvl] | 668 | local talentData = curData[lvl] |
| 668 | for itemId, count in pairs(talentData.money:toNumMap()) do | 669 | for itemId, count in pairs(talentData.money:toNumMap()) do |
| 669 | reward[itemId] = (reward[itemId] or 0) + count | 670 | reward[itemId] = (reward[itemId] or 0) + count |
| @@ -926,6 +927,7 @@ function _M.drawHeroRpc(agent, data) | @@ -926,6 +927,7 @@ function _M.drawHeroRpc(agent, data) | ||
| 926 | local itemId = math.randWeight(resultPool, 1) | 927 | local itemId = math.randWeight(resultPool, 1) |
| 927 | if guideHero then | 928 | if guideHero then |
| 928 | itemId = guideHero | 929 | itemId = guideHero |
| 930 | + guideHero = nil | ||
| 929 | end | 931 | end |
| 930 | 932 | ||
| 931 | local itemData = csvdb["itemCsv"][itemId] | 933 | local itemData = csvdb["itemCsv"][itemId] |
src/actions/RoleAction.lua
| @@ -586,9 +586,9 @@ function _M.openTimeBoxRpc(agent, data) | @@ -586,9 +586,9 @@ function _M.openTimeBoxRpc(agent, data) | ||
| 586 | else | 586 | else |
| 587 | local oldId, process, time = boxL[slot].id, boxL[slot].process, boxL[slot].time | 587 | local oldId, process, time = boxL[slot].id, boxL[slot].process, boxL[slot].time |
| 588 | local unitTime = globalCsv.box_key_time[oldId] * 60 | 588 | local unitTime = globalCsv.box_key_time[oldId] * 60 |
| 589 | - local doneCnt = math.floor((process + skynet.timex() - time) / unitTime) | 589 | + local doneCnt = time == 0 and 0 or math.floor((process + skynet.timex() - time) / unitTime) |
| 590 | if doneCnt > 0 then | 590 | if doneCnt > 0 then |
| 591 | - reward = role:award({[oldId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot}}) | 591 | + reward = role:award({[oldId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) |
| 592 | end | 592 | end |
| 593 | end | 593 | end |
| 594 | local limit = globalCsv.box_key_max[itemId] or 5 | 594 | local limit = globalCsv.box_key_max[itemId] or 5 |
| @@ -610,7 +610,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -610,7 +610,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
| 610 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") | 610 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") |
| 611 | local costKey = math.ceil((stopTime - nowTime) / (cost_pre[1] * 60)) * cost_pre[2] | 611 | local costKey = math.ceil((stopTime - nowTime) / (cost_pre[1] * 60)) * cost_pre[2] |
| 612 | if not role:checkItemEnough({[ItemId.Diamond] = costKey}) then return 5 end | 612 | if not role:checkItemEnough({[ItemId.Diamond] = costKey}) then return 5 end |
| 613 | - role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot}}) | 613 | + role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) |
| 614 | else | 614 | else |
| 615 | stopTime = math.min(nowTime,time + globalCsv.box_productLine_time * 3600) | 615 | stopTime = math.min(nowTime,time + globalCsv.box_productLine_time * 3600) |
| 616 | end | 616 | end |
| @@ -618,7 +618,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -618,7 +618,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
| 618 | 618 | ||
| 619 | local doneCnt = math.floor((process + stopTime - time) / unitTime) | 619 | local doneCnt = math.floor((process + stopTime - time) / unitTime) |
| 620 | if doneCnt > 0 then | 620 | if doneCnt > 0 then |
| 621 | - reward = role:award({[itemId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot}}) | 621 | + reward = role:award({[itemId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) |
| 622 | end | 622 | end |
| 623 | if role:getItemCount(itemId) >= globalCsv.box_key_max[itemId] then | 623 | if role:getItemCount(itemId) >= globalCsv.box_key_max[itemId] then |
| 624 | nowTime = 0 | 624 | nowTime = 0 |
| @@ -687,7 +687,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -687,7 +687,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
| 687 | reward[id] = (reward[id] or 0) + num | 687 | reward[id] = (reward[id] or 0) + num |
| 688 | end | 688 | end |
| 689 | end | 689 | end |
| 690 | - reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = costId}}) | 690 | + reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = costId, int2 = oper}}) |
| 691 | else | 691 | else |
| 692 | return | 692 | return |
| 693 | end | 693 | end |
src/adv/Adv.lua
| @@ -61,10 +61,10 @@ function Adv:initByInfo(advInfo) | @@ -61,10 +61,10 @@ function Adv:initByInfo(advInfo) | ||
| 61 | self:initBattle(advInfo) | 61 | self:initBattle(advInfo) |
| 62 | end | 62 | end |
| 63 | -- 找出level 是否存在中继层 | 63 | -- 找出level 是否存在中继层 |
| 64 | -function Adv:isHaveRelay(level, chapterId) | 64 | +function Adv:isHaveRelay(level, chapterId, force) |
| 65 | level = level or self.level | 65 | level = level or self.level |
| 66 | chapterId = chapterId or self.chapterId | 66 | chapterId = chapterId or self.chapterId |
| 67 | - if level == 1 then return end | 67 | + if level == 1 and not force then return end |
| 68 | 68 | ||
| 69 | local campsiteCsv = csvdb["adv_chapter_campsiteCsv"][chapterId] | 69 | local campsiteCsv = csvdb["adv_chapter_campsiteCsv"][chapterId] |
| 70 | for _, campsite in ipairs(campsiteCsv) do | 70 | for _, campsite in ipairs(campsiteCsv) do |
src/models/Activity.lua
| @@ -709,7 +709,7 @@ function Activity:recycleActItem(actId) | @@ -709,7 +709,7 @@ function Activity:recycleActItem(actId) | ||
| 709 | local itemCount = role:getItemCount(fromId) | 709 | local itemCount = role:getItemCount(fromId) |
| 710 | if itemCount > 0 then | 710 | if itemCount > 0 then |
| 711 | costs[fromId] = (costs[fromId] or 0) + itemCount | 711 | costs[fromId] = (costs[fromId] or 0) + itemCount |
| 712 | - gift[toId] = toNum * itemCount | 712 | + gift[toId] = (gift[toId] or 0) + toNum * itemCount |
| 713 | end | 713 | end |
| 714 | end | 714 | end |
| 715 | if next(costs) then | 715 | if next(costs) then |
src/models/HeroPlugin.lua
| @@ -53,22 +53,25 @@ function HeroPlugin.bind(Hero) | @@ -53,22 +53,25 @@ function HeroPlugin.bind(Hero) | ||
| 53 | local talentAttrS = {} | 53 | local talentAttrS = {} |
| 54 | 54 | ||
| 55 | -- 四个基础属性 | 55 | -- 四个基础属性 |
| 56 | - local curData = csvdb["unit_talentCsv"][talent:getv(0, 1)] | ||
| 57 | - local curTalentLvl = 0 | ||
| 58 | - if not curData then -- 已经满阶段了 | ||
| 59 | - local cfgName = "unit_talent_"..heroCfgId.."Csv" | ||
| 60 | - curData = csvdb[cfgName][#csvdb[cfgName]] | ||
| 61 | - else | ||
| 62 | - curTalentLvl = talent:getv(1, 1) | ||
| 63 | - end | ||
| 64 | - for lvl, cfg in pairs(curData) do | ||
| 65 | - if lvl < curTalentLvl or curTalentLvl == 0 then | ||
| 66 | - if cfg.effect ~= 99 then | ||
| 67 | - local curVal = talentAttrS[cfg.effect] or 0 | ||
| 68 | - if curVal < cfg.strength then | ||
| 69 | - talentAttrS[cfg.effect] = cfg.strength | 56 | + local cfgName = "unit_talent_"..heroCfgId.."Csv" |
| 57 | + local curRank = talent:getv(0, 1) | ||
| 58 | + local curLv = talent:getv(1,1) - 1 | ||
| 59 | + for i, value in ipairs(csvdb[cfgName]) do | ||
| 60 | + if i <= curRank then | ||
| 61 | + for lv, cfg in ipairs(value) do | ||
| 62 | + if i < curRank or lv <= curLv then | ||
| 63 | + if cfg.effect ~= 99 then | ||
| 64 | + if not talentAttrS[cfg.effect] then | ||
| 65 | + talentAttrS[AttsEnumEx[cfg.effect]] = 0 | ||
| 66 | + end | ||
| 67 | + talentAttrS[AttsEnumEx[cfg.effect]] = cfg.strength | ||
| 68 | + end | ||
| 69 | + else | ||
| 70 | + break | ||
| 70 | end | 71 | end |
| 71 | end | 72 | end |
| 73 | + else | ||
| 74 | + break | ||
| 72 | end | 75 | end |
| 73 | end | 76 | end |
| 74 | 77 | ||
| @@ -85,7 +88,7 @@ function HeroPlugin.bind(Hero) | @@ -85,7 +88,7 @@ function HeroPlugin.bind(Hero) | ||
| 85 | for lvl = 1, #faithConfig do | 88 | for lvl = 1, #faithConfig do |
| 86 | if faith >= faithConfig[lvl].exp then | 89 | if faith >= faithConfig[lvl].exp then |
| 87 | local add = faithConfig[lvl]["position_"..unitData.position]:toArray(true, "=") | 90 | local add = faithConfig[lvl]["position_"..unitData.position]:toArray(true, "=") |
| 88 | - faithAttr[add[1]] = (faithAttr[add[1]] or 0) + add[2] | 91 | + faithAttr[AttsEnumEx[add[1]]] = (faithAttr[AttsEnumEx[add[1]]] or 0) + add[2] |
| 89 | end | 92 | end |
| 90 | end | 93 | end |
| 91 | for _, attrName in pairs(AttsEnumEx) do | 94 | for _, attrName in pairs(AttsEnumEx) do |
src/models/RoleChangeStruct.lua
| @@ -48,11 +48,29 @@ local bugFixSuduku = createVersionFunc(VersionType.DoOnly, function(role, params | @@ -48,11 +48,29 @@ local bugFixSuduku = createVersionFunc(VersionType.DoOnly, function(role, params | ||
| 48 | end | 48 | end |
| 49 | end) | 49 | end) |
| 50 | 50 | ||
| 51 | +local bugFixRune = createVersionFunc(VersionType.DoOnly, function(role, params) | ||
| 52 | + local had = false | ||
| 53 | + for id, rune in pairs(role.runeBag) do | ||
| 54 | + if math.floor(rune:getProperty("id") / 1000) == 16 then | ||
| 55 | + local attrs = rune:getProperty("attrs") | ||
| 56 | + local atk = attrs:getv(2, 0) | ||
| 57 | + if atk ~= 0 then | ||
| 58 | + attrs = attrs:delk(2):setv(1, atk) | ||
| 59 | + had = true | ||
| 60 | + rune:setProperty("attrs",attrs) | ||
| 61 | + end | ||
| 62 | + end | ||
| 63 | + end | ||
| 64 | + if had then | ||
| 65 | + -- 补偿 | ||
| 66 | + end | ||
| 67 | +end) | ||
| 51 | ---------------------版本方法 end ---------------------- | 68 | ---------------------版本方法 end ---------------------- |
| 52 | 69 | ||
| 53 | -- version 罗列start | 70 | -- version 罗列start |
| 54 | local versionList = {} -- version 列表 | 71 | local versionList = {} -- version 列表 |
| 55 | versionList[1] = {bugFixSuduku, {}} | 72 | versionList[1] = {bugFixSuduku, {}} |
| 73 | +versionList[2] = {bugFixRune, {}} | ||
| 56 | -- versionList[2] = {clearActivity, {5, 7}} | 74 | -- versionList[2] = {clearActivity, {5, 7}} |
| 57 | -- versionList[3] = {changeStructF, "test1"} | 75 | -- versionList[3] = {changeStructF, "test1"} |
| 58 | -- versionList[4] = {changeStructF, "test2"} | 76 | -- versionList[4] = {changeStructF, "test2"} |
src/models/RolePlugin.lua
| @@ -1504,6 +1504,7 @@ function RolePlugin.bind(Role) | @@ -1504,6 +1504,7 @@ function RolePlugin.bind(Role) | ||
| 1504 | return function (now, role) | 1504 | return function (now, role) |
| 1505 | if name == "email" and role.sendMailFlag then | 1505 | if name == "email" and role.sendMailFlag then |
| 1506 | last_breath = now + sec | 1506 | last_breath = now + sec |
| 1507 | + role.sendMailFlag = false | ||
| 1507 | return true | 1508 | return true |
| 1508 | end | 1509 | end |
| 1509 | if now >= last_breath then | 1510 | if now >= last_breath then |
| @@ -1539,8 +1540,15 @@ function RolePlugin.bind(Role) | @@ -1539,8 +1540,15 @@ function RolePlugin.bind(Role) | ||
| 1539 | end) | 1540 | end) |
| 1540 | for _, data in ipairs(redret) do | 1541 | for _, data in ipairs(redret) do |
| 1541 | local email = tarr2tab(data) | 1542 | local email = tarr2tab(data) |
| 1542 | - if tonum(email.createtime) > self:getProperty("ctime") | ||
| 1543 | - and ( not email.mid or tonum(email.mid) == mid ) | 1543 | + -- 0 需要判斷創角時間小於郵件創建時間 1 只需要在時間段內登陸即可領取 |
| 1544 | + local delayType = tonum(email.delayType) | ||
| 1545 | + local flag = false | ||
| 1546 | + if delayType == 1 then | ||
| 1547 | + flag = skynet.timex() > tonum(email.createtime) | ||
| 1548 | + else | ||
| 1549 | + flag = tonum(email.createtime) > self:getProperty("ctime") | ||
| 1550 | + end | ||
| 1551 | + if flag and ( not email.mid or tonum(email.mid) == mid ) | ||
| 1544 | and ( not email.endtime or tonum(email.endtime) > now )then | 1552 | and ( not email.endtime or tonum(email.endtime) > now )then |
| 1545 | return true | 1553 | return true |
| 1546 | end | 1554 | end |
src/services/globald.lua
| @@ -69,7 +69,8 @@ local function mailQuene() | @@ -69,7 +69,8 @@ local function mailQuene() | ||
| 69 | "attachments", email.attachments, | 69 | "attachments", email.attachments, |
| 70 | "endtime", email.endTime, | 70 | "endtime", email.endTime, |
| 71 | "mid", email.mid, | 71 | "mid", email.mid, |
| 72 | - "timestamp", now | 72 | + "timestamp", now, |
| 73 | + "delayType", email.delayType | ||
| 73 | ) | 74 | ) |
| 74 | else | 75 | else |
| 75 | redisproxy:hmset(string_format("globalEmail:%s", gid), | 76 | redisproxy:hmset(string_format("globalEmail:%s", gid), |
| @@ -80,7 +81,8 @@ local function mailQuene() | @@ -80,7 +81,8 @@ local function mailQuene() | ||
| 80 | "content", email.content, | 81 | "content", email.content, |
| 81 | "attachments", email.attachments, | 82 | "attachments", email.attachments, |
| 82 | "endtime", email.endTime, | 83 | "endtime", email.endTime, |
| 83 | - "timestamp", now | 84 | + "timestamp", now, |
| 85 | + "delayType", email.delayType | ||
| 84 | ) | 86 | ) |
| 85 | end | 87 | end |
| 86 | end | 88 | end |