WeekendLoopActRank.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --------------------------------
  2. -- 文件名 : WeekendLoopActRank.lua
  3. -- 文件说明 : 周末冲刺-排行榜
  4. -- 创建时间 : 2024/12/09
  5. -- 创建人 : FC
  6. --------------------------------
  7. local Msg = require("core.Msg")
  8. local Util = require("common.Util")
  9. local Lang = require("common.Lang")
  10. local CommonRankDB = require("common.CommonRankDB")
  11. local OpenServerRankDB = require("present.OpenServerRankDB")
  12. local Broadcast = require("broadcast.Broadcast")
  13. local OpenAct = require("present.OpenAct")
  14. local YunYingLogic = require("yunying.YunYingLogic")
  15. local DrawCardLogic = require("drawCard.DrawCardLogic")
  16. local CommonDefine = require("common.CommonDefine")
  17. --[[
  18. local:
  19. public:
  20. query() -- 发送活动信息
  21. onCharge() -- 充值回调
  22. WeekActRank_ResetData(human) -- 重置玩家身上的充值
  23. WeekActRank_ResetDBData() -- 重置排行榜数据
  24. --]]
  25. ----------------------------------------- 内部处理开始 -------------------------------------
  26. -- 重置
  27. function WeekActRank_ResetCharge(human)
  28. -- if not human then
  29. -- return
  30. -- end
  31. -- human.db.nWeekCharge = 0
  32. end
  33. -- 获取充值额度
  34. function WeekActRank_GetCharge(human)
  35. -- if not human then
  36. -- return 0
  37. -- end
  38. -- if not human.db.nWeekCharge then
  39. -- WeekActRank_ResetCharge(human)
  40. -- end
  41. -- return human.db.nWeekCharge
  42. end
  43. -- 设置充值额度
  44. function WeekActRank_GetCharge(human, nVal)
  45. -- if not human or 0 >= nVal then
  46. -- return
  47. -- end
  48. -- if not human.db.nWeekCharge then
  49. -- WeekActRank_ResetCharge(human)
  50. -- end
  51. -- human.db.nWeekCharge = human.db.nWeekCharge + nVal
  52. end
  53. ----------------------------------------- 外部调用 -------------------------------------
  54. function WeekActRank_ResetData(human)
  55. if not human then
  56. return
  57. end
  58. --WeekActRank_ResetCharge(human)
  59. end
  60. function WeekActRank_ResetDBData()
  61. -- CommonRankDB.ResetData()
  62. end
  63. -- 活动结束
  64. function WeekActRank_End()
  65. CommonRankDB.onRewardSend(CommonDefine.COMMONRANK_TYPE_WEEKRANK)
  66. end
  67. -- 充值回调
  68. function onCharge(human, price, funcID, buyID)
  69. CommonRankDB.onValueAdd(human, CommonDefine.COMMONRANK_TYPE_WEEKRANK, price)
  70. end
  71. ----------------------------------------- 外部调用 -------------------------------------
  72. -- 客户端请求
  73. function WeekActRank_Query(human)
  74. local nRankType = CommonDefine.COMMONRANK_TYPE_WEEKRANK
  75. local maxSendRank = CommonRankDB.getMaxSendRank(nRankType)
  76. local msgRet = Msg.gc.GC_WEEKLOOP_ACT_RANK_QUERY
  77. CommonRankDB.wrapOwnerData(nRankType, msgRet.ownerData, human.db._id)
  78. for rank = 1,maxSendRank do
  79. CommonRankDB.wrapOpenServerRankList(nRankType, msgRet.list[rank], rank)
  80. end
  81. msgRet.list[0] = maxSendRank
  82. Msg.send(msgRet, human.fd)
  83. end