OpenAct.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --开服活动
  2. local OpenActExcel = require("excel.openAct")
  3. local CommonDB = require("common.CommonDB")
  4. local Util = require("common.Util")
  5. local LimitMangHeLogic = require("present.LimitMangHeLogic")
  6. local LimitPerpleHeroLogic = require("present.LimitPerpleHeroLogic")
  7. OPEN_ACT_SERVER_GIFT = 1 -- 开服有礼
  8. OPEN_ACT_KING_WORLD = 2 -- 战神降临
  9. OPEN_ACT_CHONG_JI = 3 -- 冲级有礼
  10. OPEN_ACT_DRAW_CARD = 5 -- 招募豪礼
  11. OPEN_ACT_DRAW_CARD_RANK = 6 -- 招募排行
  12. OPEN_ACT_SINGLE_CHARGE = 7 -- 单笔充值
  13. OPEN_ACT_TOTAL_CONSUME = 8 -- 累计消耗钻石
  14. OPEN_ACT_TOPUP_RANK = 9 -- 充值排行
  15. OPEN_ACT_TOWER_RANK = 10-- 爬塔排行
  16. function getOpenActTime(id)
  17. local openDay = CommonDB.getServerOpenDay()
  18. if openDay == nil then
  19. return false, 0
  20. end
  21. local OpenActConfig = OpenActExcel.openAct[id]
  22. if not OpenActConfig then return false, 0 end
  23. local sDay = OpenActConfig.sDay;
  24. local eDay = OpenActConfig.eDay;
  25. if openDay >= sDay and openDay <= eDay then
  26. local time = os.time();
  27. local openTime = CommonDB.getServerOpenTime()
  28. if openTime == 0 then
  29. return false, 0
  30. end
  31. local endTime = Util.getDayStartTime(openTime) + eDay * 86400
  32. return true, endTime - time
  33. end
  34. return false, 0
  35. end
  36. function onServerOpenTime()
  37. LimitMangHeLogic.initAfterHot()
  38. LimitPerpleHeroLogic.initAfterHot()
  39. end
  40. function initAfterHot()
  41. LimitMangHeLogic.initAfterHot()
  42. LimitPerpleHeroLogic.initAfterHot()
  43. end