源战役
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 line
2.2 KiB

  1. %%-----------------------------------------------------------------------------
  2. %% @doc 福利大厅
  3. %%-----------------------------------------------------------------------------
  4. %% 计数器:每日
  5. -define(COUNTER_WELFARE_SIGN_IN, 1). %% 每日签到状态
  6. -define(COUNTER_WELFARE_ONLINE_TIME, 2). %% 每日在线时长
  7. -define(COUNTER_WELFARE_ONLINE_AWARD, 3). %% 在线奖励领取状态
  8. -define(COUNTER_WELFARE_LEVEL_AWARD, 4). %% 等级奖励领取状态
  9. %% 计数器:全服
  10. -define(COUNTER_GLOBAL_LEVEL_AWARD, 1).
  11. %% 奖励领取状态
  12. -define(WELFARE_AWARD_STATE(State, No),
  13. (State band (1 bsl (No - 1)))
  14. ).
  15. %% 设置奖励领取状态
  16. -define(WELFARE_SET_AWARD_STATE(State, No),
  17. (State bxor (1 bsl (No - 1)))
  18. ).
  19. -record(status_welfare, {
  20. %% 每日签到: 签到状态由计数器控制
  21. sign_in_round = 0 %% 签到周期
  22. , sign_in_days = 0 %% 签到天数
  23. , cumulative_sign_in_info = 0 %% 累计签到奖励情况
  24. %% 在线奖励: 在线时长和奖励领取情况存放于日计数器
  25. , online_type = 1 %% 在线奖励类型:某个时机会变成2
  26. %% 冲级大礼
  27. , level_award_state = 0
  28. %% 资源下载
  29. , download_award_state = 0
  30. }).
  31. %-----------------------------------------------------------------------------
  32. %% @doc DB
  33. %-----------------------------------------------------------------------------
  34. %% 上线初始化
  35. -define(SQL_GET_WELFARE_DATA, <<"select round,days,online_type,level_award_state,download_award_state,cumulative_sign_in_info from player_welfare where role_id=~p">>).
  36. %% 保存数据
  37. -define(SQL_SAVE_WELFARE_DATA, <<"replace into player_welfare(role_id,round,days,online_type,level_award_state,download_award_state,cumulative_sign_in_info) values(~p,~p,~p,~p,~p,~p,~p)">>).
  38. %%在线数据
  39. -define(sql_select_online, <<"select `count`,`refresh_time` from `counter_daily_twelve` where `role_id` = ~p and `module`=~p and `sub_module`=0 and `type`=~p">>).
  40. %-----------------------------------------------------------------------------
  41. %% @doc 配置
  42. %-----------------------------------------------------------------------------
  43. -record(base_welfare_sign_in_award, {
  44. round,
  45. day,
  46. award,
  47. vip_lv,
  48. vip_ratio
  49. }).
  50. -record(base_welfare_level_award, {
  51. id,
  52. level,
  53. career,
  54. sex,
  55. award,
  56. limit_award,
  57. limit_num
  58. }).