Commit f9aa553919e58263595c03b52f04e7d35d32f08f
Merge branch 'tr/bugfix' into tr/publish/release
* tr/bugfix: 月重置 跨月 拾荒 失败也记录积分 编队 世界聊天等级15判断 活动卡池结束回馈次数通关邮件折算碎片 功能注释 第一次通关拾荒章节推送限时礼包,活动卡池结束回馈次数通关邮件折算碎片 可能的报错点 # Conflicts: # src/csvdata
Showing
10 changed files
with
49 additions
and
27 deletions
Show diff stats
src/GlobalVar.lua
| @@ -325,6 +325,7 @@ MailId = { | @@ -325,6 +325,7 @@ MailId = { | ||
| 325 | PayBackAward = 242, | 325 | PayBackAward = 242, |
| 326 | CBBackAward = 243, | 326 | CBBackAward = 243, |
| 327 | CBBackAward2 = 244, | 327 | CBBackAward2 = 244, |
| 328 | + ActivityPoolRet = 280, | ||
| 328 | } | 329 | } |
| 329 | 330 | ||
| 330 | TriggerEventType = { | 331 | TriggerEventType = { |
src/actions/ActivityAction.lua
| @@ -587,7 +587,7 @@ function _M.endBattleRpc(agent, data) | @@ -587,7 +587,7 @@ function _M.endBattleRpc(agent, data) | ||
| 587 | info = msg.info, | 587 | info = msg.info, |
| 588 | format = role.__actBattleCache.format | 588 | format = role.__actBattleCache.format |
| 589 | }) then | 589 | }) then |
| 590 | - SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) | 590 | + SendPacket(actionCodes.Activity_endBattleRpc, MsgPack.pack({errorCode = 1})) |
| 591 | return true | 591 | return true |
| 592 | end | 592 | end |
| 593 | role.__actBattleCache = nil | 593 | role.__actBattleCache = nil |
src/actions/RoleAction.lua
| @@ -1013,6 +1013,10 @@ function _M.chatRpc(agent, data) | @@ -1013,6 +1013,10 @@ function _M.chatRpc(agent, data) | ||
| 1013 | result = 1 | 1013 | result = 1 |
| 1014 | return | 1014 | return |
| 1015 | end | 1015 | end |
| 1016 | + if role:getProperty("level") < (globalCsv.chat_level or 15) then | ||
| 1017 | + result = 3 | ||
| 1018 | + return | ||
| 1019 | + end | ||
| 1016 | 1020 | ||
| 1017 | role._worldChatLimit = role._worldChatLimit or {start = 0, count = 0, canSayt = 0} --第一次开始说话时间 从第一次说话次数 能说话的时间 | 1021 | role._worldChatLimit = role._worldChatLimit or {start = 0, count = 0, canSayt = 0} --第一次开始说话时间 从第一次说话次数 能说话的时间 |
| 1018 | 1022 |
src/adv/Adv.lua
| @@ -819,25 +819,26 @@ function Adv:over(success, rewardRatio, overType) | @@ -819,25 +819,26 @@ function Adv:over(success, rewardRatio, overType) | ||
| 819 | if not self:isEndless() and self.level >= chapterData.limitlevel then | 819 | if not self:isEndless() and self.level >= chapterData.limitlevel then |
| 820 | self.owner:checkTaskEnter("AdvAllPass", {id = self.chapterId}) | 820 | self.owner:checkTaskEnter("AdvAllPass", {id = self.chapterId}) |
| 821 | end | 821 | end |
| 822 | + end | ||
| 822 | 823 | ||
| 823 | - local roleId = self.owner:getProperty("id") | ||
| 824 | - local oldMaxScore = tonum(redisproxy:zscore(self.owner:getAdvRankKey(), roleId)) | ||
| 825 | - if score > oldMaxScore then | ||
| 826 | - local team = self.owner:getProperty("advTeam") | ||
| 827 | - local curInfo = { | ||
| 828 | - name = self.owner:getProperty("name"), | ||
| 829 | - headId = self.owner:getProperty("headId"), | ||
| 830 | - lv = self.owner:getProperty("level"), | ||
| 831 | - batteV = self.owner:getTeamBattleValue(team.heros), | ||
| 832 | - chapter = self.chapterId, | ||
| 833 | - format = self.owner:getTeamHerosInfo(team).heros, | ||
| 834 | - } | ||
| 835 | - redisproxy:pipelining(function (red) | ||
| 836 | - red:zadd(self.owner:getAdvRankKey(), score, roleId) --更新分数 | ||
| 837 | - red:hset(RANK_ADV_INFO, roleId, MsgPack.pack(curInfo)) | ||
| 838 | - end) | ||
| 839 | - end | 824 | + local roleId = self.owner:getProperty("id") |
| 825 | + local oldMaxScore = tonum(redisproxy:zscore(self.owner:getAdvRankKey(), roleId)) | ||
| 826 | + if score > oldMaxScore then | ||
| 827 | + local team = self.owner:getProperty("advTeam") | ||
| 828 | + local curInfo = { | ||
| 829 | + name = self.owner:getProperty("name"), | ||
| 830 | + headId = self.owner:getProperty("headId"), | ||
| 831 | + lv = self.owner:getProperty("level"), | ||
| 832 | + batteV = self.owner:getTeamBattleValue(team.heros), | ||
| 833 | + chapter = self.chapterId, | ||
| 834 | + format = self.owner:getTeamHerosInfo(team).heros, | ||
| 835 | + } | ||
| 836 | + redisproxy:pipelining(function (red) | ||
| 837 | + red:zadd(self.owner:getAdvRankKey(), score, roleId) --更新分数 | ||
| 838 | + red:hset(RANK_ADV_INFO, roleId, MsgPack.pack(curInfo)) | ||
| 839 | + end) | ||
| 840 | end | 840 | end |
| 841 | + | ||
| 841 | -- 通关的时候要把引导步骤设定到成就引导 | 842 | -- 通关的时候要把引导步骤设定到成就引导 |
| 842 | if not self.owner:checkOverGuide(57) then | 843 | if not self.owner:checkOverGuide(57) then |
| 843 | self.owner:saveGuide(57,1,true) | 844 | self.owner:saveGuide(57,1,true) |
| @@ -1120,6 +1121,11 @@ local function clickOut(self, room, block, params, isExit) | @@ -1120,6 +1121,11 @@ local function clickOut(self, room, block, params, isExit) | ||
| 1120 | else | 1121 | else |
| 1121 | if self.level > (advPass[self.chapterId] or 0) then | 1122 | if self.level > (advPass[self.chapterId] or 0) then |
| 1122 | self.owner:changeUpdates({{type = "advPass", field = self.chapterId, value = self.level}}) | 1123 | self.owner:changeUpdates({{type = "advPass", field = self.chapterId, value = self.level}}) |
| 1124 | + | ||
| 1125 | + if (self.level >= csvdb["adv_chapterCsv"][self.chapterId].limitlevel) then --关卡结束 | ||
| 1126 | + self.owner:checkTaskEnter("AdvPassFirst", {id = self.chapterId}) | ||
| 1127 | + end | ||
| 1128 | + | ||
| 1123 | end | 1129 | end |
| 1124 | end | 1130 | end |
| 1125 | 1131 |
src/models/Activity.lua
| @@ -529,6 +529,12 @@ activityFunc[Activity.ActivityType.ActHeroPool] = { | @@ -529,6 +529,12 @@ activityFunc[Activity.ActivityType.ActHeroPool] = { | ||
| 529 | local actData = self:getActData(actType) | 529 | local actData = self:getActData(actType) |
| 530 | local cfg = csvdb["activity_ctrlCsv"][actId] | 530 | local cfg = csvdb["activity_ctrlCsv"][actId] |
| 531 | if not cfg then return end | 531 | if not cfg then return end |
| 532 | + -- 保底次数转换成万能碎片 | ||
| 533 | + --local count = math.ceil(((actData[cfg.condition] or 0) / 100) * 60) | ||
| 534 | + --if count > 0 then | ||
| 535 | + -- local gift = {[723] = count} | ||
| 536 | + -- self.owner:sendMail(MailId.ActivityPoolRet, nil, gift, {}) | ||
| 537 | + --end | ||
| 532 | actData[cfg.condition] = nil | 538 | actData[cfg.condition] = nil |
| 533 | self:updateActData(actType, actData, not notify) | 539 | self:updateActData(actType, actData, not notify) |
| 534 | end, | 540 | end, |
src/models/RoleBattle.lua
| @@ -150,7 +150,7 @@ function Role:checkBattleCheat(battleType, params) | @@ -150,7 +150,7 @@ function Role:checkBattleCheat(battleType, params) | ||
| 150 | -- self:setProperty("cheatCount", cheatCount) | 150 | -- self:setProperty("cheatCount", cheatCount) |
| 151 | 151 | ||
| 152 | local result = {clientSelf = {}, serverSelf = {}} | 152 | local result = {clientSelf = {}, serverSelf = {}} |
| 153 | - for k , v in pairs(clientInfo.selfAttr) do | 153 | + for k , v in pairs(clientInfo.selfAttr or {}) do |
| 154 | result.clientSelf[tostring(k)] = v | 154 | result.clientSelf[tostring(k)] = v |
| 155 | end | 155 | end |
| 156 | for k , v in pairs(selfTeamServer) do | 156 | for k , v in pairs(selfTeamServer) do |
src/models/RolePvp.lua
| @@ -530,7 +530,7 @@ function Role:changeCrossServerPvpSelfInfo(cType) | @@ -530,7 +530,7 @@ function Role:changeCrossServerPvpSelfInfo(cType) | ||
| 530 | return | 530 | return |
| 531 | end | 531 | end |
| 532 | change.battleV = self:getProperty("pvpTBVH") | 532 | change.battleV = self:getProperty("pvpTBVH") |
| 533 | - change.heros = self:getProperty("pvpTSH") | 533 | + change.team = self:getProperty("pvpTSH") |
| 534 | change.battleInfo = self:getProperty("pvpTBH") | 534 | change.battleInfo = self:getProperty("pvpTBH") |
| 535 | end | 535 | end |
| 536 | 536 |
src/models/RoleTask.lua
| @@ -50,6 +50,7 @@ local TaskType = { | @@ -50,6 +50,7 @@ local TaskType = { | ||
| 50 | AdvHang = 412, -- 代理拾荒次数 | 50 | AdvHang = 412, -- 代理拾荒次数 |
| 51 | AdvMineKill = 413, -- 宝藏怪击杀 | 51 | AdvMineKill = 413, -- 宝藏怪击杀 |
| 52 | AdvMineLayer = 414, -- 宝藏洞激活 | 52 | AdvMineLayer = 414, -- 宝藏洞激活 |
| 53 | + AdvPassFirst = 415, -- 冒险首次通关 - id | ||
| 53 | 54 | ||
| 54 | --爬塔相关 | 55 | --爬塔相关 |
| 55 | TowerPass = 501, -- 爬塔通关 - level | 56 | TowerPass = 501, -- 爬塔通关 - level |
| @@ -240,7 +241,7 @@ local StoreListener = { | @@ -240,7 +241,7 @@ local StoreListener = { | ||
| 240 | [TaskType.HangPass] = {{TriggerEventType.HangPass, f("id")}}, | 241 | [TaskType.HangPass] = {{TriggerEventType.HangPass, f("id")}}, |
| 241 | [TaskType.RoleLevelUp] = {{TriggerEventType.LevelUp, f("level")}}, | 242 | [TaskType.RoleLevelUp] = {{TriggerEventType.LevelUp, f("level")}}, |
| 242 | [TaskType.TowerPass] = {{TriggerEventType.TowerPass, f("level")}}, | 243 | [TaskType.TowerPass] = {{TriggerEventType.TowerPass, f("level")}}, |
| 243 | - [TaskType.AdvPass] = {{TriggerEventType.AdvPass, f("id")}}, | 244 | + [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, |
| 244 | [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, | 245 | [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, |
| 245 | } | 246 | } |
| 246 | } | 247 | } |
src/models/RoleTimeReset.lua
| @@ -23,6 +23,11 @@ ResetFunc["CrossDay"] = function(self, notify, response, now) | @@ -23,6 +23,11 @@ ResetFunc["CrossDay"] = function(self, notify, response, now) | ||
| 23 | end | 23 | end |
| 24 | self:setProperty("advMine", advMine) | 24 | self:setProperty("advMine", advMine) |
| 25 | 25 | ||
| 26 | + local ltime = self:getProperty("ltime") | ||
| 27 | + if isCrossMonth(ltime, now) then | ||
| 28 | + self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id | ||
| 29 | + end | ||
| 30 | + | ||
| 26 | response.dTask = {} | 31 | response.dTask = {} |
| 27 | response.advSup = self:getProperty("advSup") | 32 | response.advSup = self:getProperty("advSup") |
| 28 | self:log("onLogin") | 33 | self:log("onLogin") |
| @@ -43,11 +48,8 @@ ResetFunc["CrossWeek"] = function(self, notify, response) | @@ -43,11 +48,8 @@ ResetFunc["CrossWeek"] = function(self, notify, response) | ||
| 43 | response.dinerS = {} | 48 | response.dinerS = {} |
| 44 | end | 49 | end |
| 45 | 50 | ||
| 51 | +-- 30天 非自然月 | ||
| 46 | ResetFunc["CrossMonth"] = function(self, notify, response) | 52 | ResetFunc["CrossMonth"] = function(self, notify, response) |
| 47 | - local ltime = self:getProperty("ltime") | ||
| 48 | - if isCrossMonth(ltime, skynet.timex()) then | ||
| 49 | - self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id | ||
| 50 | - end | ||
| 51 | end | 53 | end |
| 52 | 54 | ||
| 53 | 55 | ||
| @@ -91,7 +93,9 @@ function Role:updateTimeReset(now, notify) | @@ -91,7 +93,9 @@ function Role:updateTimeReset(now, notify) | ||
| 91 | end | 93 | end |
| 92 | if needResetId[resetId] then | 94 | if needResetId[resetId] then |
| 93 | -- 充值商城购买记录 | 95 | -- 充值商城购买记录 |
| 94 | - self.storeData:resetStoreReored(resetId) | 96 | + if resetId ~= TimeReset.CrossMonth then |
| 97 | + self.storeData:resetStoreReored(resetId) | ||
| 98 | + end | ||
| 95 | end | 99 | end |
| 96 | end | 100 | end |
| 97 | 101 |
src/utils/CommonFunc.lua
| @@ -100,7 +100,7 @@ end | @@ -100,7 +100,7 @@ end | ||
| 100 | -- 判断是不是同一个月 | 100 | -- 判断是不是同一个月 |
| 101 | function isCrossMonth(target, now) | 101 | function isCrossMonth(target, now) |
| 102 | now = now or skynet.timex() | 102 | now = now or skynet.timex() |
| 103 | - local tarTm = os.date("*t", target) | 103 | + local tarTm = os.date("*t", target - RESET_TIME * 3600) |
| 104 | local nowTm = os.date("*t", now - RESET_TIME * 3600) | 104 | local nowTm = os.date("*t", now - RESET_TIME * 3600) |
| 105 | if tarTm.year == nowTm.year and tarTm.month == nowTm.month then | 105 | if tarTm.year == nowTm.year and tarTm.month == nowTm.month then |
| 106 | return false | 106 | return false |