OpenAct.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. OPEN_ACT_GIFTPACKAGE = 11-- 开服礼包
  17. function getOpenActTime(id)
  18. local openDay = CommonDB.getServerOpenDay()
  19. if openDay == nil then
  20. return false, 0
  21. end
  22. local OpenActConfig = OpenActExcel.openAct[id]
  23. if not OpenActConfig then return false, 0 end
  24. local sDay = OpenActConfig.sDay;
  25. local eDay = OpenActConfig.eDay;
  26. if openDay >= sDay and openDay <= eDay then
  27. local time = os.time();
  28. local openTime = CommonDB.getServerOpenTime()
  29. if openTime == 0 then
  30. return false, 0
  31. end
  32. local endTime = Util.getDayStartTime(openTime) + eDay * 86400
  33. return true, endTime - time
  34. end
  35. return false, 0
  36. end
  37. function onServerOpenTime()
  38. LimitMangHeLogic.initAfterHot()
  39. LimitPerpleHeroLogic.initAfterHot()
  40. end
  41. function initAfterHot()
  42. LimitMangHeLogic.initAfterHot()
  43. LimitPerpleHeroLogic.initAfterHot()
  44. end