源战役
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.

202 regels
8.8 KiB

4 weken geleden
  1. %% ---------------------------------------------------------------------------
  2. %% @doc activitycalen.hrl
  3. %% @author xiaoxiang
  4. %% @since 2017-03-06
  5. %% @deprecated 活动日历
  6. %% ---------------------------------------------------------------------------
  7. -ifndef(ACTIVITYCALEN_HRL).
  8. -define(ACTIVITYCALEN_HRL, ok).
  9. -define(AC_WAIT, 0). %% 活动等待
  10. -define(AC_OPEN, 1). %% 活动开启
  11. -define(AC_END, 2). %% 活动结束
  12. -define(AC_LV_LIMIT, 3). %% 活动等级限制
  13. -define(AC_FINISH, 4). %% 活动完成
  14. %% ----------------------- 次数类型 -----------------------
  15. -define(ACTIVITY_COUNT_TYPE_NORMAL, 1). % 通用次数(活动进入次数等等)
  16. -define(ACTIVITY_COUNT_TYPE_HELP_COUNT, 2). % 助战次数(目前用于副本助战)
  17. -define(ACTIVITY_TYPE_DAILY, 1). % 1-非限时活动
  18. -define(ACTIVITY_TYPE_TIME, 2). % 2-限时活动
  19. -define(ACTIVITY_LIVENESS, 1). % 日计数器 活跃度次数Id
  20. -define(AC_LIVE_ADD, 10000).
  21. -define(AC_LIVE_ADD_EACH, 10000).
  22. -define(LOG_TYPE_AC_START_BY_CALEN, 1). %% 活动日历拉起活动
  23. -define(LOG_TYPE_AC_START_BY_AC, 2). %% 活动启动
  24. -define(LOG_TYPE_AC_END_BY_AC, 3). %% 活动结束
  25. -define(LOG_TYPE_AC_ADVANCE_BY_CALEN, 4). %% 活动预告
  26. -define(NOT_REWARD, 0). %% 不可领
  27. -define(HAVE_REWARD, 1). %% 可领
  28. -define(FINISH_REWARD, 2). %% 已领
  29. -define(ETS_ACTIVITYCALEN, ets_activitycalen). %% #ets_activitycalen{}
  30. -define(ETS_ACTIVITY_IN_STATE, ets_activity_in_state). %% #ets_activity_in_state{}
  31. -define(SUP_VIP_ADD_TIMES, 3). %% 贵族增加快速挂机次数
  32. -record(ets_activitycalen, {
  33. id = 0, %%玩家id
  34. create_time = 0, %%玩家创建时间
  35. liveness_list = [] %%活跃度:保留5天 [{ZeroTime, Val}]
  36. }).
  37. %% 玩家的活动进入状态
  38. -record(ets_activity_in_state, {
  39. key = {} %% {mod_id, role_id}
  40. ,mod_id = 0 %% 功能Id
  41. ,is_count_down = 0 %% 是否倒计时结束进入 0-否 1-是
  42. }).
  43. %% 其他参数(15701协议传递的特殊参数)
  44. -record(other_data, {
  45. is_sup_vip = false %% 是否贵族
  46. ,main_line_times = [] %% 主线副本{使用次数,配置最大次数}
  47. }).
  48. %% -------------------------------------------后台配置-----------------------------------------------------------------
  49. %% 活动日历
  50. -record(base_ac, {
  51. module = 0,
  52. module_sub = 0, % 功能id和子功能ID确定唯一活动
  53. ac_sub = 0, % 活动子类用于区分同一活动的不同配置
  54. ac_name = "",
  55. ac_icon = 0,
  56. num = 0, % 活动单位:1-单人2-组队3-公会4-对战5-竞技
  57. start_lv = 0, % 玩家到达等级才看到“日常”标签页的图标,才能参加活动
  58. end_lv = 0, % 玩家到达等级,活动消失,“日常”标签页的图标消失
  59. ac_type = 0, % 活动类型:1-非限时活动;2-限时活动
  60. week = [], % 格式:[1,2,3,4,5,6,7] ,7表示星期天 []默认为每天都开
  61. month = [], % 格式:[1,2,28], 勿填>28的数字(程序容错,>28时不开启) []默认为每天都开
  62. time = [], % 格式:[{2017,3,11}],[] 默认为每天都开
  63. time_region = [], % 格式:[{{开始时间},{结束时间}},{{}}];如[{{20,0},{20,30}}] 非定时活动固定填[]
  64. open_day = 0, % 格式:[{开服开始天数,结束天数},{}];如[{1,20},{50,100}],[]默认每天都开
  65. merge_day = 0, % 和开服格式一样,注:[]为单服,合服必须填具体内容
  66. about = "",
  67. reward = [], % 格式:[{等级,[{类型,道具id,数量},{类型,道具id,数量}]}]
  68. ask = 0,
  69. look = 0,
  70. other = [],
  71. start_timestamp = 0, % 开始时间戳
  72. end_timestamp = 0, % 结束时间戳
  73. timestamp = [], % 时间范围有效 [{start_timestamp, end_timestamp}|...] 开始时间戳,结束时间戳 时间戳属于区间则生效 []默认满足
  74. type = 0, % 默认为0 merge_day使用的为活动日历规则([]为单服,合服必须填具体内容 )1为merge_day使用充值活动规则([]为满足)
  75. node_type = 0, % 生效节点:0本服/1跨服/2本服和跨服
  76. pre_notice = 0 % 提前预告显示(配置格式为 分钟数,例:5即为活动开始5分钟前预告。0为不预告)
  77. }).
  78. %% 活跃度配置
  79. -record(ac_liveness, {
  80. module = 0,
  81. module_sub = 0,
  82. act_type = 0,
  83. name = "",
  84. start_lv = 0,
  85. end_lv = 0,
  86. max = 0,
  87. res_max = 0,
  88. live = 0
  89. }).
  90. %% 奖励配置
  91. -record(ac_reward, {
  92. sort = 0,
  93. id = 0,
  94. min_lv = 0,
  95. max_lv = 0,
  96. live = 0, % 活跃度
  97. reward = []
  98. }).
  99. %% 活动推送配置
  100. -record(ac_push, {
  101. module = 0,
  102. module_sub = 0,
  103. push = 0,
  104. push_msg = ""
  105. }).
  106. %% 活跃度升级配置
  107. -record(base_liveness_lv, {
  108. lv = 0, % 等级
  109. exp = 0, % 经验
  110. attr = [], % 属性
  111. awards = []
  112. }).
  113. %% 活跃度外形激活配置
  114. -record(base_liveness_active, {
  115. id = 0, % 外形Id
  116. name = "", % 外形名称
  117. lv = 0, % 激活等级
  118. figure_id = 0 % 资源id
  119. }).
  120. %% 活动预约
  121. -record (base_act_reserve, {
  122. module_id = 0, % 功能id
  123. module_sub = 0, % 子功能id
  124. ac_sub = 0, % 子类id
  125. index = 0, % 前端排序
  126. rewards = [], % 预约奖励
  127. content = "", % 文本
  128. sign = [] % 标识
  129. }).
  130. %% --------------------------------------------------state---------------------------
  131. -record(ac_mgr_state, {
  132. ref = none,
  133. ac_maps = maps:new() % 活动状态记录
  134. %ac_start = [] % 活动首次开启记录
  135. ,cluster_type = 0 % 节点类型:跨服|游戏服
  136. }).
  137. -record(ac_state, {
  138. ac_maps = maps:new(), % 活动状态
  139. ac_end_maps = maps:new(), % role_id => [{ac_id, num}|...]
  140. live_maps = maps:new() % role_id => live
  141. }).
  142. -record(role_liveness, {
  143. lv = 0, % 活跃度等级
  144. exp = 0, % 经验
  145. attr = [], % 活跃度增加的属性
  146. live = 0,
  147. olive = 0,
  148. ltime = 0,
  149. combat = 0 % 活跃度增加的战力
  150. }).
  151. %% ----------------------------------------------------------------------------------
  152. -define(sql_inset_ac_start, <<"insert into active_start(ac_id, ac_sub, ac_type, time) values(~p, ~p, ~p, ~p)">>).
  153. -define(sql_select_ac_start, <<"select `ac_id`, `ac_sub`, `ac_type`, `time` from `active_start` ">>).
  154. -define(sql_player_liveness_select, <<"select `lv`, `exp`,`live`,`olive`,`ltime` from `player_liveness` where `rid` = ~p">>).
  155. -define(sql_player_liveness_replace, <<"replace into `player_liveness` (`rid`, `lv`, `exp`,`live`,`olive`,`ltime`) values(~p, ~p, ~p,~p,~p,~p)">>).
  156. %%玩家每日活跃度统计(5天)
  157. -define(sql_select_role_live, <<"select role_id, create_time, livess_list from `player_daily_liveness` ">>).
  158. -define(sql_replace_role_live, <<"replace into `player_daily_liveness` (role_id, create_time, livess_list) values(~p, ~p, '~s')">>).
  159. -define(sql_select_role_reserve, <<"select module, module_sub, ac_sub, reserve, join_act, rewards from `role_act_reserve` where role_id = ~p">>).
  160. -define(sql_replace_into_role_reserve, <<"replace into `role_act_reserve` set role_id = ~p, module = ~p, module_sub = ~p, ac_sub = ~p, reserve = ~p, join_act = ~p, rewards = ~p">>).
  161. -define(sql_batch_replace_into_role_reserve, <<"replace into `role_act_reserve`(role_id, module, module_sub, ac_sub, reserve, join_act, rewards) values ~ts">>).
  162. -define(sql_batch_replace_role_reserve_value, <<"(~p, ~p, ~p, ~p, ~p, ~p, ~p)">>).
  163. -define(sql_delete_role_reserve, <<"delete from `role_act_reserve` where role_id = ~p">>).
  164. -define(sql_truncate_role_reserve, <<"truncate table `role_act_reserve`">>).
  165. -define(sql_batch_replace_role_reserve, <<"replace into `role_act_reserve`(`role_id`, `module`, `module_sub`, `ac_sub`, `reserve`, `join_act`, `rewards`)">>).
  166. -define(sql_delete_role_module_reserve, <<"delete from `role_act_reserve` where role_id = ~p and module = ~p and module_sub = ~p and ac_sub = ~p">>).
  167. -endif.