Commit f0272ad826b3eae490a633ecb35527355dececc6

Authored by 熊润斐
2 parents d192a047 7245bc4b

Merge branch 'tr/bugfix' into tr/publish/preview

src/GlobalVar.lua
... ... @@ -16,6 +16,7 @@ TIME_ZONE = math.floor(os.difftime(START_RESET_TIME_BASE, os.time(os.date("!*t",
16 16  
17 17 START_RESET_TIME = START_RESET_TIME_BASE - TIME_ZONE * 3600
18 18  
  19 +STRUCT_VERSION = 3 -- 数据结构版本
19 20  
20 21 MAX_ROLE_NUM = 1000000
21 22 -- 属性枚举
... ...
src/actions/AdvAction.lua
... ... @@ -963,6 +963,9 @@ function _M.roleFormatRpc(agent , data)
963 963 local index = msg.index -- 阵容索引
964 964 local title = msg.title -- 阵容名称
965 965 local team = {}
  966 +
  967 + if role:getAdvData():isRunning() then return 3 end
  968 +
966 969 for slot, heroId in pairs(msg.heros) do
967 970 if not role.heros[heroId] then
968 971 return 1
... ... @@ -1005,6 +1008,9 @@ function _M.selectTeamRpc(agent, data)
1005 1008 local role = agent.role
1006 1009 local msg = MsgPack.unpack(data)
1007 1010 local index = msg.index -- 阵容索引
  1011 +
  1012 + if role:getAdvData():isRunning() then return 1 end
  1013 +
1008 1014 local team = role:getAdvTeamFormat(index)
1009 1015 if not next(team) then return end
1010 1016 team["index"] = index
... ...
src/adv/Adv.lua
... ... @@ -408,7 +408,7 @@ function Adv:forceOver(notNotify)
408 408 for itemId, count in pairs(reward) do
409 409 reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败
410 410 end
411   - self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}})
  411 + self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}, notNotify = notNotify})
412 412  
413 413 self:clear()
414 414 self.owner:updateProperties({
... ... @@ -971,7 +971,7 @@ function Adv:award(gift, params, backRewardParams)
971 971  
972 972 local autoUse = {}
973 973 for itemId, count in pairs(tgift) do
974   - if count > 0 then
  974 + if count > 0 and self.battle.player then
975 975 local buffAdd = self.battle.player:getRewardChange(itemId)
976 976 count = math.floor(math.max(0, (count + buffAdd[0]) * (1 + buffAdd[1]))) --附加 buff 的影响
977 977 self:checkTask(Adv.TaskType.Item, count, itemId)
... ...
src/adv/AdvBlock.lua
... ... @@ -60,9 +60,9 @@ function Block:updateEvent(event, isInit)
60 60 end
61 61 self:randomEvent()
62 62 end
63   - self:quickDrop()
64 63  
65 64 if not isInit and self.isOpen then
  65 + self:quickDrop()
66 66 local newet = self:getEventType()
67 67 if oldet ~= newet then
68 68 local em = {}
... ...
src/adv/AdvPassive.lua
... ... @@ -532,7 +532,7 @@ function Passive:effect8(dropId)
532 532 end
533 533  
534 534 --9=直接获得item(可在结算触发时使用)
535   -function Passive:effect9(itemId, triggerPms, ratio, max)
  535 +function Passive:effect9(itemId, triggerPms, ratio, ratio2, max)
536 536 local cond = nil
537 537 if self.passiveData.value == 0 then
538 538 cond = triggerPms.score
... ... @@ -542,7 +542,7 @@ function Passive:effect9(itemId, triggerPms, ratio, max)
542 542 return
543 543 end
544 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 546 end
547 547  
548 548 --10=战斗额外掉落次数
... ...
1   -Subproject commit c820a5807bf24a342c40fcbb5def8a31899cc664
  1 +Subproject commit b86293f02222b1fbd499e57de9ead6cbd6e0d736
... ...
src/models/Activity.lua
... ... @@ -482,6 +482,9 @@ activityFunc[Activity.ActivityType.Exchange] = {
482 482 actData[actId] = {}
483 483 self:updateActData(actType, actData, not notify)
484 484 end,
  485 + ["login"] = function(self, actType, actId)
  486 + activityFunc[Activity.ActivityType.Exchange]["crossDay"](self, actType, true, actId)
  487 + end,
485 488 ["crossDay"] = function(self, actType, notify, actId)
486 489 local actData = self:getActData(actType) or {}
487 490 local lastTs = actData["ts"] or 0
... ... @@ -490,14 +493,14 @@ activityFunc[Activity.ActivityType.Exchange] = {
490 493 if not cfg then return end
491 494 local refreshTimes = cfg.condition2:toArray(false, "=")
492 495 for i = 1, #refreshTimes do
493   - local rt = toUnixtime(refreshTimes[1]..string_format("%02x", RESET_TIME))
  496 + local rt = toUnixtime(refreshTimes[i]..string_format("%02x", RESET_TIME))
494 497 if timeNow >= rt and rt > lastTs then
495 498 lastTs = rt
496 499 actData = {}
497 500 end
498 501 end
499   - if next(actData) then
500   - actData["ts"] = lastTs
  502 + if not next(actData) then
  503 + actData["ts"] = timeNow
501 504 self:updateActData(actType, actData, not notify)
502 505 end
503 506 end,
... ...
src/models/Role.lua
... ... @@ -57,7 +57,7 @@ Role.schema = {
57 57 ltime = {"number", 0}, -- 最后登录时间
58 58 ctime = {"number", skynet.timex()}, -- 创建时间
59 59 ignoreMt = {"number", 0}, -- 忽略维护拦截
60   - sversion = {"number", globalCsv.StructVersion or 0}, -- 重整数据版本
  60 + sversion = {"number", STRUCT_VERSION or 0}, -- 重整数据版本
61 61 timeReset = {"table", {}}, --重置轮回记录
62 62 diamond = {"number", 0},
63 63 reDiamond = {"number", 0},
... ...
src/models/RoleChangeStruct.lua
... ... @@ -31,6 +31,7 @@ local awardGift = createVersionFunc(VersionType.Override ,function(role, params)
31 31 print("awardGift" .. " >>> " .. params)
32 32 end)
33 33  
  34 +
34 35 local bugFixSuduku = createVersionFunc(VersionType.DoOnly, function(role, params)
35 36 local sudoku = role:getProperty("sudoku")
36 37 local phase = sudoku[-1] or 1
... ... @@ -65,12 +66,21 @@ local bugFixRune = createVersionFunc(VersionType.DoOnly, function(role, params)
65 66 -- 补偿
66 67 end
67 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 77 ---------------------版本方法 end ----------------------
69 78  
70 79 -- version 罗列start
71 80 local versionList = {} -- version 列表
72 81 versionList[1] = {bugFixSuduku, {}}
73 82 versionList[2] = {bugFixRune, {}}
  83 +versionList[3] = {bugFixAdvPlayer, {}}
74 84 -- versionList[2] = {clearActivity, {5, 7}}
75 85 -- versionList[3] = {changeStructF, "test1"}
76 86 -- versionList[4] = {changeStructF, "test2"}
... ... @@ -87,11 +97,11 @@ function RoleChangeStruct.bind(Role)
87 97  
88 98 function Role:changeStructVersion()
89 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 102 local jumpVersion = {}
93 103 local versionTemp = {}
94   - for version = curVersion + 1, globalCsv.StructVersion do
  104 + for version = curVersion + 1, STRUCT_VERSION do
95 105 local versionData = versionList[version]
96 106 if versionData then
97 107 if versionData[1].vType == VersionType.DoOnly then
... ... @@ -124,7 +134,7 @@ function RoleChangeStruct.bind(Role)
124 134 end
125 135 end
126 136  
127   - for version = curVersion + 1, globalCsv.StructVersion do
  137 + for version = curVersion + 1, STRUCT_VERSION do
128 138 if not jumpVersion[version] then
129 139 local versionData = versionList[version]
130 140 if versionData[1].vType == VersionType.DoOnly or versionData[1].vType == VersionType.Override then
... ... @@ -134,7 +144,7 @@ function RoleChangeStruct.bind(Role)
134 144 end
135 145 end
136 146 end
137   - self:setProperty("sversion", globalCsv.StructVersion)
  147 + self:setProperty("sversion", STRUCT_VERSION)
138 148 end
139 149  
140 150 end
... ...
src/models/RolePlugin.lua
... ... @@ -286,7 +286,7 @@ function RolePlugin.bind(Role)
286 286 print("addPlayExp no log ", debug.traceback())
287 287 end
288 288  
289   - self:updateProperties({level = level, exp = newExp})
  289 + self:updateProperties({level = level, exp = newExp}, params.notNotify)
290 290 self:changeCrossServerPvpSelfInfo("level")
291 291 end
292 292  
... ... @@ -387,7 +387,7 @@ function RolePlugin.bind(Role)
387 387 end
388 388  
389 389 if update then
390   - self:updateProperty({field = "boxL", value = boxL})
  390 + self:updateProperty({field = "boxL", value = boxL, notNotify = pms.notNotify})
391 391 end
392 392 end
393 393  
... ... @@ -1705,6 +1705,9 @@ function RolePlugin.bind(Role)
1705 1705 local dataSet = csvdb["shop_rechargeCsv"][rechargeId]
1706 1706  
1707 1707 if orderObject:getProperty("finishTime") > 0 then
  1708 + skynet.error(string.format("[recharge] is a finish order cpOrder: %s, platformOrder : %s, hadPlatformOrder: %s, id: %s, overTime : %s",
  1709 + partnerOrderStr, platformOrder, orderObject:getProperty("transactionId"), rechargeId, orderObject:getProperty("finishTime")
  1710 + ))
1708 1711 return false, "finsh"
1709 1712 end
1710 1713  
... ... @@ -1753,7 +1756,6 @@ function RolePlugin.bind(Role)
1753 1756 local roleId = self:getProperty("id")
1754 1757 local partnerOrderStr = params.order
1755 1758  
1756   -
1757 1759 local status, back = self:updatePurchaseOrder(partnerOrderStr, params.transactionId, "finsh")
1758 1760 if not status then
1759 1761 if back == "finsh" then
... ...