Commit 4f7bcc86eedf73af0c5e7a24a46983f8b39c32f5

Authored by zhouhaihai
2 parents f9aa5539 70cc72d7

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

* tr/bugfix:
  拾荒bug
  无论什么方式翻开中继层格子都给奖励
  跨天礼包重置
@@ -142,7 +142,6 @@ ItemId = { @@ -142,7 +142,6 @@ ItemId = {
142 TimeReset = { 142 TimeReset = {
143 CrossDay = 1, --通用跨天 143 CrossDay = 1, --通用跨天
144 CrossWeek = 2, --通用跨周 144 CrossWeek = 2, --通用跨周
145 - CrossMonth = 1, --通用跨月 索引使用跨天,在回调方法中判断是否跨越 跨月的前置条件是跨天  
146 DinerRank = 1, -- 餐厅排行榜 145 DinerRank = 1, -- 餐厅排行榜
147 PvpRank = 2, -- pvp排行榜 146 PvpRank = 2, -- pvp排行榜
148 PvpHight = 11, --高级竞技场 147 PvpHight = 11, --高级竞技场
src/actions/RoleAction.lua
@@ -157,6 +157,7 @@ function _M.loginRpc( agent, data ) @@ -157,6 +157,7 @@ function _M.loginRpc( agent, data )
157 SERV_OPEN = redisproxy:hget("autoincrement_set", "server_start") 157 SERV_OPEN = redisproxy:hget("autoincrement_set", "server_start")
158 158
159 role:changeStructVersion() -- 数据结构 版本更新 159 role:changeStructVersion() -- 数据结构 版本更新
  160 + role:getAdvData(true) -- 清掉不合格的数据
160 role:advEndlessSeasonCheck(true) -- 冒险赛季更新检查 161 role:advEndlessSeasonCheck(true) -- 冒险赛季更新检查
161 162
162 -- 跨天登陆事件 163 -- 跨天登陆事件
@@ -20,8 +20,6 @@ function Adv:ctor(owner) @@ -20,8 +20,6 @@ function Adv:ctor(owner)
20 self.advTask = self.owner:getProperty("advTask") 20 self.advTask = self.owner:getProperty("advTask")
21 self.advMTask = self.owner:getProperty("advMTask") 21 self.advMTask = self.owner:getProperty("advMTask")
22 self.advTaskChange = false -- 任务改变才更新 22 self.advTaskChange = false -- 任务改变才更新
23 -  
24 - self:initByInfo(self.owner:getProperty("advInfo"))  
25 end 23 end
26 24
27 function Adv:mylog(contents) 25 function Adv:mylog(contents)
@@ -36,7 +34,8 @@ function Adv:mylog(contents) @@ -36,7 +34,8 @@ function Adv:mylog(contents)
36 end 34 end
37 35
38 --初始化adv 信息 36 --初始化adv 信息
39 -function Adv:initByInfo(advInfo) 37 +function Adv:initByInfo()
  38 + local advInfo = self.owner:getProperty("advInfo")
40 if not next(advInfo) then return end --还没有 开始新地图 39 if not next(advInfo) then return end --还没有 开始新地图
41 40
42 self.chapterId = advInfo.chapterId 41 self.chapterId = advInfo.chapterId
@@ -397,10 +396,9 @@ function Adv:isRunning() @@ -397,10 +396,9 @@ function Adv:isRunning()
397 return false 396 return false
398 end 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 local advTeam = self.owner:getProperty("advTeam") 402 local advTeam = self.owner:getProperty("advTeam")
405 advTeam.player = nil 403 advTeam.player = nil
406 404
@@ -1690,9 +1688,6 @@ function Adv:clickBlock(roomId, blockId, params) @@ -1690,9 +1688,6 @@ function Adv:clickBlock(roomId, blockId, params)
1690 if not block.isOpen then 1688 if not block.isOpen then
1691 if self.isRelay or checkAroundBlocks() then --开放 1689 if self.isRelay or checkAroundBlocks() then --开放
1692 self:getCurMap():openBlock(roomId, blockId, true, true) 1690 self:getCurMap():openBlock(roomId, blockId, true, true)
1693 - if self.isRelay and self:getCurMap():isAllOpen() then -- 发放翻开的奖励  
1694 - self:passAdvRelay()  
1695 - end  
1696 status = true 1691 status = true
1697 end 1692 end
1698 else 1693 else
src/adv/AdvMap.lua
@@ -272,6 +272,10 @@ function Map:openBlock(roomId, blockId, isPlayer, ignoreBack) @@ -272,6 +272,10 @@ function Map:openBlock(roomId, blockId, isPlayer, ignoreBack)
272 if not ignoreBack then 272 if not ignoreBack then
273 self.adv:backBlockChange(roomId, blockId) 273 self.adv:backBlockChange(roomId, blockId)
274 end 274 end
  275 +
  276 + if self.adv.isRelay and self:isAllOpen() then -- 发放翻开的奖励
  277 + self.adv:passAdvRelay()
  278 + end
275 end 279 end
276 return status 280 return status
277 end 281 end
src/models/RolePlugin.lua
@@ -804,9 +804,16 @@ function RolePlugin.bind(Role) @@ -804,9 +804,16 @@ function RolePlugin.bind(Role)
804 return runeSet 804 return runeSet
805 end 805 end
806 806
807 - function Role:getAdvData() 807 + function Role:getAdvData(notNotify)
808 if not self.advData then 808 if not self.advData then
809 self.advData = require("adv.Adv").new(self) 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 end 817 end
811 return self.advData 818 return self.advData
812 end 819 end
src/models/RoleTimeReset.lua
@@ -48,10 +48,6 @@ ResetFunc["CrossWeek"] = function(self, notify, response) @@ -48,10 +48,6 @@ ResetFunc["CrossWeek"] = function(self, notify, response)
48 response.dinerS = {} 48 response.dinerS = {}
49 end 49 end
50 50
51 --- 30天 非自然月  
52 -ResetFunc["CrossMonth"] = function(self, notify, response)  
53 -end  
54 -  
55 51
56 ResetFunc["DinerRank"] = function(self, notify, response) 52 ResetFunc["DinerRank"] = function(self, notify, response)
57 self.dinerData:rankResetData(notify) 53 self.dinerData:rankResetData(notify)
@@ -91,15 +87,10 @@ function Role:updateTimeReset(now, notify) @@ -91,15 +87,10 @@ function Role:updateTimeReset(now, notify)
91 ResetFunc[funcName](self, notify, response, now) 87 ResetFunc[funcName](self, notify, response, now)
92 resetMode[funcName] = true 88 resetMode[funcName] = true
93 end 89 end
94 - if needResetId[resetId] then  
95 - -- 充值商城购买记录  
96 - if resetId ~= TimeReset.CrossMonth then  
97 - self.storeData:resetStoreReored(resetId)  
98 - end  
99 - end  
100 end 90 end
101 91
102 for resetId, round in pairs(needResetId) do 92 for resetId, round in pairs(needResetId) do
  93 + self.storeData:resetStoreReored(resetId)
103 timeReset[resetId] = round 94 timeReset[resetId] = round
104 end 95 end
105 self:setProperties({timeReset = timeReset, ltime = now}) 96 self:setProperties({timeReset = timeReset, ltime = now})