Commit f7a55da340a32f062739018657603a6697783a13

Authored by liuzujun
1 parent 318a7041

新增cb2临时限时礼包

src/GlobalVar.lua
... ... @@ -315,6 +315,7 @@ TriggerEventType = {
315 315 LevelUp = 4,
316 316 AddNewHero = 5,
317 317 SSRCount = 6,
  318 + AfterTs = 7, -- 某时间以后
318 319 }
319 320  
320 321 DrawCardType = {
... ...
src/actions/HeroAction.lua
... ... @@ -738,7 +738,7 @@ function _M.drawHeroRpc(agent, data)
738 738  
739 739 if btype == 1 then
740 740 -- 判断定向卡池活动开启
741   - if not role.activity:isOpen("SsrUpPoolChange") then
  741 + if not role.activity:isOpen("RaceDraw") then
742 742 return
743 743 end
744 744 end
... ...
1   -Subproject commit 0e38227a4444f21a0a9c1a7911b5e2af79c8ed0a
  1 +Subproject commit 02a9bbbb10bb99a91cc5d67f62dc7e5b49d8cb46
... ...
src/models/Activity.lua
... ... @@ -18,7 +18,7 @@ Activity.ActivityType = {
18 18 DrawHero = 12, --抽卡周 招募
19 19 AdvDraw = 13, --拾荒抽周 资助
20 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 90 self:setProperties({timeReset = timeReset, ltime = now})
91 91  
92 92 response.timeReset = timeReset
93   - response.ltime = ltime
  93 + response.ltime = now
94 94  
95 95 if notify then
96 96 self:notifyUpdateProperties(response)
... ...
src/models/Store.lua
... ... @@ -420,7 +420,35 @@ function Store:checkPaySignReward()
420 420 end
421 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 450 function Store:data()
  451 + self:OnTriggerLimitTimePackAfterTs(TriggerEventType.AfterTs, skynet.timex())
424 452 return {
425 453 buyR = self:getProperty("buyR"),
426 454 payR = self:getProperty("payR"),
... ...