Commit f7a55da340a32f062739018657603a6697783a13
1 parent
318a7041
新增cb2临时限时礼包
Showing
6 changed files
with
33 additions
and
4 deletions
Show diff stats
src/GlobalVar.lua
src/actions/HeroAction.lua
src/models/Activity.lua
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"), | ... | ... |