Commit fc306cca25c7afbb895f0ba213f8fa0017e0b74e
Merge branch 'tr/bugfix-qa' into tr/develop
* tr/bugfix-qa: 可能的报错点 结算正常 删除自动封号 输出删掉 登入刷新兑换活动商店 兑换活动上线检测是否需要刷新 修复存在的冒险进不去的玩家 兑换商店不刷新bug 新增倍数 bugfix 同单号充值输出 # Conflicts: # src/csvdata
Showing
11 changed files
with
51 additions
and
30 deletions
Show diff stats
src/GlobalVar.lua
| @@ -16,6 +16,7 @@ TIME_ZONE = math.floor(os.difftime(START_RESET_TIME_BASE, os.time(os.date("!*t", | @@ -16,6 +16,7 @@ TIME_ZONE = math.floor(os.difftime(START_RESET_TIME_BASE, os.time(os.date("!*t", | ||
| 16 | 16 | ||
| 17 | START_RESET_TIME = START_RESET_TIME_BASE - TIME_ZONE * 3600 | 17 | START_RESET_TIME = START_RESET_TIME_BASE - TIME_ZONE * 3600 |
| 18 | 18 | ||
| 19 | +STRUCT_VERSION = 3 -- 数据结构版本 | ||
| 19 | 20 | ||
| 20 | MAX_ROLE_NUM = 1000000 | 21 | MAX_ROLE_NUM = 1000000 |
| 21 | -- 属性枚举 | 22 | -- 属性枚举 |
src/actions/ActivityAction.lua
| @@ -631,7 +631,7 @@ function _M.endBattleRpc(agent, data) | @@ -631,7 +631,7 @@ function _M.endBattleRpc(agent, data) | ||
| 631 | info = msg.info, | 631 | info = msg.info, |
| 632 | format = role.__actBattleCache.format | 632 | format = role.__actBattleCache.format |
| 633 | }) then | 633 | }) then |
| 634 | - SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) | 634 | + SendPacket(actionCodes.Activity_endBattleRpc, MsgPack.pack({errorCode = 1})) |
| 635 | return true | 635 | return true |
| 636 | end | 636 | end |
| 637 | role.__actBattleCache = nil | 637 | role.__actBattleCache = nil |
src/actions/AdvAction.lua
| @@ -1030,6 +1030,9 @@ function _M.roleFormatRpc(agent , data) | @@ -1030,6 +1030,9 @@ function _M.roleFormatRpc(agent , data) | ||
| 1030 | local index = msg.index -- 阵容索引 | 1030 | local index = msg.index -- 阵容索引 |
| 1031 | local title = msg.title -- 阵容名称 | 1031 | local title = msg.title -- 阵容名称 |
| 1032 | local team = {} | 1032 | local team = {} |
| 1033 | + | ||
| 1034 | + if role:getAdvData():isRunning() then return 3 end | ||
| 1035 | + | ||
| 1033 | for slot, heroId in pairs(msg.heros) do | 1036 | for slot, heroId in pairs(msg.heros) do |
| 1034 | if not role.heros[heroId] then | 1037 | if not role.heros[heroId] then |
| 1035 | return 1 | 1038 | return 1 |
| @@ -1072,6 +1075,9 @@ function _M.selectTeamRpc(agent, data) | @@ -1072,6 +1075,9 @@ function _M.selectTeamRpc(agent, data) | ||
| 1072 | local role = agent.role | 1075 | local role = agent.role |
| 1073 | local msg = MsgPack.unpack(data) | 1076 | local msg = MsgPack.unpack(data) |
| 1074 | local index = msg.index -- 阵容索引 | 1077 | local index = msg.index -- 阵容索引 |
| 1078 | + | ||
| 1079 | + if role:getAdvData():isRunning() then return 1 end | ||
| 1080 | + | ||
| 1075 | local team = role:getAdvTeamFormat(index) | 1081 | local team = role:getAdvTeamFormat(index) |
| 1076 | if not next(team) then return end | 1082 | if not next(team) then return end |
| 1077 | team["index"] = index | 1083 | team["index"] = index |
src/adv/Adv.lua
| @@ -425,7 +425,7 @@ function Adv:forceOver(notNotify) | @@ -425,7 +425,7 @@ function Adv:forceOver(notNotify) | ||
| 425 | reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 | 425 | reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 |
| 426 | end | 426 | end |
| 427 | end | 427 | end |
| 428 | - self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}}) | 428 | + self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}, notNotify = notNotify}) |
| 429 | 429 | ||
| 430 | self:clear() | 430 | self:clear() |
| 431 | self.owner:updateProperties({ | 431 | self.owner:updateProperties({ |
| @@ -1050,7 +1050,7 @@ function Adv:award(gift, params, backRewardParams) | @@ -1050,7 +1050,7 @@ function Adv:award(gift, params, backRewardParams) | ||
| 1050 | 1050 | ||
| 1051 | local autoUse = {} | 1051 | local autoUse = {} |
| 1052 | for itemId, count in pairs(tgift) do | 1052 | for itemId, count in pairs(tgift) do |
| 1053 | - if count > 0 then | 1053 | + if count > 0 and self.battle.player then |
| 1054 | local buffAdd = self.battle.player:getRewardChange(itemId) | 1054 | local buffAdd = self.battle.player:getRewardChange(itemId) |
| 1055 | count = math.floor(math.max(0, (count + buffAdd[0]) * (1 + buffAdd[1]))) --附加 buff 的影响 | 1055 | count = math.floor(math.max(0, (count + buffAdd[0]) * (1 + buffAdd[1]))) --附加 buff 的影响 |
| 1056 | self:checkTask(Adv.TaskType.Item, count, itemId) | 1056 | self:checkTask(Adv.TaskType.Item, count, itemId) |
src/adv/AdvBlock.lua
| @@ -60,9 +60,9 @@ function Block:updateEvent(event, isInit) | @@ -60,9 +60,9 @@ function Block:updateEvent(event, isInit) | ||
| 60 | end | 60 | end |
| 61 | self:randomEvent() | 61 | self:randomEvent() |
| 62 | end | 62 | end |
| 63 | - self:quickDrop() | ||
| 64 | 63 | ||
| 65 | if not isInit and self.isOpen then | 64 | if not isInit and self.isOpen then |
| 65 | + self:quickDrop() | ||
| 66 | local newet = self:getEventType() | 66 | local newet = self:getEventType() |
| 67 | if oldet ~= newet then | 67 | if oldet ~= newet then |
| 68 | local em = {} | 68 | local em = {} |
src/adv/AdvPassive.lua
| @@ -532,7 +532,7 @@ function Passive:effect8(dropId) | @@ -532,7 +532,7 @@ function Passive:effect8(dropId) | ||
| 532 | end | 532 | end |
| 533 | 533 | ||
| 534 | --9=直接获得item(可在结算触发时使用) | 534 | --9=直接获得item(可在结算触发时使用) |
| 535 | -function Passive:effect9(itemId, triggerPms, ratio, max) | 535 | +function Passive:effect9(itemId, triggerPms, ratio, ratio2, max) |
| 536 | local cond = nil | 536 | local cond = nil |
| 537 | if self.passiveData.value == 0 then | 537 | if self.passiveData.value == 0 then |
| 538 | cond = triggerPms.score | 538 | cond = triggerPms.score |
| @@ -542,7 +542,7 @@ function Passive:effect9(itemId, triggerPms, ratio, max) | @@ -542,7 +542,7 @@ function Passive:effect9(itemId, triggerPms, ratio, max) | ||
| 542 | return | 542 | return |
| 543 | end | 543 | end |
| 544 | if not cond then return end | 544 | if not cond then return end |
| 545 | - self.owner.battle.adv:award({[itemId] = math.floor(math.max(0, math.min(max, cond / ratio)))}, {log = {desc = "passive", int1 = self.id}}, {roomId = self.owner.roomId, blockId = self.owner.blockId}) | 545 | + self.owner.battle.adv:award({[itemId] = math.floor(math.max(0, math.min(max, cond / ratio * ratio2)))}, {log = {desc = "passive", int1 = self.id}}, {roomId = self.owner.roomId, blockId = self.owner.blockId}) |
| 546 | end | 546 | end |
| 547 | 547 | ||
| 548 | --10=战斗额外掉落次数 | 548 | --10=战斗额外掉落次数 |
src/models/Activity.lua
| @@ -575,6 +575,9 @@ activityFunc[Activity.ActivityType.Exchange] = { | @@ -575,6 +575,9 @@ activityFunc[Activity.ActivityType.Exchange] = { | ||
| 575 | actData[actId] = {} | 575 | actData[actId] = {} |
| 576 | self:updateActData(actType, actData, not notify) | 576 | self:updateActData(actType, actData, not notify) |
| 577 | end, | 577 | end, |
| 578 | + ["login"] = function(self, actType, actId) | ||
| 579 | + activityFunc[Activity.ActivityType.Exchange]["crossDay"](self, actType, true, actId) | ||
| 580 | + end, | ||
| 578 | ["crossDay"] = function(self, actType, notify, actId) | 581 | ["crossDay"] = function(self, actType, notify, actId) |
| 579 | local actData = self:getActData(actType) or {} | 582 | local actData = self:getActData(actType) or {} |
| 580 | local lastTs = actData["ts"] or 0 | 583 | local lastTs = actData["ts"] or 0 |
| @@ -583,14 +586,14 @@ activityFunc[Activity.ActivityType.Exchange] = { | @@ -583,14 +586,14 @@ activityFunc[Activity.ActivityType.Exchange] = { | ||
| 583 | if not cfg then return end | 586 | if not cfg then return end |
| 584 | local refreshTimes = cfg.condition2:toArray(false, "=") | 587 | local refreshTimes = cfg.condition2:toArray(false, "=") |
| 585 | for i = 1, #refreshTimes do | 588 | for i = 1, #refreshTimes do |
| 586 | - local rt = toUnixtime(refreshTimes[1]..string_format("%02x", RESET_TIME)) | 589 | + local rt = toUnixtime(refreshTimes[i]..string_format("%02x", RESET_TIME)) |
| 587 | if timeNow >= rt and rt > lastTs then | 590 | if timeNow >= rt and rt > lastTs then |
| 588 | lastTs = rt | 591 | lastTs = rt |
| 589 | actData = {} | 592 | actData = {} |
| 590 | end | 593 | end |
| 591 | end | 594 | end |
| 592 | - if next(actData) then | ||
| 593 | - actData["ts"] = lastTs | 595 | + if not next(actData) then |
| 596 | + actData["ts"] = timeNow | ||
| 594 | self:updateActData(actType, actData, not notify) | 597 | self:updateActData(actType, actData, not notify) |
| 595 | end | 598 | end |
| 596 | end, | 599 | end, |
src/models/Role.lua
| @@ -57,7 +57,7 @@ Role.schema = { | @@ -57,7 +57,7 @@ Role.schema = { | ||
| 57 | ltime = {"number", 0}, -- 最后登录时间 | 57 | ltime = {"number", 0}, -- 最后登录时间 |
| 58 | ctime = {"number", skynet.timex()}, -- 创建时间 | 58 | ctime = {"number", skynet.timex()}, -- 创建时间 |
| 59 | ignoreMt = {"number", 0}, -- 忽略维护拦截 | 59 | ignoreMt = {"number", 0}, -- 忽略维护拦截 |
| 60 | - sversion = {"number", globalCsv.StructVersion or 0}, -- 重整数据版本 | 60 | + sversion = {"number", STRUCT_VERSION or 0}, -- 重整数据版本 |
| 61 | timeReset = {"table", {}}, --重置轮回记录 | 61 | timeReset = {"table", {}}, --重置轮回记录 |
| 62 | diamond = {"number", 0}, | 62 | diamond = {"number", 0}, |
| 63 | reDiamond = {"number", 0}, | 63 | reDiamond = {"number", 0}, |
src/models/RoleBattle.lua
| @@ -145,28 +145,28 @@ function Role:checkBattleCheat(battleType, params) | @@ -145,28 +145,28 @@ function Role:checkBattleCheat(battleType, params) | ||
| 145 | 145 | ||
| 146 | local status = checkOneCheat(clientInfo.selfAttr, selfTeamServer, clientInfo.enemyAttr, enemyServer) | 146 | local status = checkOneCheat(clientInfo.selfAttr, selfTeamServer, clientInfo.enemyAttr, enemyServer) |
| 147 | if not status then | 147 | if not status then |
| 148 | - local cheatCount = self:getProperty("cheatCount") | ||
| 149 | - cheatCount = cheatCount + 1 | ||
| 150 | - self:setProperty("cheatCount", cheatCount) | 148 | + -- local cheatCount = self:getProperty("cheatCount") |
| 149 | + -- cheatCount = cheatCount + 1 | ||
| 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 |
| 157 | result.serverSelf[tostring(k)] = v | 157 | result.serverSelf[tostring(k)] = v |
| 158 | end | 158 | end |
| 159 | result = json.encode(result) | 159 | result = json.encode(result) |
| 160 | - self:mylog("cheat", {desc = battleType, int1 = cheatCount, text1 = result}) | 160 | + self:mylog("cheat", {desc = battleType, int1 = 1, text1 = result}) |
| 161 | 161 | ||
| 162 | - for _, v in ipairs(globalCsv.cheat_check) do | ||
| 163 | - if cheatCount == v[1] then | ||
| 164 | - self:setBan(v[2] / 86400, 5) | ||
| 165 | - break | ||
| 166 | - end | ||
| 167 | - end | 162 | + -- for _, v in ipairs(globalCsv.cheat_check) do |
| 163 | + -- if cheatCount == v[1] then | ||
| 164 | + -- self:setBan(v[2] / 86400, 5) | ||
| 165 | + -- break | ||
| 166 | + -- end | ||
| 167 | + -- end | ||
| 168 | end | 168 | end |
| 169 | - return status | 169 | + return true |
| 170 | end | 170 | end |
| 171 | 171 | ||
| 172 | function Role:checkBattle(battleType, params) | 172 | function Role:checkBattle(battleType, params) |
src/models/RoleChangeStruct.lua
| @@ -31,6 +31,7 @@ local awardGift = createVersionFunc(VersionType.Override ,function(role, params) | @@ -31,6 +31,7 @@ local awardGift = createVersionFunc(VersionType.Override ,function(role, params) | ||
| 31 | print("awardGift" .. " >>> " .. params) | 31 | print("awardGift" .. " >>> " .. params) |
| 32 | end) | 32 | end) |
| 33 | 33 | ||
| 34 | + | ||
| 34 | local bugFixSuduku = createVersionFunc(VersionType.DoOnly, function(role, params) | 35 | local bugFixSuduku = createVersionFunc(VersionType.DoOnly, function(role, params) |
| 35 | local sudoku = role:getProperty("sudoku") | 36 | local sudoku = role:getProperty("sudoku") |
| 36 | local phase = sudoku[-1] or 1 | 37 | local phase = sudoku[-1] or 1 |
| @@ -65,12 +66,21 @@ local bugFixRune = createVersionFunc(VersionType.DoOnly, function(role, params) | @@ -65,12 +66,21 @@ local bugFixRune = createVersionFunc(VersionType.DoOnly, function(role, params) | ||
| 65 | -- 补偿 | 66 | -- 补偿 |
| 66 | end | 67 | end |
| 67 | end) | 68 | end) |
| 69 | + | ||
| 70 | +-- 清除 player 消失 的冒险 | ||
| 71 | +local bugFixAdvPlayer = createVersionFunc(VersionType.Override, function(role, params) | ||
| 72 | + if role:getAdvData():isRunning() and not role:getProperty("advTeam").player then | ||
| 73 | + role:getAdvData():forceOver(true) | ||
| 74 | + end | ||
| 75 | +end) | ||
| 76 | + | ||
| 68 | ---------------------版本方法 end ---------------------- | 77 | ---------------------版本方法 end ---------------------- |
| 69 | 78 | ||
| 70 | -- version 罗列start | 79 | -- version 罗列start |
| 71 | local versionList = {} -- version 列表 | 80 | local versionList = {} -- version 列表 |
| 72 | versionList[1] = {bugFixSuduku, {}} | 81 | versionList[1] = {bugFixSuduku, {}} |
| 73 | versionList[2] = {bugFixRune, {}} | 82 | versionList[2] = {bugFixRune, {}} |
| 83 | +versionList[3] = {bugFixAdvPlayer, {}} | ||
| 74 | -- versionList[2] = {clearActivity, {5, 7}} | 84 | -- versionList[2] = {clearActivity, {5, 7}} |
| 75 | -- versionList[3] = {changeStructF, "test1"} | 85 | -- versionList[3] = {changeStructF, "test1"} |
| 76 | -- versionList[4] = {changeStructF, "test2"} | 86 | -- versionList[4] = {changeStructF, "test2"} |
| @@ -87,11 +97,11 @@ function RoleChangeStruct.bind(Role) | @@ -87,11 +97,11 @@ function RoleChangeStruct.bind(Role) | ||
| 87 | 97 | ||
| 88 | function Role:changeStructVersion() | 98 | function Role:changeStructVersion() |
| 89 | local curVersion = self:getProperty("sversion") | 99 | local curVersion = self:getProperty("sversion") |
| 90 | - if not globalCsv.StructVersion or curVersion >= globalCsv.StructVersion then return end | 100 | + if not STRUCT_VERSION or curVersion >= STRUCT_VERSION then return end |
| 91 | 101 | ||
| 92 | local jumpVersion = {} | 102 | local jumpVersion = {} |
| 93 | local versionTemp = {} | 103 | local versionTemp = {} |
| 94 | - for version = curVersion + 1, globalCsv.StructVersion do | 104 | + for version = curVersion + 1, STRUCT_VERSION do |
| 95 | local versionData = versionList[version] | 105 | local versionData = versionList[version] |
| 96 | if versionData then | 106 | if versionData then |
| 97 | if versionData[1].vType == VersionType.DoOnly then | 107 | if versionData[1].vType == VersionType.DoOnly then |
| @@ -124,7 +134,7 @@ function RoleChangeStruct.bind(Role) | @@ -124,7 +134,7 @@ function RoleChangeStruct.bind(Role) | ||
| 124 | end | 134 | end |
| 125 | end | 135 | end |
| 126 | 136 | ||
| 127 | - for version = curVersion + 1, globalCsv.StructVersion do | 137 | + for version = curVersion + 1, STRUCT_VERSION do |
| 128 | if not jumpVersion[version] then | 138 | if not jumpVersion[version] then |
| 129 | local versionData = versionList[version] | 139 | local versionData = versionList[version] |
| 130 | if versionData[1].vType == VersionType.DoOnly or versionData[1].vType == VersionType.Override then | 140 | if versionData[1].vType == VersionType.DoOnly or versionData[1].vType == VersionType.Override then |
| @@ -134,7 +144,7 @@ function RoleChangeStruct.bind(Role) | @@ -134,7 +144,7 @@ function RoleChangeStruct.bind(Role) | ||
| 134 | end | 144 | end |
| 135 | end | 145 | end |
| 136 | end | 146 | end |
| 137 | - self:setProperty("sversion", globalCsv.StructVersion) | 147 | + self:setProperty("sversion", STRUCT_VERSION) |
| 138 | end | 148 | end |
| 139 | 149 | ||
| 140 | end | 150 | end |
src/models/RolePlugin.lua
| @@ -289,7 +289,7 @@ function RolePlugin.bind(Role) | @@ -289,7 +289,7 @@ function RolePlugin.bind(Role) | ||
| 289 | print("addPlayExp no log ", debug.traceback()) | 289 | print("addPlayExp no log ", debug.traceback()) |
| 290 | end | 290 | end |
| 291 | 291 | ||
| 292 | - self:updateProperties({level = level, exp = newExp}) | 292 | + self:updateProperties({level = level, exp = newExp}, params.notNotify) |
| 293 | self:changeCrossServerPvpSelfInfo("level") | 293 | self:changeCrossServerPvpSelfInfo("level") |
| 294 | end | 294 | end |
| 295 | 295 | ||
| @@ -424,7 +424,7 @@ function RolePlugin.bind(Role) | @@ -424,7 +424,7 @@ function RolePlugin.bind(Role) | ||
| 424 | end | 424 | end |
| 425 | 425 | ||
| 426 | if update then | 426 | if update then |
| 427 | - self:updateProperty({field = "boxL", value = boxL}) | 427 | + self:updateProperty({field = "boxL", value = boxL, notNotify = pms.notNotify}) |
| 428 | end | 428 | end |
| 429 | end | 429 | end |
| 430 | 430 | ||
| @@ -886,7 +886,6 @@ function RolePlugin.bind(Role) | @@ -886,7 +886,6 @@ function RolePlugin.bind(Role) | ||
| 886 | self:mylog("role_action", {desc = "ban_rm"}) | 886 | self:mylog("role_action", {desc = "ban_rm"}) |
| 887 | else | 887 | else |
| 888 | self:sendGmMsg(globalCsv.ban_tips[banType] or globalCsv.ban_tips[0]) | 888 | self:sendGmMsg(globalCsv.ban_tips[banType] or globalCsv.ban_tips[0]) |
| 889 | - print(86400 * time) | ||
| 890 | self:setProperty("banTime", math.ceil(now + 86400 * time)) | 889 | self:setProperty("banTime", math.ceil(now + 86400 * time)) |
| 891 | self:setProperty("banType", banType) | 890 | self:setProperty("banType", banType) |
| 892 | self:resetRank() | 891 | self:resetRank() |
| @@ -1741,6 +1740,9 @@ function RolePlugin.bind(Role) | @@ -1741,6 +1740,9 @@ function RolePlugin.bind(Role) | ||
| 1741 | local dataSet = csvdb["shop_rechargeCsv"][rechargeId] | 1740 | local dataSet = csvdb["shop_rechargeCsv"][rechargeId] |
| 1742 | 1741 | ||
| 1743 | if orderObject:getProperty("finishTime") > 0 then | 1742 | if orderObject:getProperty("finishTime") > 0 then |
| 1743 | + skynet.error(string.format("[recharge] is a finish order cpOrder: %s, platformOrder : %s, hadPlatformOrder: %s, id: %s, overTime : %s", | ||
| 1744 | + partnerOrderStr, platformOrder, orderObject:getProperty("transactionId"), rechargeId, orderObject:getProperty("finishTime") | ||
| 1745 | + )) | ||
| 1744 | return false, "finsh" | 1746 | return false, "finsh" |
| 1745 | end | 1747 | end |
| 1746 | 1748 | ||
| @@ -1789,7 +1791,6 @@ function RolePlugin.bind(Role) | @@ -1789,7 +1791,6 @@ function RolePlugin.bind(Role) | ||
| 1789 | local roleId = self:getProperty("id") | 1791 | local roleId = self:getProperty("id") |
| 1790 | local partnerOrderStr = params.order | 1792 | local partnerOrderStr = params.order |
| 1791 | 1793 | ||
| 1792 | - | ||
| 1793 | local status, back = self:updatePurchaseOrder(partnerOrderStr, params.transactionId, "finsh") | 1794 | local status, back = self:updatePurchaseOrder(partnerOrderStr, params.transactionId, "finsh") |
| 1794 | if not status then | 1795 | if not status then |
| 1795 | if back == "finsh" then | 1796 | if back == "finsh" then |