Commit 70cc72d73d10436600a6fa6e04196153aa6d6dd8

Authored by zhouhaihai
1 parent ab4aa967

拾荒bug

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  
... ...
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
... ...