Commit bde24ff1531045f4cd8cf3f51c6167393f455caa
Merge branch 'bugfix' into tr/cb
Showing
6 changed files
with
36 additions
and
6 deletions
Show diff stats
src/GlobalVar.lua
src/actions/HeroAction.lua
@@ -738,7 +738,7 @@ function _M.drawHeroRpc(agent, data) | @@ -738,7 +738,7 @@ function _M.drawHeroRpc(agent, data) | ||
738 | 738 | ||
739 | if btype == 1 then | 739 | if btype == 1 then |
740 | -- 判断定向卡池活动开启 | 740 | -- 判断定向卡池活动开启 |
741 | - if not role.activity:isOpen("SsrUpPoolChange") then | 741 | + if not role.activity:isOpen("RaceDraw") then |
742 | return | 742 | return |
743 | end | 743 | end |
744 | end | 744 | end |
@@ -982,8 +982,9 @@ function _M.drawHeroRpc(agent, data) | @@ -982,8 +982,9 @@ function _M.drawHeroRpc(agent, data) | ||
982 | --end | 982 | --end |
983 | SendPacket(actionCodes.Hero_drawHeroExtraRewardNtf, MsgPack.pack(role:packReward(r, change))) | 983 | SendPacket(actionCodes.Hero_drawHeroExtraRewardNtf, MsgPack.pack(role:packReward(r, change))) |
984 | elseif drawCardReward and drawCardReward ~= "" then | 984 | elseif drawCardReward and drawCardReward ~= "" then |
985 | - role:award(drawCardReward, {log = {desc = "drawHeroExtraReward", int1 = oldVal, int2 = newVal}}) | ||
986 | - SendPacket(actionCodes.Hero_drawHeroExtraRewardNtf, MsgPack.pack({reward = drawCardReward:toNumMap()})) | 985 | + local r,change = {} |
986 | + r, change = role:award(drawCardReward, {log = {desc = "drawHeroExtraReward", int1 = oldVal, int2 = newVal}}) | ||
987 | + SendPacket(actionCodes.Hero_drawHeroExtraRewardNtf, MsgPack.pack(role:packReward(r, change))) | ||
987 | end | 988 | end |
988 | role:updateProperty({field = "repayHero", value = val}) | 989 | role:updateProperty({field = "repayHero", value = val}) |
989 | end | 990 | end |
src/models/Activity.lua
@@ -18,7 +18,7 @@ Activity.ActivityType = { | @@ -18,7 +18,7 @@ Activity.ActivityType = { | ||
18 | DrawHero = 12, --抽卡周 招募 | 18 | DrawHero = 12, --抽卡周 招募 |
19 | AdvDraw = 13, --拾荒抽周 资助 | 19 | AdvDraw = 13, --拾荒抽周 资助 |
20 | OpenBox = 14, --拆解周 时钟箱 | 20 | OpenBox = 14, --拆解周 时钟箱 |
21 | - --RaceDraw = 15, -- 定向招募活动 | 21 | + RaceDraw = 16, -- 定向招募活动 |
22 | } | 22 | } |
23 | 23 | ||
24 | 24 |
src/models/RoleTimeReset.lua
@@ -90,7 +90,7 @@ function Role:updateTimeReset(now, notify) | @@ -90,7 +90,7 @@ function Role:updateTimeReset(now, notify) | ||
90 | self:setProperties({timeReset = timeReset, ltime = now}) | 90 | self:setProperties({timeReset = timeReset, ltime = now}) |
91 | 91 | ||
92 | response.timeReset = timeReset | 92 | response.timeReset = timeReset |
93 | - response.ltime = ltime | 93 | + response.ltime = now |
94 | 94 | ||
95 | if notify then | 95 | if notify then |
96 | self:notifyUpdateProperties(response) | 96 | self:notifyUpdateProperties(response) |
src/models/Store.lua
@@ -420,7 +420,35 @@ function Store:checkPaySignReward() | @@ -420,7 +420,35 @@ function Store:checkPaySignReward() | ||
420 | end | 420 | end |
421 | end | 421 | end |
422 | 422 | ||
423 | +-- 临时用 登录触发限时礼包 时间点以后 | ||
424 | +function Store:OnTriggerLimitTimePackAfterTs(eventType, param) | ||
425 | + local limitPack = self:getProperty("limitTPack") | ||
426 | + local timeNow = skynet.timex() | ||
427 | + local config = nil | ||
428 | + for id, cfg in pairs(csvdb["shop_packCsv"]) do | ||
429 | + local ts = toUnixtime(""..cfg.condition) | ||
430 | + if cfg.type == eventType and ts < param then | ||
431 | + config = cfg | ||
432 | + | ||
433 | + if config ~= nil then | ||
434 | + local rechargeCfg = csvdb["shop_rechargeCsv"][config.packId] | ||
435 | + if rechargeCfg then | ||
436 | + if not limitPack[rechargeCfg.id] then | ||
437 | + limitPack[rechargeCfg.id] = {timeNow + rechargeCfg.time, config.id} | ||
438 | + self.owner:log("push_gift", { | ||
439 | + gift_id = rechargeCfg.id, --礼包ID | ||
440 | + gift_name = rechargeCfg.title, --礼包名称 | ||
441 | + }) | ||
442 | + self:updateProperty({field = "limitTPack", value = limitPack, notNotify = false}) | ||
443 | + end | ||
444 | + end | ||
445 | + end | ||
446 | + end | ||
447 | + end | ||
448 | +end | ||
449 | + | ||
423 | function Store:data() | 450 | function Store:data() |
451 | + self:OnTriggerLimitTimePackAfterTs(TriggerEventType.AfterTs, skynet.timex()) | ||
424 | return { | 452 | return { |
425 | buyR = self:getProperty("buyR"), | 453 | buyR = self:getProperty("buyR"), |
426 | payR = self:getProperty("payR"), | 454 | payR = self:getProperty("payR"), |