Commit 279a57733271fe05caa1a08babf782a27781ef9d
Merge branch 'tr/bugfix-qa' into tr/develop
* tr/bugfix-qa: 获得所有SSR 且满级 满觉醒 同时获得全部满级金色铭文 满精进 充值mycard 拾荒bug pvp 匹配 和 失败扣减积分 无论什么方式翻开中继层格子都给奖励 跨天礼包重置 月重置 跨月 拾荒 失败也记录积分 编队 世界聊天等级15判断 活动卡池结束回馈次数通关邮件折算碎片 功能注释 第一次通关拾荒章节推送限时礼包,活动卡池结束回馈次数通关邮件折算碎片 # Conflicts: # src/adv/Adv.lua
Showing
11 changed files
with
138 additions
and
49 deletions
Show diff stats
src/GlobalVar.lua
| ... | ... | @@ -142,7 +142,6 @@ ItemId = { |
| 142 | 142 | TimeReset = { |
| 143 | 143 | CrossDay = 1, --通用跨天 |
| 144 | 144 | CrossWeek = 2, --通用跨周 |
| 145 | - CrossMonth = 1, --通用跨月 索引使用跨天,在回调方法中判断是否跨越 跨月的前置条件是跨天 | |
| 146 | 145 | DinerRank = 1, -- 餐厅排行榜 |
| 147 | 146 | PvpRank = 2, -- pvp排行榜 |
| 148 | 147 | PvpHight = 11, --高级竞技场 |
| ... | ... | @@ -326,6 +325,7 @@ MailId = { |
| 326 | 325 | PayBackAward = 242, |
| 327 | 326 | CBBackAward = 243, |
| 328 | 327 | CBBackAward2 = 244, |
| 328 | + ActivityPoolRet = 280, | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | TriggerEventType = { | ... | ... |
src/actions/GmAction.lua
| ... | ... | @@ -247,6 +247,7 @@ table.insert(helpDes, {"获得所有零件", "get", "RUNE"}) |
| 247 | 247 | table.insert(helpDes, {"获得所有碎片", "get", "FRAG"}) |
| 248 | 248 | table.insert(helpDes, {"获得所有食物", "get", "FOOD"}) |
| 249 | 249 | table.insert(helpDes, {"获得所有角色", "get", "HERO"}) |
| 250 | +table.insert(helpDes, {"获得满级满觉醒角色,满级满精进铭文", "get", "MAXHERO"}) | |
| 250 | 251 | function _M.get(role, pms) |
| 251 | 252 | if pms.pm1 == "ALL" then |
| 252 | 253 | local reward = {} |
| ... | ... | @@ -263,7 +264,7 @@ function _M.get(role, pms) |
| 263 | 264 | end |
| 264 | 265 | end |
| 265 | 266 | elseif pms.pm1 == "RUNE" then |
| 266 | - for itemId = 2000 , 3000 do | |
| 267 | + for itemId = 10000 , 20000 do | |
| 267 | 268 | if csvdb["itemCsv"][itemId] then |
| 268 | 269 | role:award({[itemId] = 1}, {log = {desc = "gm"}}) |
| 269 | 270 | end |
| ... | ... | @@ -286,6 +287,36 @@ function _M.get(role, pms) |
| 286 | 287 | role:award({[itemId] = 1}, {log = {desc = "gm"}}) |
| 287 | 288 | end |
| 288 | 289 | end |
| 290 | + elseif pms.pm1 == "MAXHERO" then | |
| 291 | + -- 给英雄 | |
| 292 | + for itemId = 400 , 700 do | |
| 293 | + if csvdb["itemCsv"][itemId] then | |
| 294 | + role:award({[itemId] = 1}, {log = {desc = "gm"}}) | |
| 295 | + end | |
| 296 | + end | |
| 297 | + -- 升满级 | |
| 298 | + for _, hero in ipairs(role.heros) do | |
| 299 | + hero:updateProperty({field = "level", value = 140}) | |
| 300 | + hero:updateProperty({field = "wakeL", value = #csvdb["unit_wakeCsv"]}) | |
| 301 | + end | |
| 302 | + | |
| 303 | + -- 添加铭文 | |
| 304 | + for itemId = 10000 , 20000 do | |
| 305 | + if csvdb["itemCsv"][itemId] then | |
| 306 | + role:award({[itemId] = 1}, {log = {desc = "gm"}}) | |
| 307 | + end | |
| 308 | + end | |
| 309 | + for _, rune in ipairs(role.runeBag) do | |
| 310 | + local typ = rune:getProperty("type") | |
| 311 | + local id = rune:getProperty("id") | |
| 312 | + | |
| 313 | + local runeSet = csvdb["runeCsv"][typ] | |
| 314 | + if not runeSet then break end | |
| 315 | + local runeData = runeSet[id] | |
| 316 | + if not runeData then break end | |
| 317 | + | |
| 318 | + rune:updateProperty({field = "level",value = runeData.lvLimit}) | |
| 319 | + end | |
| 289 | 320 | else |
| 290 | 321 | local itemId = tonum(pms.pm1) |
| 291 | 322 | if not csvdb["itemCsv"][itemId] then |
| ... | ... | @@ -561,6 +592,12 @@ function _M.ayncPurchase(role, params) |
| 561 | 592 | return role:handlePurchase(params) or "" |
| 562 | 593 | end |
| 563 | 594 | |
| 595 | +-- 获取订单号 | |
| 596 | +function _M.getPurchaseOrder(role, params) | |
| 597 | + return role:getPurchaseOrderByPlatform(params) or "" | |
| 598 | +end | |
| 599 | + | |
| 600 | + | |
| 564 | 601 | function _M.cz(role, pms) |
| 565 | 602 | local id = tonum(pms.pm1) |
| 566 | 603 | local csvData = csvdb["shop_rechargeCsv"][id] | ... | ... |
src/actions/RoleAction.lua
| ... | ... | @@ -157,6 +157,7 @@ function _M.loginRpc( agent, data ) |
| 157 | 157 | SERV_OPEN = redisproxy:hget("autoincrement_set", "server_start") |
| 158 | 158 | |
| 159 | 159 | role:changeStructVersion() -- 数据结构 版本更新 |
| 160 | + role:getAdvData(true) -- 清掉不合格的数据 | |
| 160 | 161 | role:advEndlessSeasonCheck(true) -- 冒险赛季更新检查 |
| 161 | 162 | |
| 162 | 163 | -- 跨天登陆事件 |
| ... | ... | @@ -1052,6 +1053,10 @@ function _M.chatRpc(agent, data) |
| 1052 | 1053 | result = 1 |
| 1053 | 1054 | return |
| 1054 | 1055 | end |
| 1056 | + if role:getProperty("level") < (globalCsv.chat_level or 15) then | |
| 1057 | + result = 3 | |
| 1058 | + return | |
| 1059 | + end | |
| 1055 | 1060 | |
| 1056 | 1061 | role._worldChatLimit = role._worldChatLimit or {start = 0, count = 0, canSayt = 0} --第一次开始说话时间 从第一次说话次数 能说话的时间 |
| 1057 | 1062 | ... | ... |
src/adv/Adv.lua
| ... | ... | @@ -20,8 +20,6 @@ function Adv:ctor(owner) |
| 20 | 20 | self.advTask = self.owner:getProperty("advTask") |
| 21 | 21 | self.advMTask = self.owner:getProperty("advMTask") |
| 22 | 22 | self.advTaskChange = false -- 任务改变才更新 |
| 23 | - | |
| 24 | - self:initByInfo(self.owner:getProperty("advInfo")) | |
| 25 | 23 | end |
| 26 | 24 | |
| 27 | 25 | function Adv:mylog(contents) |
| ... | ... | @@ -36,7 +34,8 @@ function Adv:mylog(contents) |
| 36 | 34 | end |
| 37 | 35 | |
| 38 | 36 | --初始化adv 信息 |
| 39 | -function Adv:initByInfo(advInfo) | |
| 37 | +function Adv:initByInfo() | |
| 38 | + local advInfo = self.owner:getProperty("advInfo") | |
| 40 | 39 | if not next(advInfo) then return end --还没有 开始新地图 |
| 41 | 40 | |
| 42 | 41 | self.chapterId = advInfo.chapterId |
| ... | ... | @@ -407,10 +406,9 @@ function Adv:isRunning() |
| 407 | 406 | return false |
| 408 | 407 | end |
| 409 | 408 | |
| 410 | --- 强制结束 | |
| 411 | -function Adv:forceOver(notNotify) | |
| 412 | - if self:isRunning() then | |
| 413 | - | |
| 409 | +-- 强制结束 逻辑和adv内部无关 | |
| 410 | +function Adv:forceOver(notNotify, force) | |
| 411 | + if self:isRunning() or force then | |
| 414 | 412 | local advTeam = self.owner:getProperty("advTeam") |
| 415 | 413 | advTeam.player = nil |
| 416 | 414 | |
| ... | ... | @@ -895,25 +893,27 @@ function Adv:over(success, rewardRatio, overType) |
| 895 | 893 | if not self:isEndless() and self.level >= chapterData.limitlevel then |
| 896 | 894 | self.owner:checkTaskEnter("AdvAllPass", {id = self.chapterId}) |
| 897 | 895 | end |
| 896 | + end | |
| 898 | 897 | |
| 899 | - local roleId = self.owner:getProperty("id") | |
| 900 | - local oldMaxScore = tonum(redisproxy:zscore(self.owner:getAdvRankKey(), roleId)) | |
| 901 | - if score > oldMaxScore and not self.actid then | |
| 902 | - local team = self.owner:getProperty("advTeam") | |
| 903 | - local curInfo = { | |
| 904 | - name = self.owner:getProperty("name"), | |
| 905 | - headId = self.owner:getProperty("headId"), | |
| 906 | - lv = self.owner:getProperty("level"), | |
| 907 | - batteV = self.owner:getTeamBattleValue(team.heros), | |
| 908 | - chapter = self.chapterId, | |
| 909 | - format = self.owner:getTeamHerosInfo(team).heros, | |
| 910 | - } | |
| 911 | - redisproxy:pipelining(function (red) | |
| 912 | - red:zadd(self.owner:getAdvRankKey(), score, roleId) --更新分数 | |
| 913 | - red:hset(RANK_ADV_INFO, roleId, MsgPack.pack(curInfo)) | |
| 914 | - end) | |
| 915 | - end | |
| 898 | + | |
| 899 | + local roleId = self.owner:getProperty("id") | |
| 900 | + local oldMaxScore = tonum(redisproxy:zscore(self.owner:getAdvRankKey(), roleId)) | |
| 901 | + if score > oldMaxScore and not self.actid then | |
| 902 | + local team = self.owner:getProperty("advTeam") | |
| 903 | + local curInfo = { | |
| 904 | + name = self.owner:getProperty("name"), | |
| 905 | + headId = self.owner:getProperty("headId"), | |
| 906 | + lv = self.owner:getProperty("level"), | |
| 907 | + batteV = self.owner:getTeamBattleValue(team.heros), | |
| 908 | + chapter = self.chapterId, | |
| 909 | + format = self.owner:getTeamHerosInfo(team).heros, | |
| 910 | + } | |
| 911 | + redisproxy:pipelining(function (red) | |
| 912 | + red:zadd(self.owner:getAdvRankKey(), score, roleId) --更新分数 | |
| 913 | + red:hset(RANK_ADV_INFO, roleId, MsgPack.pack(curInfo)) | |
| 914 | + end) | |
| 916 | 915 | end |
| 916 | + | |
| 917 | 917 | -- 通关的时候要把引导步骤设定到成就引导 |
| 918 | 918 | if not self.owner:checkOverGuide(57) then |
| 919 | 919 | self.owner:saveGuide(57,1,true) |
| ... | ... | @@ -1224,6 +1224,11 @@ local function clickOut(self, room, block, params, isExit) |
| 1224 | 1224 | else |
| 1225 | 1225 | if self.level > (advPass[self.chapterId] or 0) then |
| 1226 | 1226 | self.owner:changeUpdates({{type = "advPass", field = self.chapterId, value = self.level}}) |
| 1227 | + | |
| 1228 | + if (self.level >= csvdb["adv_chapterCsv"][self.chapterId].limitlevel) then --关卡结束 | |
| 1229 | + self.owner:checkTaskEnter("AdvPassFirst", {id = self.chapterId}) | |
| 1230 | + end | |
| 1231 | + | |
| 1227 | 1232 | end |
| 1228 | 1233 | end |
| 1229 | 1234 | |
| ... | ... | @@ -1821,9 +1826,6 @@ function Adv:clickBlock(roomId, blockId, params) |
| 1821 | 1826 | if not block.isOpen then |
| 1822 | 1827 | if self.isRelay or checkAroundBlocks() then --开放 |
| 1823 | 1828 | self:getCurMap():openBlock(roomId, blockId, true, true) |
| 1824 | - if self.isRelay and self:getCurMap():isAllOpen() then -- 发放翻开的奖励 | |
| 1825 | - self:passAdvRelay() | |
| 1826 | - end | |
| 1827 | 1829 | status = true |
| 1828 | 1830 | end |
| 1829 | 1831 | else | ... | ... |
src/adv/AdvMap.lua
| ... | ... | @@ -272,6 +272,10 @@ function Map:openBlock(roomId, blockId, isPlayer, ignoreBack) |
| 272 | 272 | if not ignoreBack then |
| 273 | 273 | self.adv:backBlockChange(roomId, blockId) |
| 274 | 274 | end |
| 275 | + | |
| 276 | + if self.adv.isRelay and self:isAllOpen() then -- 发放翻开的奖励 | |
| 277 | + self.adv:passAdvRelay() | |
| 278 | + end | |
| 275 | 279 | end |
| 276 | 280 | return status |
| 277 | 281 | end | ... | ... |
src/models/Activity.lua
| ... | ... | @@ -622,6 +622,12 @@ activityFunc[Activity.ActivityType.ActHeroPool] = { |
| 622 | 622 | local actData = self:getActData(actType) |
| 623 | 623 | local cfg = csvdb["activity_ctrlCsv"][actId] |
| 624 | 624 | if not cfg then return end |
| 625 | + -- 保底次数转换成万能碎片 | |
| 626 | + --local count = math.ceil(((actData[cfg.condition] or 0) / 100) * 60) | |
| 627 | + --if count > 0 then | |
| 628 | + -- local gift = {[723] = count} | |
| 629 | + -- self.owner:sendMail(MailId.ActivityPoolRet, nil, gift, {}) | |
| 630 | + --end | |
| 625 | 631 | actData[cfg.condition] = nil |
| 626 | 632 | self:updateActData(actType, actData, not notify) |
| 627 | 633 | end, | ... | ... |
src/models/RolePlugin.lua
| ... | ... | @@ -841,9 +841,16 @@ function RolePlugin.bind(Role) |
| 841 | 841 | return runeSet |
| 842 | 842 | end |
| 843 | 843 | |
| 844 | - function Role:getAdvData() | |
| 844 | + function Role:getAdvData(notNotify) | |
| 845 | 845 | if not self.advData then |
| 846 | 846 | self.advData = require("adv.Adv").new(self) |
| 847 | + local status, err = pcall(function() | |
| 848 | + self.advData:initByInfo() | |
| 849 | + end) | |
| 850 | + if not status then | |
| 851 | + self.advData:forceOver(notNotify, true) | |
| 852 | + skynet.error("getAdvData error adv initByInfo " .. err) | |
| 853 | + end | |
| 847 | 854 | end |
| 848 | 855 | return self.advData |
| 849 | 856 | end |
| ... | ... | @@ -1670,8 +1677,34 @@ function RolePlugin.bind(Role) |
| 1670 | 1677 | self:updateProperty({field = "redp", value = redp}) |
| 1671 | 1678 | end |
| 1672 | 1679 | |
| 1680 | + -- 网页支付获取订单号 | |
| 1681 | + function Role:getPurchaseOrderByPlatform(params) | |
| 1682 | + local checkPlatform = { | |
| 1683 | + ["mycard"] = "mycard_product_id", | |
| 1684 | + } | |
| 1685 | + local pidField = checkPlatform[params.payMode or ""] | |
| 1686 | + if not pidField or not params.product_id or params.product_id == "" then | |
| 1687 | + return "no product" | |
| 1688 | + end | |
| 1689 | + | |
| 1690 | + for k , v in pairs(csvdb["shop_rechargeCsv"]) do | |
| 1691 | + if not v[pidField] then return "no product" end | |
| 1692 | + if v[pidField] == params.product_id then | |
| 1693 | + if v.rmb ~= params.money then | |
| 1694 | + return "error money" | |
| 1695 | + end | |
| 1696 | + -- 发现需要的id | |
| 1697 | + local partnerOrderId = self:getPurchaseOrder(k, params.transactionId) | |
| 1698 | + if partnerOrderId == "" then | |
| 1699 | + return "no product" | |
| 1700 | + end | |
| 1701 | + return json.encode({order = partnerOrderId}) | |
| 1702 | + end | |
| 1703 | + end | |
| 1704 | + end | |
| 1705 | + | |
| 1673 | 1706 | -- 获取充值订单号 |
| 1674 | - function Role:getPurchaseOrder(rechargeId) | |
| 1707 | + function Role:getPurchaseOrder(rechargeId, transactionId) | |
| 1675 | 1708 | local roleId = self:getProperty("id") |
| 1676 | 1709 | local rechargeData = csvdb["shop_rechargeCsv"][rechargeId] |
| 1677 | 1710 | if not rechargeData then |
| ... | ... | @@ -1708,6 +1741,7 @@ function RolePlugin.bind(Role) |
| 1708 | 1741 | order = partnerOrderId, |
| 1709 | 1742 | rechargeId = rechargeId, |
| 1710 | 1743 | createTime = skynet.timex(), |
| 1744 | + transactionId = transactionId, | |
| 1711 | 1745 | }) |
| 1712 | 1746 | order:create() |
| 1713 | 1747 | -- 正在进行中的订单 缓存 |
| ... | ... | @@ -1786,6 +1820,7 @@ function RolePlugin.bind(Role) |
| 1786 | 1820 | request.product_id = data.product_id |
| 1787 | 1821 | request.pay_time = data.pay_time |
| 1788 | 1822 | request.transactionId = data.order_no |
| 1823 | + request.extension_info = data.extension_info | |
| 1789 | 1824 | ]] |
| 1790 | 1825 | function Role:handlePurchase(params) |
| 1791 | 1826 | local roleId = self:getProperty("id") |
| ... | ... | @@ -1816,6 +1851,10 @@ function RolePlugin.bind(Role) |
| 1816 | 1851 | }) |
| 1817 | 1852 | |
| 1818 | 1853 | if not status then |
| 1854 | + if params.extension_info == "mycard_web" then | |
| 1855 | + -- todo 发邮件 | |
| 1856 | + skynet.error("mycard_web " .. params.order) | |
| 1857 | + end | |
| 1819 | 1858 | SendPacket(actionCodes.Store_ayncPurchaseRpc, MsgPack.pack({ order = partnerOrderStr, |
| 1820 | 1859 | result = "success", reward = reward})) |
| 1821 | 1860 | end | ... | ... |
src/models/RolePvp.lua
| ... | ... | @@ -9,7 +9,7 @@ local PVP_RANK_TIME_SORT_PRECISION = 360 -- 时间精度 每6分钟忽略差异 |
| 9 | 9 | local PVP_RANK_BASE_SCORE = globalCsv.pvp_base_score -- 初始积分 |
| 10 | 10 | |
| 11 | 11 | -- 匹配规则改为以排名来匹配 |
| 12 | -local PVP_GET_ROBOT_SCORE = 2400 -- 2400分以下低档位匹配机器人 | |
| 12 | +local PVP_GET_ROBOT_SCORE = 1300 -- 1300分以下低档位匹配机器人 | |
| 13 | 13 | local PRE_RANGE_COUNT = 20 -- 每个档位人数 |
| 14 | 14 | local NEED_MATCH = 3 --匹配到多少人 |
| 15 | 15 | |
| ... | ... | @@ -73,7 +73,7 @@ function Role:changePvpScoreCommon(matchId, isWin) |
| 73 | 73 | if isWin then |
| 74 | 74 | local scoreChange = math.ceil(60 / (1 + 10 ^ ((myScore - matchScore) / 400))) |
| 75 | 75 | myScore = myScore + scoreChange |
| 76 | - matchScore = matchScore - math.ceil(scoreChange / 3) -- 防守方失败时,扣分减为原来的1/3 | |
| 76 | + matchScore = matchScore - math.ceil(scoreChange / 3 * 2) -- 防守方失败时,扣分减为原来的2/3 | |
| 77 | 77 | else |
| 78 | 78 | local scoreChange = math.ceil(60 / (1 + 10 ^ ((matchScore - myScore) / 400))) |
| 79 | 79 | myScore = myScore - scoreChange |
| ... | ... | @@ -139,7 +139,7 @@ function Role:changePvpScoreHigh(matchId, isWin) |
| 139 | 139 | if isWin then |
| 140 | 140 | local scoreChange = math.ceil(50 / (1 + 10 ^ ((myScore - matchScore) / 1000))) |
| 141 | 141 | myScore = myScore + scoreChange |
| 142 | - matchScore = matchScore - math.ceil(scoreChange / 3) -- 防守方失败时,扣分减为原来的1/3 | |
| 142 | + matchScore = matchScore - math.ceil(scoreChange / 3 * 2) -- 防守方失败时,扣分减为原来的2/3 | |
| 143 | 143 | else |
| 144 | 144 | local scoreChange = math.ceil(50 / (1 + 10 ^ ((matchScore - myScore) / 1000))) |
| 145 | 145 | myScore = myScore - scoreChange |
| ... | ... | @@ -530,7 +530,7 @@ function Role:changeCrossServerPvpSelfInfo(cType) |
| 530 | 530 | return |
| 531 | 531 | end |
| 532 | 532 | change.battleV = self:getProperty("pvpTBVH") |
| 533 | - change.heros = self:getProperty("pvpTSH") | |
| 533 | + change.team = self:getProperty("pvpTSH") | |
| 534 | 534 | change.battleInfo = self:getProperty("pvpTBH") |
| 535 | 535 | end |
| 536 | 536 | ... | ... |
src/models/RoleTask.lua
| ... | ... | @@ -53,6 +53,7 @@ local TaskType = { |
| 53 | 53 | AdvMineLayer = 414, -- 宝藏洞激活 |
| 54 | 54 | AdvKillBoss = 415, -- 拾荒击杀boss |
| 55 | 55 | AdvHangHeroCnt = 416, -- 拾荒人数 |
| 56 | + AdvPassFirst = 417, -- 冒险首次通关 - id | |
| 56 | 57 | |
| 57 | 58 | --爬塔相关 |
| 58 | 59 | TowerPass = 501, -- 爬塔通关 - level |
| ... | ... | @@ -249,7 +250,7 @@ local StoreListener = { |
| 249 | 250 | [TaskType.HangPass] = {{TriggerEventType.HangPass, f("id")}}, |
| 250 | 251 | [TaskType.RoleLevelUp] = {{TriggerEventType.LevelUp, f("level")}}, |
| 251 | 252 | [TaskType.TowerPass] = {{TriggerEventType.TowerPass, f("level")}}, |
| 252 | - [TaskType.AdvPass] = {{TriggerEventType.AdvPass, f("id")}}, | |
| 253 | + [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, | |
| 253 | 254 | [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, |
| 254 | 255 | } |
| 255 | 256 | } |
| ... | ... | @@ -886,4 +887,4 @@ function RoleTask.bind(Role) |
| 886 | 887 | |
| 887 | 888 | end |
| 888 | 889 | |
| 889 | -return RoleTask | |
| 890 | 890 | \ No newline at end of file |
| 891 | +return RoleTask | ... | ... |
src/models/RoleTimeReset.lua
| ... | ... | @@ -23,6 +23,11 @@ ResetFunc["CrossDay"] = function(self, notify, response, now) |
| 23 | 23 | end |
| 24 | 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 | 31 | response.dTask = {} |
| 27 | 32 | response.advSup = self:getProperty("advSup") |
| 28 | 33 | self:log("onLogin") |
| ... | ... | @@ -43,13 +48,6 @@ ResetFunc["CrossWeek"] = function(self, notify, response) |
| 43 | 48 | response.dinerS = {} |
| 44 | 49 | end |
| 45 | 50 | |
| 46 | -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 | |
| 52 | - | |
| 53 | 51 | |
| 54 | 52 | ResetFunc["DinerRank"] = function(self, notify, response) |
| 55 | 53 | self.dinerData:rankResetData(notify) |
| ... | ... | @@ -89,13 +87,10 @@ function Role:updateTimeReset(now, notify) |
| 89 | 87 | ResetFunc[funcName](self, notify, response, now) |
| 90 | 88 | resetMode[funcName] = true |
| 91 | 89 | end |
| 92 | - if needResetId[resetId] then | |
| 93 | - -- 充值商城购买记录 | |
| 94 | - self.storeData:resetStoreReored(resetId) | |
| 95 | - end | |
| 96 | 90 | end |
| 97 | 91 | |
| 98 | 92 | for resetId, round in pairs(needResetId) do |
| 93 | + self.storeData:resetStoreReored(resetId) | |
| 99 | 94 | timeReset[resetId] = round |
| 100 | 95 | end |
| 101 | 96 | self:setProperties({timeReset = timeReset, ltime = now}) | ... | ... |
src/utils/CommonFunc.lua
| ... | ... | @@ -100,7 +100,7 @@ end |
| 100 | 100 | -- 判断是不是同一个月 |
| 101 | 101 | function isCrossMonth(target, now) |
| 102 | 102 | now = now or skynet.timex() |
| 103 | - local tarTm = os.date("*t", target) | |
| 103 | + local tarTm = os.date("*t", target - RESET_TIME * 3600) | |
| 104 | 104 | local nowTm = os.date("*t", now - RESET_TIME * 3600) |
| 105 | 105 | if tarTm.year == nowTm.year and tarTm.month == nowTm.month then |
| 106 | 106 | return false | ... | ... |