Commit 67b46a6b2f99987c0ab3d2a6964b5dd7c83d8694

Authored by zhouhaihai
1 parent 16f58f21

修复存在的冒险进不去的玩家

@@ -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/AdvAction.lua
@@ -963,6 +963,9 @@ function _M.roleFormatRpc(agent , data) @@ -963,6 +963,9 @@ function _M.roleFormatRpc(agent , data)
963 local index = msg.index -- 阵容索引 963 local index = msg.index -- 阵容索引
964 local title = msg.title -- 阵容名称 964 local title = msg.title -- 阵容名称
965 local team = {} 965 local team = {}
  966 +
  967 + if role:getAdvData():isRunning() then return 3 end
  968 +
966 for slot, heroId in pairs(msg.heros) do 969 for slot, heroId in pairs(msg.heros) do
967 if not role.heros[heroId] then 970 if not role.heros[heroId] then
968 return 1 971 return 1
@@ -1005,6 +1008,9 @@ function _M.selectTeamRpc(agent, data) @@ -1005,6 +1008,9 @@ function _M.selectTeamRpc(agent, data)
1005 local role = agent.role 1008 local role = agent.role
1006 local msg = MsgPack.unpack(data) 1009 local msg = MsgPack.unpack(data)
1007 local index = msg.index -- 阵容索引 1010 local index = msg.index -- 阵容索引
  1011 +
  1012 + if role:getAdvData():isRunning() then return 1 end
  1013 +
1008 local team = role:getAdvTeamFormat(index) 1014 local team = role:getAdvTeamFormat(index)
1009 if not next(team) then return end 1015 if not next(team) then return end
1010 team["index"] = index 1016 team["index"] = index
@@ -408,7 +408,7 @@ function Adv:forceOver(notNotify) @@ -408,7 +408,7 @@ function Adv:forceOver(notNotify)
408 for itemId, count in pairs(reward) do 408 for itemId, count in pairs(reward) do
409 reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 409 reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败
410 end 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 self:clear() 413 self:clear()
414 self.owner:updateProperties({ 414 self.owner:updateProperties({
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/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
@@ -286,7 +286,7 @@ function RolePlugin.bind(Role) @@ -286,7 +286,7 @@ function RolePlugin.bind(Role)
286 print("addPlayExp no log ", debug.traceback()) 286 print("addPlayExp no log ", debug.traceback())
287 end 287 end
288 288
289 - self:updateProperties({level = level, exp = newExp}) 289 + self:updateProperties({level = level, exp = newExp}, params.notNotify)
290 self:changeCrossServerPvpSelfInfo("level") 290 self:changeCrossServerPvpSelfInfo("level")
291 end 291 end
292 292
@@ -387,7 +387,7 @@ function RolePlugin.bind(Role) @@ -387,7 +387,7 @@ function RolePlugin.bind(Role)
387 end 387 end
388 388
389 if update then 389 if update then
390 - self:updateProperty({field = "boxL", value = boxL}) 390 + self:updateProperty({field = "boxL", value = boxL, notNotify = pms.notNotify})
391 end 391 end
392 end 392 end
393 393