Commit 4f7bcc86eedf73af0c5e7a24a46983f8b39c32f5
Merge branch 'tr/bugfix' into tr/publish/release
* tr/bugfix: 拾荒bug 无论什么方式翻开中继层格子都给奖励 跨天礼包重置
Showing
6 changed files
with
19 additions
and
22 deletions
Show diff stats
src/GlobalVar.lua
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 | -- 跨天登陆事件 | ... | ... |
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 |
... | ... | @@ -397,10 +396,9 @@ function Adv:isRunning() |
397 | 396 | return false |
398 | 397 | end |
399 | 398 | |
400 | --- 强制结束 | |
401 | -function Adv:forceOver(notNotify) | |
402 | - if self:isRunning() then | |
403 | - | |
399 | +-- 强制结束 逻辑和adv内部无关 | |
400 | +function Adv:forceOver(notNotify, force) | |
401 | + if self:isRunning() or force then | |
404 | 402 | local advTeam = self.owner:getProperty("advTeam") |
405 | 403 | advTeam.player = nil |
406 | 404 | |
... | ... | @@ -1690,9 +1688,6 @@ function Adv:clickBlock(roomId, blockId, params) |
1690 | 1688 | if not block.isOpen then |
1691 | 1689 | if self.isRelay or checkAroundBlocks() then --开放 |
1692 | 1690 | self:getCurMap():openBlock(roomId, blockId, true, true) |
1693 | - if self.isRelay and self:getCurMap():isAllOpen() then -- 发放翻开的奖励 | |
1694 | - self:passAdvRelay() | |
1695 | - end | |
1696 | 1691 | status = true |
1697 | 1692 | end |
1698 | 1693 | 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/RolePlugin.lua
... | ... | @@ -804,9 +804,16 @@ function RolePlugin.bind(Role) |
804 | 804 | return runeSet |
805 | 805 | end |
806 | 806 | |
807 | - function Role:getAdvData() | |
807 | + function Role:getAdvData(notNotify) | |
808 | 808 | if not self.advData then |
809 | 809 | self.advData = require("adv.Adv").new(self) |
810 | + local status, err = pcall(function() | |
811 | + self.advData:initByInfo() | |
812 | + end) | |
813 | + if not status then | |
814 | + self.advData:forceOver(notNotify, true) | |
815 | + skynet.error("getAdvData error adv initByInfo " .. err) | |
816 | + end | |
810 | 817 | end |
811 | 818 | return self.advData |
812 | 819 | end | ... | ... |
src/models/RoleTimeReset.lua
... | ... | @@ -48,10 +48,6 @@ ResetFunc["CrossWeek"] = function(self, notify, response) |
48 | 48 | response.dinerS = {} |
49 | 49 | end |
50 | 50 | |
51 | --- 30天 非自然月 | |
52 | -ResetFunc["CrossMonth"] = function(self, notify, response) | |
53 | -end | |
54 | - | |
55 | 51 | |
56 | 52 | ResetFunc["DinerRank"] = function(self, notify, response) |
57 | 53 | self.dinerData:rankResetData(notify) |
... | ... | @@ -91,15 +87,10 @@ function Role:updateTimeReset(now, notify) |
91 | 87 | ResetFunc[funcName](self, notify, response, now) |
92 | 88 | resetMode[funcName] = true |
93 | 89 | end |
94 | - if needResetId[resetId] then | |
95 | - -- 充值商城购买记录 | |
96 | - if resetId ~= TimeReset.CrossMonth then | |
97 | - self.storeData:resetStoreReored(resetId) | |
98 | - end | |
99 | - end | |
100 | 90 | end |
101 | 91 | |
102 | 92 | for resetId, round in pairs(needResetId) do |
93 | + self.storeData:resetStoreReored(resetId) | |
103 | 94 | timeReset[resetId] = round |
104 | 95 | end |
105 | 96 | self:setProperties({timeReset = timeReset, ltime = now}) | ... | ... |