|
|
- %% ---------------------------------------------------------------------------
- %% @doc activitycalen.hrl
- %% @author xiaoxiang
- %% @since 2017-03-06
- %% @deprecated 活动日历
- %% ---------------------------------------------------------------------------
- -ifndef(ACTIVITYCALEN_HRL).
- -define(ACTIVITYCALEN_HRL, ok).
-
- -define(AC_WAIT, 0). %% 活动等待
- -define(AC_OPEN, 1). %% 活动开启
- -define(AC_END, 2). %% 活动结束
- -define(AC_LV_LIMIT, 3). %% 活动等级限制
- -define(AC_FINISH, 4). %% 活动完成
-
- %% ----------------------- 次数类型 -----------------------
- -define(ACTIVITY_COUNT_TYPE_NORMAL, 1). % 通用次数(活动进入次数等等)
- -define(ACTIVITY_COUNT_TYPE_HELP_COUNT, 2). % 助战次数(目前用于副本助战)
-
-
- -define(ACTIVITY_TYPE_DAILY, 1). % 1-非限时活动
- -define(ACTIVITY_TYPE_TIME, 2). % 2-限时活动
-
- -define(ACTIVITY_LIVENESS, 1). % 日计数器 活跃度次数Id
-
- -define(AC_LIVE_ADD, 10000).
- -define(AC_LIVE_ADD_EACH, 10000).
-
- -define(LOG_TYPE_AC_START_BY_CALEN, 1). %% 活动日历拉起活动
- -define(LOG_TYPE_AC_START_BY_AC, 2). %% 活动启动
- -define(LOG_TYPE_AC_END_BY_AC, 3). %% 活动结束
- -define(LOG_TYPE_AC_ADVANCE_BY_CALEN, 4). %% 活动预告
-
- -define(NOT_REWARD, 0). %% 不可领
- -define(HAVE_REWARD, 1). %% 可领
- -define(FINISH_REWARD, 2). %% 已领
-
- -define(ETS_ACTIVITYCALEN, ets_activitycalen). %% #ets_activitycalen{}
- -define(ETS_ACTIVITY_IN_STATE, ets_activity_in_state). %% #ets_activity_in_state{}
-
- -define(SUP_VIP_ADD_TIMES, 3). %% 贵族增加快速挂机次数
-
- -record(ets_activitycalen, {
- id = 0, %%玩家id
- create_time = 0, %%玩家创建时间
- liveness_list = [] %%活跃度:保留5天 [{ZeroTime, Val}]
- }).
-
- %% 玩家的活动进入状态
- -record(ets_activity_in_state, {
- key = {} %% {mod_id, role_id}
- ,mod_id = 0 %% 功能Id
- ,is_count_down = 0 %% 是否倒计时结束进入 0-否 1-是
- }).
-
- %% 其他参数(15701协议传递的特殊参数)
- -record(other_data, {
- is_sup_vip = false %% 是否贵族
- ,main_line_times = [] %% 主线副本{使用次数,配置最大次数}
- }).
-
- %% -------------------------------------------后台配置-----------------------------------------------------------------
- %% 活动日历
- -record(base_ac, {
- module = 0,
- module_sub = 0, % 功能id和子功能ID确定唯一活动
- ac_sub = 0, % 活动子类用于区分同一活动的不同配置
- ac_name = "",
- ac_icon = 0,
- num = 0, % 活动单位:1-单人2-组队3-公会4-对战5-竞技
- start_lv = 0, % 玩家到达等级才看到“日常”标签页的图标,才能参加活动
- end_lv = 0, % 玩家到达等级,活动消失,“日常”标签页的图标消失
- ac_type = 0, % 活动类型:1-非限时活动;2-限时活动
- week = [], % 格式:[1,2,3,4,5,6,7] ,7表示星期天 []默认为每天都开
- month = [], % 格式:[1,2,28], 勿填>28的数字(程序容错,>28时不开启) []默认为每天都开
- time = [], % 格式:[{2017,3,11}],[] 默认为每天都开
- time_region = [], % 格式:[{{开始时间},{结束时间}},{{}}];如[{{20,0},{20,30}}] 非定时活动固定填[]
- open_day = 0, % 格式:[{开服开始天数,结束天数},{}];如[{1,20},{50,100}],[]默认每天都开
- merge_day = 0, % 和开服格式一样,注:[]为单服,合服必须填具体内容
- about = "",
- reward = [], % 格式:[{等级,[{类型,道具id,数量},{类型,道具id,数量}]}]
- ask = 0,
- look = 0,
- other = [],
- start_timestamp = 0, % 开始时间戳
- end_timestamp = 0, % 结束时间戳
- timestamp = [], % 时间范围有效 [{start_timestamp, end_timestamp}|...] 开始时间戳,结束时间戳 时间戳属于区间则生效 []默认满足
- type = 0, % 默认为0 merge_day使用的为活动日历规则([]为单服,合服必须填具体内容 )1为merge_day使用充值活动规则([]为满足)
- node_type = 0, % 生效节点:0本服/1跨服/2本服和跨服
- pre_notice = 0 % 提前预告显示(配置格式为 分钟数,例:5即为活动开始5分钟前预告。0为不预告)
- }).
-
- %% 活跃度配置
- -record(ac_liveness, {
- module = 0,
- module_sub = 0,
- act_type = 0,
- name = "",
- start_lv = 0,
- end_lv = 0,
- max = 0,
- res_max = 0,
- live = 0
- }).
-
- %% 奖励配置
- -record(ac_reward, {
- sort = 0,
- id = 0,
- min_lv = 0,
- max_lv = 0,
- live = 0, % 活跃度
- reward = []
- }).
-
- %% 活动推送配置
- -record(ac_push, {
- module = 0,
- module_sub = 0,
- push = 0,
- push_msg = ""
- }).
-
- %% 活跃度升级配置
- -record(base_liveness_lv, {
- lv = 0, % 等级
- exp = 0, % 经验
- attr = [], % 属性
- awards = []
- }).
-
- %% 活跃度外形激活配置
- -record(base_liveness_active, {
- id = 0, % 外形Id
- name = "", % 外形名称
- lv = 0, % 激活等级
- figure_id = 0 % 资源id
- }).
-
- %% 活动预约
- -record (base_act_reserve, {
- module_id = 0, % 功能id
- module_sub = 0, % 子功能id
- ac_sub = 0, % 子类id
- index = 0, % 前端排序
- rewards = [], % 预约奖励
- content = "", % 文本
- sign = [] % 标识
- }).
-
-
- %% --------------------------------------------------state---------------------------
- -record(ac_mgr_state, {
- ref = none,
- ac_maps = maps:new() % 活动状态记录
- %ac_start = [] % 活动首次开启记录
- ,cluster_type = 0 % 节点类型:跨服|游戏服
- }).
-
- -record(ac_state, {
- ac_maps = maps:new(), % 活动状态
- ac_end_maps = maps:new(), % role_id => [{ac_id, num}|...]
- live_maps = maps:new() % role_id => live
- }).
-
-
- -record(role_liveness, {
- lv = 0, % 活跃度等级
- exp = 0, % 经验
- attr = [], % 活跃度增加的属性
-
- live = 0,
- olive = 0,
- ltime = 0,
-
- combat = 0 % 活跃度增加的战力
- }).
- %% ----------------------------------------------------------------------------------
-
- -define(sql_inset_ac_start, <<"insert into active_start(ac_id, ac_sub, ac_type, time) values(~p, ~p, ~p, ~p)">>).
-
- -define(sql_select_ac_start, <<"select `ac_id`, `ac_sub`, `ac_type`, `time` from `active_start` ">>).
-
- -define(sql_player_liveness_select, <<"select `lv`, `exp`,`live`,`olive`,`ltime` from `player_liveness` where `rid` = ~p">>).
-
- -define(sql_player_liveness_replace, <<"replace into `player_liveness` (`rid`, `lv`, `exp`,`live`,`olive`,`ltime`) values(~p, ~p, ~p,~p,~p,~p)">>).
-
- %%玩家每日活跃度统计(5天)
- -define(sql_select_role_live, <<"select role_id, create_time, livess_list from `player_daily_liveness` ">>).
- -define(sql_replace_role_live, <<"replace into `player_daily_liveness` (role_id, create_time, livess_list) values(~p, ~p, '~s')">>).
-
- -define(sql_select_role_reserve, <<"select module, module_sub, ac_sub, reserve, join_act, rewards from `role_act_reserve` where role_id = ~p">>).
- -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">>).
- -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">>).
- -define(sql_batch_replace_role_reserve_value, <<"(~p, ~p, ~p, ~p, ~p, ~p, ~p)">>).
- -define(sql_delete_role_reserve, <<"delete from `role_act_reserve` where role_id = ~p">>).
- -define(sql_truncate_role_reserve, <<"truncate table `role_act_reserve`">>).
- -define(sql_batch_replace_role_reserve, <<"replace into `role_act_reserve`(`role_id`, `module`, `module_sub`, `ac_sub`, `reserve`, `join_act`, `rewards`)">>).
- -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">>).
-
- -endif.
-
|